Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ compiled_graph = graph.compile()
|
|
56 |
|
57 |
# 3) The corrected respond_to_input:
|
58 |
def respond_to_input(user_input: str) -> str:
|
59 |
-
|
60 |
system_msg = SystemMessage(
|
61 |
content=(
|
62 |
"You are an assistant with access to exactly these tools:\n"
|
@@ -73,14 +73,11 @@ def respond_to_input(user_input: str) -> str:
|
|
73 |
"If you do not need any tool, simply reply with your final answer as plain text."
|
74 |
)
|
75 |
)
|
76 |
-
|
77 |
-
# B) Start the graph with only the SystemMessage in state["messages"]
|
78 |
initial_state = { "messages": [system_msg] }
|
79 |
-
|
80 |
-
# C) Invoke the graph, passing user_input separately
|
81 |
final_state = compiled_graph.invoke(initial_state, user_input)
|
82 |
-
|
83 |
-
|
84 |
print("===== AGENT MESSAGES =====")
|
85 |
for i, msg in enumerate(final_state["messages"]):
|
86 |
if isinstance(msg, AIMessage):
|
|
|
56 |
|
57 |
# 3) The corrected respond_to_input:
|
58 |
def respond_to_input(user_input: str) -> str:
|
59 |
+
|
60 |
system_msg = SystemMessage(
|
61 |
content=(
|
62 |
"You are an assistant with access to exactly these tools:\n"
|
|
|
73 |
"If you do not need any tool, simply reply with your final answer as plain text."
|
74 |
)
|
75 |
)
|
76 |
+
|
|
|
77 |
initial_state = { "messages": [system_msg] }
|
|
|
|
|
78 |
final_state = compiled_graph.invoke(initial_state, user_input)
|
79 |
+
print("in respond_to_input : ")
|
80 |
+
|
81 |
print("===== AGENT MESSAGES =====")
|
82 |
for i, msg in enumerate(final_state["messages"]):
|
83 |
if isinstance(msg, AIMessage):
|