-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharchitecture_builder.py
More file actions
28 lines (25 loc) · 973 Bytes
/
architecture_builder.py
File metadata and controls
28 lines (25 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import logging
import time
from llm_client import LLMClient
from utils import save_markdown
llm = LLMClient()
def generate_architecture_docs(component_docs, files):
try:
all_summaries = "\n\n".join(component_docs.values())
prompt = f"""
You are a senior software architect. Given the following component documentation, generate:
- An overall technical documentation for the repository
- A high-level architecture description
- A detailed flow of the system
- Optionally, a mermaid diagram for the architecture
Component Documentation:
{all_summaries}
"""
start = time.perf_counter()
doc = llm.complete(prompt, max_tokens=4096)
elapsed = time.perf_counter() - start
print(f"Architecture documentation generated in {elapsed:.2f} seconds")
save_markdown({"ARCHITECTURE": doc}, out_path="docs/ARCHITECTURE.md")
except Exception as e:
logging.error(f"Error generating architecture docs: {e}")