feat:增加分析进度接口
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user