重构:移除对 debug_info 的依赖,只使用新的结构化状态字段
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled

This commit is contained in:
2026-05-06 14:45:40 +08:00
parent 0f1691b578
commit dceb9061e8
4 changed files with 30 additions and 57 deletions

View File

@@ -47,22 +47,14 @@ async def react_reason_node(state: MainGraphState, config: Optional[RunnableConf
"timestamp": datetime.now().isoformat()
})
# 步骤4: 更新调试信息(同时更新旧的 debug_info 和新的结构化字段
state.debug_info["last_reasoning"] = {
"action": result.action.name,
"confidence": result.confidence,
"reasoning": result.reasoning
}
state.debug_info["reasoning_result"] = result
state.last_action = result.action.name
# 更新新的结构化字段
# 步骤3: 更新状态 - 只使用新的结构化字段
state.react_reasoning.last_reasoning = {
"action": result.action.name,
"confidence": result.confidence,
"reasoning": result.reasoning
}
state.react_reasoning.reasoning_result = result
state.last_action = result.action.name
# 步骤5: 发送推理事件
await dispatch_custom_event(