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 |
-
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
|
@@ -77,7 +77,7 @@ graph.add_conditional_edges(
|
|
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 |
|
83 |
def respond_to_input(user_input: str) -> str:
|
|
|
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
|
|
|
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 |
|
83 |
def respond_to_input(user_input: str) -> str:
|