Spaces:
Build error
Build error
Update agents.py
Browse files
agents.py
CHANGED
|
@@ -132,4 +132,15 @@ def create_agent_flow(provider: str = "groq"):
|
|
| 132 |
graph.add_conditional_edges("assistant", tools_condition)
|
| 133 |
graph.add_edge("tools", "assistant")
|
| 134 |
|
| 135 |
-
return graph.compile()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
graph.add_conditional_edges("assistant", tools_condition)
|
| 133 |
graph.add_edge("tools", "assistant")
|
| 134 |
|
| 135 |
+
return graph.compile()
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
if __name__ == "__main__":
|
| 139 |
+
question = "What is the capital of France?"
|
| 140 |
+
# Build the graph
|
| 141 |
+
graph = create_agent_flow(provider="groq")
|
| 142 |
+
# Run the graph
|
| 143 |
+
messages = [HumanMessage(content=question)]
|
| 144 |
+
messages = graph.invoke({"messages": messages})
|
| 145 |
+
for m in messages["messages"]:
|
| 146 |
+
m.pretty_print()
|