Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,16 +48,16 @@ graph.add_node("tools", tool_node)
|
|
48 |
# Wrap the user_input into state["messages"]
|
49 |
graph.add_edge(
|
50 |
START,
|
51 |
-
"agent"
|
52 |
-
|
53 |
)
|
54 |
|
55 |
# Edge C: "tools" → "agent"
|
56 |
# Whatever string the tool returns becomes the next prompt to the LLM
|
57 |
graph.add_edge(
|
58 |
"tools",
|
59 |
-
"agent"
|
60 |
-
|
61 |
)
|
62 |
|
63 |
# 7) Use add_conditional_edges out of "agent" instead of two separate edges
|
|
|
48 |
# Wrap the user_input into state["messages"]
|
49 |
graph.add_edge(
|
50 |
START,
|
51 |
+
"agent",
|
52 |
+
transition=lambda state, user_input: {"messages": [user_input]},
|
53 |
)
|
54 |
|
55 |
# Edge C: "tools" → "agent"
|
56 |
# Whatever string the tool returns becomes the next prompt to the LLM
|
57 |
graph.add_edge(
|
58 |
"tools",
|
59 |
+
"agent",
|
60 |
+
transition=lambda state, tool_output: tool_output,
|
61 |
)
|
62 |
|
63 |
# 7) Use add_conditional_edges out of "agent" instead of two separate edges
|