Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,8 @@ def route_agent(state: AgentState, agent_out):
|
|
78 |
Return "tools" if the LLM output is a dict with a valid "tool" key,
|
79 |
otherwise return "final".
|
80 |
"""
|
81 |
-
|
|
|
82 |
return "tools"
|
83 |
return "final"
|
84 |
|
@@ -95,6 +96,7 @@ compiled_graph = graph.compile()
|
|
95 |
def respond_to_input(user_input: str) -> str:
|
96 |
print(f"Reached: User input: {user_input}")
|
97 |
initial_state: AgentState = {"messages": []}
|
|
|
98 |
return compiled_graph.invoke(initial_state, user_input)
|
99 |
|
100 |
|
|
|
78 |
Return "tools" if the LLM output is a dict with a valid "tool" key,
|
79 |
otherwise return "final".
|
80 |
"""
|
81 |
+
print(f"Route agent received agent_out: {agent_out}")
|
82 |
+
if isinstance(agent_out, dict) and agent_out.get("tool") in {"ocr_image", "parse_excel", "web_search"}:
|
83 |
return "tools"
|
84 |
return "final"
|
85 |
|
|
|
96 |
def respond_to_input(user_input: str) -> str:
|
97 |
print(f"Reached: User input: {user_input}")
|
98 |
initial_state: AgentState = {"messages": []}
|
99 |
+
print("reached respond_to_input")
|
100 |
return compiled_graph.invoke(initial_state, user_input)
|
101 |
|
102 |
|