Etape 1 OK, sans optionnel
This commit is contained in:
@@ -12,7 +12,17 @@ from app.graph.nodes import (
|
||||
human_review_node,
|
||||
)
|
||||
|
||||
def route_entry_point(state: WorkflowState):
|
||||
if state.get("status") == "spec_approved":
|
||||
return "retrieval"
|
||||
return "pm"
|
||||
|
||||
# --- Fonctions de Routage (Conditional Edges) ---
|
||||
def route_after_pm(state: WorkflowState):
|
||||
current_status = state.get("status")
|
||||
if current_status in ["spec_incomplete", "spec_ready"]:
|
||||
return END
|
||||
return "retrieval"
|
||||
|
||||
def route_after_retrieval(state: WorkflowState):
|
||||
# Si un projet existe, on demande d'abord à l'humain (via le nœud de review)
|
||||
@@ -55,8 +65,22 @@ graph.add_node("dev", dev_node)
|
||||
graph.add_node("qa", qa_node)
|
||||
graph.add_node("human_review", human_review_node)
|
||||
|
||||
graph.set_entry_point("pm")
|
||||
graph.add_edge("pm", "retrieval")
|
||||
graph.set_conditional_entry_point(
|
||||
route_entry_point,
|
||||
{
|
||||
"pm": "pm",
|
||||
"retrieval": "retrieval",
|
||||
},
|
||||
)
|
||||
|
||||
graph.add_conditional_edges(
|
||||
"pm",
|
||||
route_after_pm,
|
||||
{
|
||||
END: END,
|
||||
"retrieval": "retrieval",
|
||||
},
|
||||
)
|
||||
|
||||
# Étape 1 : Choix après recherche vectorielle
|
||||
graph.add_conditional_edges(
|
||||
|
||||
Reference in New Issue
Block a user