feat: 添加 Action 协议

This commit is contained in:
2026-09-23 15:33:28 +08:00
parent f0d33ff058
commit 5ef873bfe9
14 changed files with 284 additions and 25 deletions
+5 -1
View File
@@ -12,6 +12,7 @@ from app.processor.nodes.intent_node import IntentNode
from app.processor.nodes.requirement_node import RequirementNode
from app.processor.nodes.wait_for_user_node import WaitForUserNode
from app.processor.nodes.qa_node import QANode
from app.processor.nodes.scope_node import ScopeNode
from app.processor.state import QueryState
@@ -39,6 +40,7 @@ def build_graph(checkpointer=None):
"clarify_node": ClarifyNode(),
"wait_for_user_node": WaitForUserNode(),
"qa_node": QANode(),
"scope_node": ScopeNode(),
}
# 注册节点,异步节点使用 BaseNode 的异步入口
@@ -65,10 +67,11 @@ def build_graph(checkpointer=None):
workflow.add_conditional_edges(
source="requirement_node",
path=route_after_requirement,
path_map={True: "clarify_node", False: END},
path_map={True: "clarify_node", False: "scope_node"},
)
workflow.add_edge("clarify_node", "wait_for_user_node")
workflow.add_edge("qa_node", END)
workflow.add_edge("scope_node", END)
workflow.add_conditional_edges(
"wait_for_user_node",
route_after_wait,
@@ -81,6 +84,7 @@ def build_graph(checkpointer=None):
("app.schemas.input_context", "InputContext"),
("app.schemas.decision", "DecisionResponse"),
("app.schemas.requirement", "Requirement"),
("app.schemas.change_scope", "ChangeScope"),
("app.schemas.clarification", "Clarification"),
("app.schemas.clarification_reply", "ClarificationReply"),
]