autodocgenerator 0.9.0.0__py3-none-any.whl → 0.9.0.1__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.
@@ -9,28 +9,34 @@ You should understand, that it is not full code, it is just part
9
9
  Do NOT skip details; analyze everything that appears in the snippet.
10
10
  """
11
11
 
12
- BASE_PART_COMPLITE_TEXT = """Revised Documentation Prompt
13
- Role: You are a senior technical writer. Input: You will receive a specific code snippet representing a fragment of a larger system.
14
- Task: Write clear, structured, and hierarchical documentation for this fragment. Length: 0.7–1k characters (keep it tight).
15
-
16
- Content Requirements:
17
- Component Responsibility: Define exactly what this specific fragment does.
18
- Interactions: Describe how this piece communicates with the rest of the system.
19
- Technical Details: Detail key functions, classes, and logic flows present in the snippet.
20
- Data Flow: Outline inputs, outputs, side effects, and logic assumptions.
21
-
22
- Constraint - No Generic Headers (CRITICAL):
23
- DO NOT use generic or global topic headers such as "Overview," "Core," "Introduction," "Background," or "System Summary."
24
- All headings must be specific to the functionality of the code fragment provided.
25
-
26
- Context & Style:
27
- Use the global system description as the primary context, but do not restate it. Focus exclusively on the fragment.
28
- Write for developers who are new to the codebase.
29
- Maintain high technical accuracy and a concise, professional tone.
30
-
31
- Formatting:
32
- Use Markdown for structure.
33
- Include HTML anchors near titles: <a name="specific-title"></a> \n ## Specific Title."""
12
+ BASE_PART_COMPLITE_TEXT = """
13
+ Role: You are a Senior Technical Writer & System Architect. Objective: Create high-fidelity, visually polished, and strictly factual documentation for a specific code fragment.
14
+
15
+ 1. STRICT GROUNDING & ACCURACY (NO HALLUCINATIONS):
16
+ Source Truth: Use ONLY the provided code snippet and the explicit global context.
17
+ Zero Assumption Policy: If a function's origin, a variable's purpose, or a data source is not explicitly present in the provided text, do not invent it. If information is missing, omit the section or state: "Information not present in the provided fragment."
18
+ Context Lock: Do not use general knowledge about external libraries unless their specific usage is visible in the code.
19
+
20
+ 2. VISUAL STRUCTURE & MD STYLE:
21
+ Layout: Use a highly scannable, hierarchical Markdown structure.
22
+ Data Visualization: Present Inputs, Outputs, and Parameters in a Markdown Table (Columns: Entity, Type, Role, Notes).
23
+ Emphasis: Use backticks for code symbols, bolding for key terms, and > Blockquotes for critical logic assumptions or warnings.
24
+ Navigation: Every heading must be preceded by an HTML anchor: <a name="unique-id"></a> \n ## Specific Heading.
25
+
26
+ 3. CONTENT REQUIREMENTS (0.7–1k characters):
27
+ Specific Component Responsibility: Define the exact functional role of this fragment within the system.
28
+ Visible Interactions: Describe how this piece communicates with other parts of the system based only on the snippet.
29
+ Technical Logic Flow: A step-by-step breakdown of the classes, functions, and internal logic.
30
+ Data Contract: Detailed flow of inputs, outputs, and side effects in table format.
31
+
32
+ 4. CRITICAL CONSTRAINT - NO GENERIC HEADERS:
33
+ Forbidden: "Overview", "Introduction", "Background", "Technical Details", "Summary", "Core".
34
+ Required: Use headers that describe the specific functionality (e.g., ## [Component Name] Request Validation or ## Stream Processing Pipeline).
35
+
36
+ 5. TONE & STYLE:
37
+ Professional, technical, and laconic.
38
+ Write for developers who need to understand the fragment's implementation instantly.
39
+ Focus exclusively on the fragment; do not restate the global system description."""
34
40
 
35
41
  BASE_INTRODACTION_CREATE_LINKS = """
36
42
  Role: Senior Technical Solutions Architect.
@@ -40,13 +40,13 @@ def split_data(data: str, max_symbols: int) -> list[str]:
40
40
 
41
41
  return split_objects
42
42
 
43
- def write_docs_by_parts(part_id: int, part: str, model: Model, prev_info: str = None, language: str = "en"):
43
+ def write_docs_by_parts(part: str, model: Model, prev_info: str = None, language: str = "en"):
44
44
  logger = BaseLogger()
45
45
  logger.log(InfoLog("Generating documentation for a part..."))
46
46
  prompt = [
47
47
  {
48
48
  "role": "system",
49
- "content": f"For the following task use language {language}. your part id is {part_id}"
49
+ "content": f"For the following task use language {language}"
50
50
  },
51
51
  {
52
52
  "role": "system",
@@ -89,10 +89,7 @@ async def async_write_docs_by_parts(part: str, async_model: AsyncModel, global_i
89
89
  "role": "system",
90
90
  "content": BASE_PART_COMPLITE_TEXT
91
91
  },
92
- # {
93
- # "role": "system",
94
- # "content": global_info
95
- # },
92
+
96
93
  {
97
94
  "role": "user",
98
95
  "content": part
@@ -102,7 +99,7 @@ async def async_write_docs_by_parts(part: str, async_model: AsyncModel, global_i
102
99
  if prev_info is not None:
103
100
  prompt.append({
104
101
  "role": "system",
105
- "content": f"it is last part of documentation that you have write before{prev_info}"
102
+ "content": f"it is last part of documentation that you have write before {prev_info}"
106
103
  })
107
104
 
108
105
  prompt.append({
@@ -134,7 +131,7 @@ def gen_doc_parts(full_code_mix, max_symbols, model: Model, language, progress_b
134
131
 
135
132
  all_result = ""
136
133
  for i, el in enumerate(splited_data):
137
- result = write_docs_by_parts(i + 1, el, model, result, language)
134
+ result = write_docs_by_parts(el, model, result, language)
138
135
  all_result += result
139
136
  all_result += "\n\n"
140
137