Files
ailine/backend/app/main_graph/nodes/__init__.py
root 128aad0c22
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m31s
refactor: 重构快速路径流程,统一通过 llm_call 输出
- 重构 fast_paths.py,让 fast_chitchat 和 fast_rag 都进入 llm_call 而不是直接设置 final_result
- 修改 check_fast_path_success 函数返回 'llm_call' 而不是 'success'
- 更新 main_graph_builder.py 的条件边配置,支持路由到 llm_call
- 在快速路径节点中添加清除 state.final_result 的逻辑,避免复用旧结果
- 重构 RAG 工具初始化方式,使用模块级变量管理
- 修改 finalize.py 让它返回 final_result
- 更新 agent_service.py 的 RAG 工具注入方式
- 简化 hybrid_router.py 的代码结构
- 清理 rag_nodes.py 的全局变量相关代码
- 更新相关测试文件
2026-05-05 04:32:42 +08:00

61 lines
1.5 KiB
Python

"""
主图节点模块导出
"""
# React 模式节点
from .reasoning import react_reason_node
from .web_search import web_search_node
from .error_handling import error_handling_node
from .routing import init_state_node, route_by_reasoning
from .llm_call import create_llm_call_node
from .rag_nodes import rag_retrieve_node, rag_re_retrieve_node
# 记忆节点
from .retrieve_memory import create_retrieve_memory_node
from .memory_trigger import memory_trigger_node, set_mem0_client
from .summarize import create_summarize_node
from .finalize import finalize_node
# 混合路由节点
from .hybrid_router import (
hybrid_router_node,
route_from_hybrid_decision,
check_fast_path_success,
)
from .fast_paths import (
fast_chitchat_node,
fast_rag_node,
fast_tool_node,
)
# 通用工具
from ._utils import dispatch_custom_event, make_react_event
__all__ = [
# React 模式节点
"init_state_node",
"react_reason_node",
"web_search_node",
"error_handling_node",
"route_by_reasoning",
"create_llm_call_node",
"rag_retrieve_node",
"rag_re_retrieve_node",
# 记忆节点
"create_retrieve_memory_node",
"memory_trigger_node",
"set_mem0_client",
"create_summarize_node",
"finalize_node",
# 混合路由节点
"hybrid_router_node",
"route_from_hybrid_decision",
"check_fast_path_success",
"fast_chitchat_node",
"fast_rag_node",
"fast_tool_node",
# 通用工具
"dispatch_custom_event",
"make_react_event",
]