Veda0718 commited on
Commit
20ec10c
1 Parent(s): 7d4acc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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-3.5-turbo", 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
  )
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: