整合旧图和新图:添加完整的记忆检索、总结和完成流程
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m42s

This commit is contained in:
2026-05-01 15:43:45 +08:00
parent 229cfa67a2
commit 1f177f7dfd
3 changed files with 178 additions and 60 deletions

View File

@@ -126,6 +126,9 @@ def create_llm_call_node(llm, tools: list):
debug(f"📋 [LLM统计] 详细用量: {token_usage}")
debug("="*80 + "\n")
# 检查是否有工具调用
has_tool_calls = hasattr(response, 'tool_calls') and len(response.tool_calls) > 0
result = {
"messages": [response],
"llm_calls": getattr(state, 'llm_calls', 0) + 1,
@@ -134,7 +137,8 @@ def create_llm_call_node(llm, tools: list):
"turns_since_last_summary": getattr(state, 'turns_since_last_summary', 0) + 1,
"final_result": response.content,
"success": True,
"current_phase": "done"
"current_phase": "done",
"has_tool_calls": has_tool_calls
}
log_state_change("llm_call", {**state, **result}, "离开")