feat:增加分析进度接口

This commit is contained in:
2026-10-10 07:26:24 -07:00
parent e3699d1a30
commit cd5a2b4d8f
15 changed files with 632 additions and 143 deletions
+9
View File
@@ -71,6 +71,15 @@ def insights_enabled() -> bool:
)
def ready_insights(insights: FileInsights | None) -> FileInsights | None:
"""给 agent 看的分析结果:只要说明和列含义,图表推荐是给界面用的,不进请求(请求会进检查点)"""
if insights is None or insights.status != "ready":
return None
if not insights.summary and not insights.columns:
return None
return insights.model_copy(update={"suggestions": []})
async def generate_insights(record: DataFileRecord, root: Path) -> FileInsights:
draft = await _ask(record)
return await asyncio.to_thread(check_draft, draft, record, root)