sanjaystarc commited on
Commit
14ffeef
·
verified ·
1 Parent(s): 1985c3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -63,8 +63,8 @@ def main():
63
  """
64
 
65
  # Create the Pandas Agent with enhanced error handling
66
- # Fix: Removed redundant 'handle_parsing_errors' from top level to avoid conflicts
67
- # with agent_executor_kwargs in some versions.
68
  agent = create_pandas_dataframe_agent(
69
  llm,
70
  df,
@@ -72,10 +72,9 @@ def main():
72
  agent_type="zero-shot-react-description",
73
  allow_dangerous_code=True,
74
  prefix=custom_prefix,
75
- agent_executor_kwargs={
76
- "handle_parsing_errors": True,
77
- "max_iterations": 5
78
- }
79
  )
80
 
81
  # --- 4. EXECUTION ---
 
63
  """
64
 
65
  # Create the Pandas Agent with enhanced error handling
66
+ # Fix: Pass 'handle_parsing_errors' directly and avoid passing 'max_iterations'
67
+ # inside agent_executor_kwargs if it conflicts with the toolkit's defaults.
68
  agent = create_pandas_dataframe_agent(
69
  llm,
70
  df,
 
72
  agent_type="zero-shot-react-description",
73
  allow_dangerous_code=True,
74
  prefix=custom_prefix,
75
+ handle_parsing_errors=True,
76
+ # We omit agent_executor_kwargs here to resolve the TypeError
77
+ # as the function already handles execution parameters internally.
 
78
  )
79
 
80
  # --- 4. EXECUTION ---