autodocgenerator 0.9.0.1__py3-none-any.whl → 0.9.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autodocgenerator/engine/config/config.py +4 -3
- autodocgenerator/manage.py +1 -4
- autodocgenerator/preprocessor/spliter.py +8 -3
- autodocgenerator-0.9.0.3.dist-info/METADATA +983 -0
- {autodocgenerator-0.9.0.1.dist-info → autodocgenerator-0.9.0.3.dist-info}/RECORD +6 -6
- autodocgenerator-0.9.0.1.dist-info/METADATA +0 -839
- {autodocgenerator-0.9.0.1.dist-info → autodocgenerator-0.9.0.3.dist-info}/WHEEL +0 -0
|
@@ -110,9 +110,10 @@ BASE_CUSTOM_DISCRIPTIONS = """
|
|
|
110
110
|
1. Use ONLY the provided Context to answer.
|
|
111
111
|
2. If the requested information is not explicitly mentioned in the Context, or if you don't know the answer based on the provided data, respond with an empty string ("") or simply say "No information found".
|
|
112
112
|
3. DO NOT use external knowledge or invent any logic that is not present in the text.
|
|
113
|
-
4. Do not provide any introductory or concluding remarks.
|
|
114
|
-
5. If you dont have any info about it return just !noinfo
|
|
115
|
-
|
|
113
|
+
4. Do not provide any introductory or concluding remarks.
|
|
114
|
+
5. If you dont have any info about it return just !noinfo Exception for "example usage": If the goal is to provide a usage example and the Context contains a class or function implementation, you are permitted to synthesize a code example by deriving the logic strictly from the provided implementation details.
|
|
115
|
+
7. Every response must start with exactly one <a name="CONTENT_DESCRIPTION"></a> tag. The CONTENT_DESCRIPTION must be a short, hyphenated summary of the actual information you are providing (e.g., "user-authentication-logic" instead of "auth.yml").
|
|
116
|
+
STRICT RULES(This rules works only for <a name=""></a> tag):
|
|
116
117
|
|
|
117
118
|
NO filenames or paths (e.g., forbidden: "autodocconfig.yml", "src/config").
|
|
118
119
|
NO file extensions (e.g., forbidden: ".yml", ".md").
|
autodocgenerator/manage.py
CHANGED
|
@@ -67,15 +67,12 @@ class Manager:
|
|
|
67
67
|
self.logger.log(InfoLog("Code mix generation completed."))
|
|
68
68
|
self.progress_bar.update_task()
|
|
69
69
|
|
|
70
|
-
|
|
71
70
|
def generete_doc_parts(self, max_symbols=5_000):
|
|
72
|
-
|
|
73
|
-
|
|
74
71
|
full_code_mix = self.read_file_by_file_key("code_mix")
|
|
75
72
|
|
|
76
73
|
self.logger.log(InfoLog("Starting synchronous documentation generation by parts..."))
|
|
77
74
|
result = gen_doc_parts(full_code_mix,
|
|
78
|
-
max_symbols, self.sync_model,
|
|
75
|
+
max_symbols, self.sync_model, self.config.get_project_settings(),
|
|
79
76
|
self.config.language, self.progress_bar)
|
|
80
77
|
|
|
81
78
|
self.logger.log(InfoLog("Documentation generation by parts completed."))
|
|
@@ -3,6 +3,7 @@ from ..engine.config.config import BASE_PART_COMPLITE_TEXT
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from ..ui.progress_base import BaseProgress
|
|
5
5
|
from ..ui.logging import BaseLogger, InfoLog, ErrorLog, WarningLog
|
|
6
|
+
from .settings import ProjectSettings
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def split_data(data: str, max_symbols: int) -> list[str]:
|
|
@@ -40,7 +41,7 @@ def split_data(data: str, max_symbols: int) -> list[str]:
|
|
|
40
41
|
|
|
41
42
|
return split_objects
|
|
42
43
|
|
|
43
|
-
def write_docs_by_parts(part: str, model: Model, prev_info: str = None, language: str = "en"):
|
|
44
|
+
def write_docs_by_parts(part: str, model: Model, project_settings: ProjectSettings, prev_info: str = None, language: str = "en"):
|
|
44
45
|
logger = BaseLogger()
|
|
45
46
|
logger.log(InfoLog("Generating documentation for a part..."))
|
|
46
47
|
prompt = [
|
|
@@ -48,6 +49,10 @@ def write_docs_by_parts(part: str, model: Model, prev_info: str = None, language
|
|
|
48
49
|
"role": "system",
|
|
49
50
|
"content": f"For the following task use language {language}"
|
|
50
51
|
},
|
|
52
|
+
{
|
|
53
|
+
"role": "system",
|
|
54
|
+
"content": f"global project info: {project_settings.prompt}"
|
|
55
|
+
},
|
|
51
56
|
{
|
|
52
57
|
"role": "system",
|
|
53
58
|
"content": BASE_PART_COMPLITE_TEXT
|
|
@@ -121,7 +126,7 @@ async def async_write_docs_by_parts(part: str, async_model: AsyncModel, global_i
|
|
|
121
126
|
return answer
|
|
122
127
|
|
|
123
128
|
|
|
124
|
-
def gen_doc_parts(full_code_mix, max_symbols, model: Model, language, progress_bar: BaseProgress):
|
|
129
|
+
def gen_doc_parts(full_code_mix, max_symbols, model: Model, project_settings: ProjectSettings, language, progress_bar: BaseProgress):
|
|
125
130
|
splited_data = split_data(full_code_mix, max_symbols)
|
|
126
131
|
result = None
|
|
127
132
|
logger = BaseLogger()
|
|
@@ -131,7 +136,7 @@ def gen_doc_parts(full_code_mix, max_symbols, model: Model, language, progress_b
|
|
|
131
136
|
|
|
132
137
|
all_result = ""
|
|
133
138
|
for i, el in enumerate(splited_data):
|
|
134
|
-
result = write_docs_by_parts(el, model, result, language)
|
|
139
|
+
result = write_docs_by_parts(el, model, project_settings, result, language)
|
|
135
140
|
all_result += result
|
|
136
141
|
all_result += "\n\n"
|
|
137
142
|
|