Update app.py
Browse files
app.py
CHANGED
|
@@ -238,20 +238,19 @@ def setup_agent(file):
|
|
| 238 |
)
|
| 239 |
|
| 240 |
tools = [
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
]
|
| 247 |
|
| 248 |
agent_executor = initialize_agent(
|
| 249 |
tools=tools,
|
| 250 |
-
#llm=ChatOpenAI(model="gpt-3.5-turbo"),
|
| 251 |
llm=ChatOpenAI(model="gpt-4o"),
|
| 252 |
-
agent=AgentType.
|
| 253 |
-
#agent=AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION,
|
| 254 |
memory=memory,
|
|
|
|
| 255 |
verbose=True
|
| 256 |
)
|
| 257 |
|
|
|
|
| 238 |
)
|
| 239 |
|
| 240 |
tools = [
|
| 241 |
+
Tool(
|
| 242 |
+
name="PolicyRetrievalRAG",
|
| 243 |
+
func=retrieval_chain.run,
|
| 244 |
+
description="Use this tool to retrieve the most relevant clauses from the insurance policy based on the user's question."
|
| 245 |
+
)
|
| 246 |
]
|
| 247 |
|
| 248 |
agent_executor = initialize_agent(
|
| 249 |
tools=tools,
|
|
|
|
| 250 |
llm=ChatOpenAI(model="gpt-4o"),
|
| 251 |
+
agent=AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION,
|
|
|
|
| 252 |
memory=memory,
|
| 253 |
+
handle_parsing_errors=True,
|
| 254 |
verbose=True
|
| 255 |
)
|
| 256 |
|