From 304e1318e51679ecc706383026d651baf5a2cb0e Mon Sep 17 00:00:00 2001 From: root <953994191@qq.com> Date: Wed, 6 May 2026 14:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=9A=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=B9=20debug=5Finfo=20=E7=9A=84=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E4=B8=BB=E8=A6=81=E6=A8=A1=E5=9D=97=E5=B7=B2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/main_graph/nodes/hybrid_router.py | 6 +++--- backend/app/main_graph/nodes/routing.py | 4 ++-- backend/app/main_graph/nodes/web_search.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/main_graph/nodes/hybrid_router.py b/backend/app/main_graph/nodes/hybrid_router.py index 072782a..ce1e627 100644 --- a/backend/app/main_graph/nodes/hybrid_router.py +++ b/backend/app/main_graph/nodes/hybrid_router.py @@ -219,11 +219,11 @@ def route_from_hybrid_decision(state: MainGraphState) -> str: def check_fast_path_success(state: MainGraphState) -> str: - """检查快速路径是否成功""" - if state.debug_info.get("fast_path_failed"): + """检查快速路径是否成功 - 使用新的结构化字段""" + if state.fast_path.failed: info("[Fast Path Check] 快速路径失败,升级到 React 循环") return "escalate" - + info("[Fast Path Check] 快速路径成功,进入 llm_call") return "llm_call" diff --git a/backend/app/main_graph/nodes/routing.py b/backend/app/main_graph/nodes/routing.py index dff32f5..01ce993 100644 --- a/backend/app/main_graph/nodes/routing.py +++ b/backend/app/main_graph/nodes/routing.py @@ -45,8 +45,8 @@ def route_by_reasoning(state: MainGraphState) -> str: info(f"[条件路由] step={state.reasoning_step}, phase={state.current_phase}, history={previous_actions}") - # ========== 获取推理结果 ========== - reasoning_result = state.debug_info.get("reasoning_result") + # ========== 获取推理结果 - 从新的结构化字段获取 ========== + reasoning_result = state.react_reasoning.reasoning_result latest_action = reasoning_result.action.name if reasoning_result else None # ========== 核心检查:DIRECT_RESPONSE 优先 ========== diff --git a/backend/app/main_graph/nodes/web_search.py b/backend/app/main_graph/nodes/web_search.py index d02d9da..bba819e 100644 --- a/backend/app/main_graph/nodes/web_search.py +++ b/backend/app/main_graph/nodes/web_search.py @@ -35,8 +35,8 @@ async def web_search_node(state: MainGraphState, config: Optional[RunnableConfig except Exception as e: info(f"[web_search_node] 无法发送开始事件: {e}") - # 获取搜索查询 - reasoning_result = state.debug_info.get("reasoning_result") + # 获取搜索查询 - 从新的结构化字段获取 + reasoning_result = state.react_reasoning.reasoning_result search_query = reasoning_result.metadata.get("search_query", state.user_query) if reasoning_result else state.user_query try: