autodocgenerator 0.8.9.7__py3-none-any.whl → 0.8.9.8__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/auto_runner/config_reader.py +2 -2
- autodocgenerator/auto_runner/run_file.py +4 -4
- autodocgenerator/factory/modules/general_modules.py +12 -2
- autodocgenerator/postprocessor/custom_intro.py +31 -1
- {autodocgenerator-0.8.9.7.dist-info → autodocgenerator-0.8.9.8.dist-info}/METADATA +1 -1
- {autodocgenerator-0.8.9.7.dist-info → autodocgenerator-0.8.9.8.dist-info}/RECORD +7 -7
- {autodocgenerator-0.8.9.7.dist-info → autodocgenerator-0.8.9.8.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import yaml
|
|
2
|
-
from autodocgenerator.factory.modules.general_modules import CustomModule
|
|
2
|
+
from autodocgenerator.factory.modules.general_modules import CustomModule, CustomModuleWithOutContext
|
|
3
3
|
from ..config.config import Config, ProjectConfigSettings
|
|
4
4
|
|
|
5
5
|
|
|
@@ -29,6 +29,6 @@ def read_config(file_data: str) -> tuple[Config, list[CustomModule]]:
|
|
|
29
29
|
|
|
30
30
|
custom_discriptions = data.get("custom_descriptions", [])
|
|
31
31
|
|
|
32
|
-
custom_modules = [CustomModule(custom_discription) for custom_discription in custom_discriptions]
|
|
32
|
+
custom_modules = [CustomModuleWithOutContext(custom_discription[1:]) if custom_discription[0] == "%" else CustomModule(custom_discription) for custom_discription in custom_discriptions]
|
|
33
33
|
|
|
34
34
|
return config, custom_modules
|
|
@@ -21,11 +21,11 @@ def gen_doc(project_path: str, config: Config, custom_modules):
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
manager.generate_code_file()
|
|
25
|
-
manager.generete_doc_parts(max_symbols=5000)
|
|
24
|
+
# manager.generate_code_file()
|
|
25
|
+
# manager.generete_doc_parts(max_symbols=5000)
|
|
26
26
|
manager.factory_generate_doc(DocFactory(*custom_modules))
|
|
27
|
-
manager.order_doc()
|
|
28
|
-
manager.factory_generate_doc(DocFactory(IntroLinks()))
|
|
27
|
+
# manager.order_doc()
|
|
28
|
+
# manager.factory_generate_doc(DocFactory(IntroLinks()))
|
|
29
29
|
manager.clear_cache()
|
|
30
30
|
|
|
31
31
|
return manager.read_file_by_file_key("output_doc")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from ..base_factory import BaseModule
|
|
2
2
|
from ...engine.models.model import Model
|
|
3
|
-
from ...postprocessor.custom_intro import generete_custom_discription
|
|
3
|
+
from ...postprocessor.custom_intro import generete_custom_discription, generete_custom_discription_without
|
|
4
4
|
from ...preprocessor.spliter import split_data
|
|
5
5
|
|
|
6
6
|
class CustomModule(BaseModule):
|
|
@@ -10,5 +10,15 @@ class CustomModule(BaseModule):
|
|
|
10
10
|
self.discription = discription
|
|
11
11
|
|
|
12
12
|
def generate(self, info: dict, model: Model):
|
|
13
|
-
result = generete_custom_discription(split_data(info.get("code_mix"), max_symbols=
|
|
13
|
+
result = generete_custom_discription(split_data(info.get("code_mix"), max_symbols=5000), model, self.discription, info.get("language"))
|
|
14
|
+
return result
|
|
15
|
+
|
|
16
|
+
class CustomModuleWithOutContext(BaseModule):
|
|
17
|
+
|
|
18
|
+
def __init__(self, discription: str):
|
|
19
|
+
super().__init__()
|
|
20
|
+
self.discription = discription
|
|
21
|
+
|
|
22
|
+
def generate(self, info: dict, model: Model):
|
|
23
|
+
result = generete_custom_discription_without(model, self.discription, info.get("language"))
|
|
14
24
|
return result
|
|
@@ -99,4 +99,34 @@ def generete_custom_discription(splited_data: str, model: Model, custom_descript
|
|
|
99
99
|
if (result.find("!noinfo") == -1 and result.find("No information found") == -1) or result.find("!noinfo") > 30:
|
|
100
100
|
break
|
|
101
101
|
result = ""
|
|
102
|
-
return result
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
def generete_custom_discription_without(model: Model, custom_description: str, language: str = "en") -> str:
|
|
105
|
+
prompt = [
|
|
106
|
+
{
|
|
107
|
+
"role": "system",
|
|
108
|
+
"content": f"For the following task use language {language}"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"role": "system",
|
|
112
|
+
"content": f"Act as a precise Technical Analyst. You will be provided with specific code or documentation. Your task is to describe and rewrite the following text"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"role": "system",
|
|
116
|
+
"content": """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"). STRICT RULES:
|
|
117
|
+
|
|
118
|
+
NO filenames or paths (e.g., forbidden: "autodocconfig.yml", "src/config").
|
|
119
|
+
NO file extensions (e.g., forbidden: ".yml", ".md").
|
|
120
|
+
NO generic terms (e.g., forbidden: "config", "settings", "run", "docs").
|
|
121
|
+
NO protocols (http/https).
|
|
122
|
+
This tag must appear ONLY ONCE at the very beginning. Never repeat it or use other links"""
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"role": "user",
|
|
126
|
+
"content": f"### Task to discribe: {custom_description}"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
result = model.get_answer_without_history(prompt=prompt)
|
|
131
|
+
return result
|
|
132
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
autodocgenerator/__init__.py,sha256=umUGEkIa6y8lThs0iXDSpYQ5x-EhPpNJMeKotAaN_hI,161
|
|
2
|
-
autodocgenerator/auto_runner/config_reader.py,sha256=
|
|
3
|
-
autodocgenerator/auto_runner/run_file.py,sha256=
|
|
2
|
+
autodocgenerator/auto_runner/config_reader.py,sha256=2BcbblII3EIdi6JZFz3N1eHqxX23_R34_xBwJgr5PGM,1216
|
|
3
|
+
autodocgenerator/auto_runner/run_file.py,sha256=I4catkMUm0gRAlGYL4qVxW5mBxMGBgTkWAmb0yu8IMQ,1397
|
|
4
4
|
autodocgenerator/config/config.py,sha256=M6q999CHKh91hKwxjgBKA6q816XO5BEGj53m1t17On8,1782
|
|
5
5
|
autodocgenerator/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
autodocgenerator/engine/config/config.py,sha256=Ov2SJlJR_9n7aOZk_6jZzHAsyMNFisseAUUJgi6RGSQ,8009
|
|
@@ -9,10 +9,10 @@ autodocgenerator/engine/models/gpt_model.py,sha256=SSXj1o1GV2Y3hQZ7B7WOWTjuLE_iS
|
|
|
9
9
|
autodocgenerator/engine/models/model.py,sha256=LaN3andzG3czmy0jFU60P9ji33BAi1rmqWM2titVZ8w,1901
|
|
10
10
|
autodocgenerator/factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
autodocgenerator/factory/base_factory.py,sha256=NsAWFoTO14XjJ2w9WseoBUb75ooYHEVVEnsW8iIDqSo,1155
|
|
12
|
-
autodocgenerator/factory/modules/general_modules.py,sha256=
|
|
12
|
+
autodocgenerator/factory/modules/general_modules.py,sha256=dLkQmGB5K1gGDTmYzBAC_WLxEhdC9KGRDc8i-DwKM_g,928
|
|
13
13
|
autodocgenerator/factory/modules/intro.py,sha256=0pPz9pL0WpD098J7CFvLC6g144LWQAHVLNHuxETY25c,606
|
|
14
14
|
autodocgenerator/manage.py,sha256=y9XFyfTUZQgMmm91vfG2RQiPGIdFcyp3UcFz68qhhks,4930
|
|
15
|
-
autodocgenerator/postprocessor/custom_intro.py,sha256=
|
|
15
|
+
autodocgenerator/postprocessor/custom_intro.py,sha256=FH4IfCmmyWzNVVpaK3iO1VIAqtAi2eeyeRiKBcUChmM,4547
|
|
16
16
|
autodocgenerator/postprocessor/sorting.py,sha256=KAPSdwUtxmYBMSajI7V7DVzpiFKpBspHLYMXTOXeZxM,2320
|
|
17
17
|
autodocgenerator/preprocessor/code_mix.py,sha256=KdBXqHtYkoi-g2f6Kq0IsT9jtkGvt2LWm7w9d-2I1AY,2502
|
|
18
18
|
autodocgenerator/preprocessor/compressor.py,sha256=VQejX55aD5gwC_ov7JV0vW9DNhFP0G3_zYEp38pV4FY,5173
|
|
@@ -21,6 +21,6 @@ autodocgenerator/preprocessor/spliter.py,sha256=kjU4WRBepLI0JrW7BXSmHb3VxzjzBwVc
|
|
|
21
21
|
autodocgenerator/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
autodocgenerator/ui/logging.py,sha256=r0dWxYvShJjbJVM5P4NYmEvZybrwSGx8Th2ybLOCZuE,1684
|
|
23
23
|
autodocgenerator/ui/progress_base.py,sha256=LCa-Df_JWvqWRgzglZyu-rM4X2q8pJ1OlXTAbc2v3Ls,1947
|
|
24
|
-
autodocgenerator-0.8.9.
|
|
25
|
-
autodocgenerator-0.8.9.
|
|
26
|
-
autodocgenerator-0.8.9.
|
|
24
|
+
autodocgenerator-0.8.9.8.dist-info/METADATA,sha256=vUBl3409SF4VpOk2Pq6J8GiO2e7loDJshUxpZ_cg7so,42485
|
|
25
|
+
autodocgenerator-0.8.9.8.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
|
|
26
|
+
autodocgenerator-0.8.9.8.dist-info/RECORD,,
|
|
File without changes
|