Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,13 +22,14 @@ class CSVChatbot:
|
|
22 |
os.environ["OPENAI_API_KEY"] = api_key
|
23 |
|
24 |
try:
|
25 |
-
model = ChatOpenAI(model_name="gpt-
|
26 |
self.agent = create_csv_agent(
|
27 |
llm=model,
|
28 |
path=self.file_path,
|
29 |
verbose=True,
|
30 |
agent_type=AgentType.OPENAI_FUNCTIONS,
|
31 |
-
allow_dangerous_code=True
|
|
|
32 |
)
|
33 |
return "CSV file loaded and agent initialized successfully!"
|
34 |
except Exception as e:
|
|
|
22 |
os.environ["OPENAI_API_KEY"] = api_key
|
23 |
|
24 |
try:
|
25 |
+
model = ChatOpenAI(model_name="gpt-4o", temperature=0)
|
26 |
self.agent = create_csv_agent(
|
27 |
llm=model,
|
28 |
path=self.file_path,
|
29 |
verbose=True,
|
30 |
agent_type=AgentType.OPENAI_FUNCTIONS,
|
31 |
+
allow_dangerous_code=True,
|
32 |
+
agent_executor_kwargs=dict(handle_parsing_errors=True)
|
33 |
)
|
34 |
return "CSV file loaded and agent initialized successfully!"
|
35 |
except Exception as e:
|