refactor: 重命名文件更清晰,调整最大推理步数为10
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m49s
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m49s
- subgraph_builder.py → main_graph_builder.py - service.py → agent_service.py - 调整 max_steps 从 40 → 10 - 更新所有相关导入
This commit is contained in:
@@ -325,7 +325,7 @@ def route_by_reasoning(state: MainGraphState) -> str:
|
||||
route = get_route_by_reasoning(reasoning_result)
|
||||
|
||||
# 映射到我们的节点名称
|
||||
# 注意:这些名称必须与 subgraph_builder.py 中定义的节点名称一致
|
||||
# 注意:这些名称必须与 main_graph_builder.py 中定义的节点名称一致
|
||||
route_mapping = {
|
||||
"direct_response": "final_response",
|
||||
"retrieve_rag": "rag_retrieve",
|
||||
|
||||
@@ -79,7 +79,7 @@ class MainGraphState:
|
||||
|
||||
# ========== React 推理专用字段 ==========
|
||||
reasoning_step: int = 0 # 当前推理步数
|
||||
max_steps: int = 40 # 最大推理步数(≤40)
|
||||
max_steps: int = 10 # 最大推理步数(≤10)
|
||||
last_action: str = "" # 上一步动作
|
||||
reasoning_history: List[Dict[str, Any]] = field(default_factory=list) # 推理历史
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ if str(PROJECT_ROOT) not in sys.path:
|
||||
|
||||
load_dotenv(PROJECT_ROOT / ".env")
|
||||
|
||||
from app.agent.service import AIAgentService
|
||||
from app.agent.agent_service import AIAgentService
|
||||
from app.config import DB_URI
|
||||
from app.main_graph.checkpoint.postgres.aio import AsyncPostgresSaver
|
||||
import asyncio
|
||||
|
||||
Reference in New Issue
Block a user