Spaces:
Sleeping
Sleeping
Update agents.py
Browse files
agents.py
CHANGED
@@ -137,11 +137,16 @@ def create_agent_flow(provider: str = "groq"):
|
|
137 |
|
138 |
if __name__ == "__main__":
|
139 |
question = "What is the capital of France?"
|
|
|
140 |
# Build the graph
|
141 |
-
|
|
|
|
|
|
|
|
|
142 |
# Run the graph
|
143 |
-
|
144 |
-
messages = graph.invoke({"messages": messages})
|
145 |
-
for m in messages["messages"]:
|
146 |
-
m.pretty_print()
|
147 |
|
|
|
|
|
|
|
|
137 |
|
138 |
if __name__ == "__main__":
|
139 |
question = "What is the capital of France?"
|
140 |
+
|
141 |
# Build the graph
|
142 |
+
compiled_graph = create_agent_flow(provider="groq")
|
143 |
+
|
144 |
+
# Prepare input messages
|
145 |
+
messages = [system_message, HumanMessage(content=question)]
|
146 |
+
|
147 |
# Run the graph
|
148 |
+
output_state = compiled_graph.invoke({"messages": messages})
|
|
|
|
|
|
|
149 |
|
150 |
+
# Print the final output
|
151 |
+
for m in output_state["messages"]:
|
152 |
+
print(m.content)
|