feat(ai): Phase 1A 收尾 — 用量记录 + 健康摘要端点 + 小程序组件

- chat_handler 添加 log_usage 精确记录 token 消耗(provider + model)
- SSE build_sse_stream 添加估算 token 用量记录(4 字符 ≈ 1 token)
- 新增 GET /ai/health-summary 端点聚合患者洞察+分析记录
- 小程序 AiHealthSummaryCard 组件(风险等级+洞察统计+摘要列表)
- 小程序 services/ai-analysis 新增 getHealthSummary API
This commit is contained in:
iven
2026-05-18 23:20:06 +08:00
parent 281c71ebfc
commit 7e3d27ecf3
7 changed files with 397 additions and 2 deletions

View File

@@ -490,6 +490,10 @@ impl AiModule {
"/ai/quota/summary",
axum::routing::get(crate::handler::quota_summary),
)
.route(
"/ai/health-summary",
axum::routing::get(crate::handler::insight_handler::health_summary),
)
.route(
"/ai/budget/status",
axum::routing::get(crate::handler::budget_status),