MCPcopy Create free account
hub / github.com/FinStep-AI/ContestTrade / generate_final_report

Function generate_final_report

cli/static/report_template.py:403–421  ·  view source on GitHub ↗

生成最终报告

(final_state: Dict, results_dir: Path)

Source from the content-addressed store, hash-verified

401
402
403def generate_final_report(final_state: Dict, results_dir: Path) -> tuple[str, Path]:
404 """生成最终报告"""
405
406 # 创建报告生成器
407 generator = FinalReportGenerator(final_state)
408
409 # 生成文件名
410 trigger_time = final_state.get('trigger_time', 'N/A')
411
412 if trigger_time != 'N/A' and trigger_time is not None:
413 safe_time = trigger_time.replace(' ', '_').replace(':', '-')
414
415 filename = f"final_report_{safe_time}.md"
416 research_reports_dir = results_dir / "research_reports"
417 research_reports_dir.mkdir(parents=True, exist_ok=True)
418 save_path = research_reports_dir / filename
419 markdown_content = generator.generate_markdown_report(save_path)
420
421 return markdown_content, save_path
422
423
424def display_final_report_interactive(final_state: Dict, results_dir: Path):

Calls 2

Tested by

no test coverage detected