feat: 完善子图,添加路由函数和审核节点
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m10s

This commit is contained in:
2026-04-25 20:46:30 +08:00
parent d05a57948c
commit e6337eb0fc
5 changed files with 139 additions and 6 deletions

View File

@@ -164,5 +164,22 @@ def format_result(state: NewsAnalysisState) -> NewsAnalysisState:
state.final_result = "\n".join(output_lines)
state.success = True
state.current_phase = "completed"
return state
def should_continue(state: NewsAnalysisState) -> str:
"""
条件路由函数:根据 action 决定下一个节点
"""
action = state.action
if action == NewsAction.QUERY:
return "query_news"
elif action == NewsAction.ANALYZE_URL:
return "analyze_url"
elif action == NewsAction.EXTRACT_KEYWORDS:
return "extract_keywords"
elif action == NewsAction.GENERATE_REPORT:
return "generate_report"
else:
return "format_result"