menikev commited on
Commit
91e81a1
·
verified ·
1 Parent(s): 67c0d47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -64,7 +64,6 @@ prompt = PromptTemplate.from_template(
64
  """
65
  )
66
 
67
- agent = create_react_agent(local_llm, tools, prompt)
68
  agent_executor = AgentExecutor.from_agent_and_tools(
69
  agent=agent,
70
  tools=tools,
@@ -72,7 +71,7 @@ agent_executor = AgentExecutor.from_agent_and_tools(
72
  memory=ConversationBufferMemory(memory_key="chat_history", return_messages=True),
73
  handle_parsing_errors=True,
74
  max_iterations=3, # Limit the number of iterations
75
- early_stopping_method="generate" # Stop if the agent starts looping
76
  )
77
 
78
  def run_agent_with_timeout(executor, input_data, timeout):
 
64
  """
65
  )
66
 
 
67
  agent_executor = AgentExecutor.from_agent_and_tools(
68
  agent=agent,
69
  tools=tools,
 
71
  memory=ConversationBufferMemory(memory_key="chat_history", return_messages=True),
72
  handle_parsing_errors=True,
73
  max_iterations=3, # Limit the number of iterations
74
+ early_stopping_method="force" # or "generate_until_stop"
75
  )
76
 
77
  def run_agent_with_timeout(executor, input_data, timeout):