Rajan Sharma commited on
Commit
84136c9
·
verified ·
1 Parent(s): 7c0897e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -108,9 +108,10 @@ def handle(user_msg: str, history_messages: List[Dict[str, str]], files: list) -
108
  agent = create_pandas_dataframe_agent(
109
  llm,
110
  df,
111
- agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION, # Use a model-agnostic agent type
112
  verbose=True,
113
- allow_dangerous_code=True
 
114
  )
115
 
116
  # Run the agent with the user's scenario text. The agent will
@@ -210,4 +211,4 @@ if __name__ == "__main__":
210
  "open_fallbacks": USE_OPEN_FALLBACKS,
211
  "timeout_s": COHERE_TIMEOUT_S
212
  })
213
- demo.launch(server_name="0.0.0.0", server_port=int(os.getenv("PORT", "7860")))
 
108
  agent = create_pandas_dataframe_agent(
109
  llm,
110
  df,
111
+ agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
112
  verbose=True,
113
+ allow_dangerous_code=True,
114
+ handle_parsing_errors=True # Make the agent robust to LLM formatting errors
115
  )
116
 
117
  # Run the agent with the user's scenario text. The agent will
 
211
  "open_fallbacks": USE_OPEN_FALLBACKS,
212
  "timeout_s": COHERE_TIMEOUT_S
213
  })
214
+ demo.launch(server_name="0.0.0.0", server_port=int(os.getenv("PORT", "7860")))```