feat:添加图表数据

This commit is contained in:
2026-10-01 09:25:01 -07:00
parent dd2fd8bcde
commit ce575ec6a0
32 changed files with 108 additions and 48 deletions
+5 -4
View File
@@ -158,7 +158,7 @@ class AgentService:
if result.status == "cancelled":
return "用户取消了本次补充"
if result.status == "failed":
return _clip(f"处理失败:{result.failure_reason or '未知原因'}")
return _clip(f"处理失败:{result.answer or '未知原因'}")
if result.answer:
return _clip(result.answer)
requirement = state.get("requirement")
@@ -176,8 +176,10 @@ class AgentService:
prompt=state["request"]["prompt"],
outcome=result.status,
summary=self._summarize(state, result),
# 只有正常结束的回复中的提议才等待用户确认
offer=state.get("offer") if result.status == "completed" else None,
# 回答或失败说明中的提议等待用户确认,等待补充和取消时没有提议
offer=state.get("offer")
if result.status in ("completed", "failed")
else None,
created_at=datetime.now(timezone.utc),
)
)
@@ -198,7 +200,6 @@ class AgentService:
actions=state["actions"] if deliver else [],
answer=state.get("answer"),
clarification=state.get("clarification") if waiting else None,
failure_reason=state.get("failure_reason"),
)
async def stream(self, thread_id, payload, session_id, user_id=None):