Update app.py
Browse files
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="
|
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):
|