Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|