feat: 完成极简 LangGraph 架构迁移,添加 Baosi API 支持
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m36s

主要变更:
- 迁移到极简 LangGraph 标准架构(START → init_state → 记忆 → Agent ⇄ Tools → finalize → END)
- 添加 Baosi API 支持,配置 ops4.7 模型
- 保留本地模型作为默认首选,Baosi 作为备选
- 新架构使用 LangGraph 原生 ToolNode 和 bind_tools
- 移除旧的混合路由、JSON 解析等复杂逻辑
- 把旧代码移到 deprecated/ 目录
- 添加新的 Agent 节点和 Tools 模块
- 添加测试脚本验证新架构
- 所有测试通过 ✓
This commit is contained in:
2026-05-07 00:48:17 +08:00
parent 5e762da740
commit 22fdb625a4
23 changed files with 1232 additions and 494 deletions

View File

@@ -1,61 +1,21 @@
"""
主图节点模块导出
主图节点模块导出 - 极简架构
"""
# 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, should_summarize
from .llm_call import create_dynamic_llm_call_node
from .rag_nodes import rag_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
# 新架构节点
from .agent import create_agent_node
__all__ = [
# React 模式节点
"init_state_node",
"react_reason_node",
"web_search_node",
"error_handling_node",
"route_by_reasoning",
"should_summarize",
"create_dynamic_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",
# 新架构节点
"create_agent_node",
]