feat: AI分析第三档——海外期货章节、报告分卡片渲染、红绿着色、期号;LLM改流式+分段生成绕开网关120s超时

This commit is contained in:
Sakurasan
2026-09-02 13:17:49 +08:00
parent 311b9f0d7e
commit 1d46ad7a08
8 changed files with 358 additions and 120 deletions
+4 -1
View File
@@ -43,8 +43,11 @@ def _can_trigger(trade_date: str) -> tuple[bool, str]:
async def get_latest_report():
conn = get_connection()
try:
# issue_number:按报告日期序数作为总期号
row = conn.execute(
"SELECT * FROM ai_reports ORDER BY trade_date DESC, id DESC LIMIT 1"
"""SELECT r.*,
(SELECT COUNT(*) FROM ai_reports WHERE trade_date <= r.trade_date) AS issue_number
FROM ai_reports r ORDER BY r.trade_date DESC, r.id DESC LIMIT 1"""
).fetchone()
if not row:
raise HTTPException(status_code=404, detail="暂无分析报告")