samoye16 commited on
Commit
8be21d4
·
verified ·
1 Parent(s): 653d468

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +10 -5
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
- 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()
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)