Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -72,12 +72,13 @@ def route_agent(state: AgentState, agent_out):
|
|
72 |
return "final"
|
73 |
|
74 |
graph.add_conditional_edges(
|
75 |
-
"agent",
|
76 |
-
route_agent,
|
77 |
-
{
|
78 |
-
"tools": "tools", # if route_agent
|
79 |
-
"final": END
|
80 |
}
|
|
|
81 |
)
|
82 |
compiled_graph = graph.compile()
|
83 |
def respond_to_input(user_input: str) -> str:
|
|
|
72 |
return "final"
|
73 |
|
74 |
graph.add_conditional_edges(
|
75 |
+
source="agent",
|
76 |
+
path=route_agent,
|
77 |
+
path_map={ # This keys must match route_agent(...) returns
|
78 |
+
"tools": "tools", # if route_agent returns "tools", go to node "tools"
|
79 |
+
"final": END # if route_agent returns "final", go to END
|
80 |
}
|
81 |
+
# (We omit `then=` here, so there's no post-processing step.)
|
82 |
)
|
83 |
compiled_graph = graph.compile()
|
84 |
def respond_to_input(user_input: str) -> str:
|