Update app.py
Browse files
app.py
CHANGED
@@ -65,11 +65,7 @@ graph = StateGraph(State)
|
|
65 |
graph.add_node("Agent", Agent)
|
66 |
graph.add_node("ExecuteTools", ExecuteTools)
|
67 |
|
68 |
-
|
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 |
|