naman1102 commited on
Commit
274cf00
·
1 Parent(s): 99b84e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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(...) == "tools", go to the "tools" node
79
- "final": END, # if route_agent(...) == "final", transition to 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: