autodocgenerator 0.9.0.1__py3-none-any.whl → 0.9.0.2__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.
@@ -112,7 +112,8 @@ BASE_CUSTOM_DISCRIPTIONS = """
112
112
  3. DO NOT use external knowledge or invent any logic that is not present in the text.
113
113
  4. Do not provide any introductory or concluding remarks. If there is no info, output must be empty.
114
114
  5. If you dont have any info about it return just !noinfo
115
- 6. 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:
115
+ 6. 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").
@@ -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