Redmind commited on
Commit
af2057c
·
verified ·
1 Parent(s): 8b56586

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -760,11 +760,17 @@ def answer_question_thread(user_question, chatbot,audio=None):
760
  print(f"Error loading image file: {e}")
761
  response_text = "Chart generation failed. Please try again."
762
  if("max iterations" in response_text):
763
- print("max iterations error")
 
 
 
 
764
  return user_question, response_text
765
  else:
766
  if("max iterations" in response_text):
767
- print("max iterations error")
 
 
768
  return user_question, response_text
769
  # response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
770
  # return response_text
 
760
  print(f"Error loading image file: {e}")
761
  response_text = "Chart generation failed. Please try again."
762
  if("max iterations" in response_text):
763
+ print("max iterations error in 1")
764
+ if agent_executor.history:
765
+ print(agent_executor.history[-1])
766
+ #return agent_executor.history[-1].get("output")
767
+
768
  return user_question, response_text
769
  else:
770
  if("max iterations" in response_text):
771
+ print("max iterations error in 2")
772
+ if agent_executor.history:
773
+ print(agent_executor.history[-1])
774
  return user_question, response_text
775
  # response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
776
  # return response_text