Spaces:
Paused
Paused
Commit ·
c921acd
1
Parent(s): 6084a4c
Configure app for Hugging Face deployment
Browse files
graph.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# graph.py (
|
| 2 |
|
| 3 |
import json
|
| 4 |
import re
|
|
@@ -33,7 +33,6 @@ class AgentState(TypedDict):
|
|
| 33 |
execution_path: List[str]
|
| 34 |
rework_cycles: int
|
| 35 |
max_loops: int
|
| 36 |
-
# NEW: Add a field for user-facing status updates
|
| 37 |
status_update: str
|
| 38 |
|
| 39 |
# --- Helper for Robust JSON Parsing ---
|
|
@@ -223,6 +222,7 @@ planner_app = planner_workflow.compile()
|
|
| 223 |
|
| 224 |
# 3. Full Execution Graph
|
| 225 |
main_workflow = StateGraph(AgentState)
|
|
|
|
| 226 |
main_workflow.add_node("memory_retriever", run_memory_retrieval)
|
| 227 |
main_workflow.add_node("intent_agent", run_intent_agent)
|
| 228 |
main_workflow.add_node("pm_agent", run_pm_agent)
|
|
@@ -232,7 +232,9 @@ main_workflow.add_node("qa_agent", run_qa_agent)
|
|
| 232 |
main_workflow.add_node("archivist_agent", run_archivist_agent)
|
| 233 |
main_workflow.add_node("disclaimer_agent", run_disclaimer_agent)
|
| 234 |
|
| 235 |
-
|
|
|
|
|
|
|
| 236 |
main_workflow.add_edge("memory_retriever", "intent_agent")
|
| 237 |
main_workflow.add_edge("intent_agent", "pm_agent")
|
| 238 |
main_workflow.add_edge("experimenter_agent", "synthesis_agent")
|
|
|
|
| 1 |
+
# graph.py (Corrected)
|
| 2 |
|
| 3 |
import json
|
| 4 |
import re
|
|
|
|
| 33 |
execution_path: List[str]
|
| 34 |
rework_cycles: int
|
| 35 |
max_loops: int
|
|
|
|
| 36 |
status_update: str
|
| 37 |
|
| 38 |
# --- Helper for Robust JSON Parsing ---
|
|
|
|
| 222 |
|
| 223 |
# 3. Full Execution Graph
|
| 224 |
main_workflow = StateGraph(AgentState)
|
| 225 |
+
# FIX: The node name must be consistent. Use 'memory_retriever' everywhere.
|
| 226 |
main_workflow.add_node("memory_retriever", run_memory_retrieval)
|
| 227 |
main_workflow.add_node("intent_agent", run_intent_agent)
|
| 228 |
main_workflow.add_node("pm_agent", run_pm_agent)
|
|
|
|
| 232 |
main_workflow.add_node("archivist_agent", run_archivist_agent)
|
| 233 |
main_workflow.add_node("disclaimer_agent", run_disclaimer_agent)
|
| 234 |
|
| 235 |
+
# FIX: The entry point name must match the node name.
|
| 236 |
+
main_workflow.set_entry_point("memory_retriever")
|
| 237 |
+
# FIX: The edge source name must match the node name.
|
| 238 |
main_workflow.add_edge("memory_retriever", "intent_agent")
|
| 239 |
main_workflow.add_edge("intent_agent", "pm_agent")
|
| 240 |
main_workflow.add_edge("experimenter_agent", "synthesis_agent")
|