fix(advisor): fix LLM API call, wire advice_markdown to webapp, update .env.example timeouts

- llm_analyzer.py: use llm.langchain_llm.ainvoke() (correct RAGAS 0.4.3 API)
- webapp/models.py: add advice_markdown field to ReportData
- webapp/services/run_reader.py: add read_advice_markdown() reading optimization_advice.md
- webapp/services/report_builder.py: pass advice_markdown into ReportData
- .env.example: OPENAI_TIMEOUT_SECONDS 30→180, RAGAS_METRIC_TIMEOUT_SECONDS 45→300

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-16 17:12:32 +08:00
parent f5c2dce64a
commit 91c0dab4f9
5 changed files with 21 additions and 5 deletions

View File

@@ -220,3 +220,14 @@ def read_summary_markdown(run_dir: Path) -> str:
return summary_path.read_text(encoding="utf-8")
except OSError:
return ""
def read_advice_markdown(run_dir: Path) -> str:
"""Return the optimization_advice.md for a run, or an empty string if not generated."""
advice_path = run_dir / "optimization_advice.md"
if not advice_path.is_file():
return ""
try:
return advice_path.read_text(encoding="utf-8")
except OSError:
return ""