Daniel Amendoeira commited on
Commit
6d1b56a
·
verified ·
1 Parent(s): a38ba97

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +2 -2
agent.py CHANGED
@@ -98,9 +98,9 @@ builder.add_edge("environment", "llm_call") # after running the tools go back t
98
  gaia_agent = builder.compile() # converts my builder into a runnable agent by using gaia_agent.invoke()
99
 
100
  # Call the Agent
101
- def run_gaia(question: str):
102
  input_state = {"messages": [HumanMessage(content=question)]} # prepare the initial user message
103
- result = gaia_agent.invoke(input_state, {"recursion_limit": 30}) # invoke with recursion limit to avoid infinite loops
104
  final_response = result["messages"][-1].content
105
 
106
  try:
 
98
  gaia_agent = builder.compile() # converts my builder into a runnable agent by using gaia_agent.invoke()
99
 
100
  # Call the Agent
101
+ def agent_run(question: str):
102
  input_state = {"messages": [HumanMessage(content=question)]} # prepare the initial user message
103
+ result = gaia_agent.invoke(input_state, {"recursion_limit": 30}) # prevents infinite looping when the LLM keeps calling tools over and over
104
  final_response = result["messages"][-1].content
105
 
106
  try: