|
@@ -157,7 +157,7 @@ class ReportSectionGeneratorAgent:
|
|
|
|
|
|
|
|
return section_content
|
|
return section_content
|
|
|
|
|
|
|
|
-async def generate_report_section_content(api_key: str, base_url: str, model_name: str, section: Dict[str, Any], max_retries: int = 2) -> str:
|
|
|
|
|
|
|
+async def generate_report_section_content(api_key: str, base_url: str, model_name: str, section: Dict[str, Any], chapter_num: int, total_sections: int, max_retries: int = 2) -> str:
|
|
|
"""
|
|
"""
|
|
|
生成报告章节内容(可以重试)
|
|
生成报告章节内容(可以重试)
|
|
|
|
|
|
|
@@ -176,7 +176,7 @@ async def generate_report_section_content(api_key: str, base_url: str, model_nam
|
|
|
|
|
|
|
|
agent = ReportSectionGeneratorAgent(api_key=api_key, base_url=base_url, model_name=model_name)
|
|
agent = ReportSectionGeneratorAgent(api_key=api_key, base_url=base_url, model_name=model_name)
|
|
|
|
|
|
|
|
- print(f"📝 开始生成报告章节:{section['title']} 内容(最多重试 {max_retries} 次)...")
|
|
|
|
|
|
|
+ print(f"📝 开始生成报告第 {chapter_num}章/{total_sections} 内容:{section['title']} 内容(最多重试 {max_retries} 次)...")
|
|
|
section_content = ""
|
|
section_content = ""
|
|
|
for attempt in range(max_retries):
|
|
for attempt in range(max_retries):
|
|
|
try:
|
|
try:
|
|
@@ -186,7 +186,7 @@ async def generate_report_section_content(api_key: str, base_url: str, model_nam
|
|
|
section_content = await agent.generate_section_content(section)
|
|
section_content = await agent.generate_section_content(section)
|
|
|
elapsed_time = time.time() - start_time
|
|
elapsed_time = time.time() - start_time
|
|
|
print(f"{elapsed_time:.2f}")
|
|
print(f"{elapsed_time:.2f}")
|
|
|
- print(f"\n📝 章节{section['title']}生成成功:")
|
|
|
|
|
|
|
+ print(f"\n📝 章节{section['title']} 内容生成成功:")
|
|
|
|
|
|
|
|
return section_content
|
|
return section_content
|
|
|
|
|
|