DrishtiSharma commited on
Commit
ed49154
Β·
verified Β·
1 Parent(s): 5b20995

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -65,11 +65,7 @@ graph = StateGraph(State)
65
  graph.add_node("Agent", Agent)
66
  graph.add_node("ExecuteTools", ExecuteTools)
67
 
68
- # Add Conditional Edge to Check for Tools
69
- def custom_tools_condition(state: State):
70
- return "True" if state["messages"][-1].tool_calls else "False"
71
-
72
- graph.add_conditional_edges("Agent", custom_tools_condition, {"True": "ExecuteTools", "False": "Agent"})
73
  graph.add_edge("ExecuteTools", "Agent")
74
  graph.set_entry_point("Agent")
75
 
 
65
  graph.add_node("Agent", Agent)
66
  graph.add_node("ExecuteTools", ExecuteTools)
67
 
68
+ graph.add_conditional_edges("Agent", tools_condition, {"True": "ExecuteTools", "False": "Agent"})
 
 
 
 
69
  graph.add_edge("ExecuteTools", "Agent")
70
  graph.set_entry_point("Agent")
71