Jeremy Live
commited on
Commit
·
9b506bc
1
Parent(s):
82420e4
v6
Browse files
app.py
CHANGED
@@ -750,10 +750,7 @@ async def stream_agent_response(question: str, chat_history: List[List[str]]) ->
|
|
750 |
# Update the assistant's message with the response
|
751 |
assistant_message["content"] = response_text
|
752 |
|
753 |
-
|
754 |
-
error_msg = f"Error al ejecutar el agente: {str(e)}"
|
755 |
-
logger.error(error_msg, exc_info=True)
|
756 |
-
assistant_message["content"] = f"## ❌ Error\n\n{error_msg}"
|
757 |
|
758 |
# Return the message in the correct format for Gradio Chatbot
|
759 |
# Format: list of tuples where each tuple is (user_msg, bot_msg)
|
@@ -794,12 +791,6 @@ async def stream_agent_response(question: str, chat_history: List[List[str]]) ->
|
|
794 |
else:
|
795 |
logger.info("Returning a chart figure to UI.")
|
796 |
return message_content, chart_fig
|
797 |
-
|
798 |
-
except Exception as e:
|
799 |
-
error_msg = f"## ❌ Error\n\nOcurrió un error al procesar tu solicitud:\n\n```\n{str(e)}\n```"
|
800 |
-
logger.error(f"Error in stream_agent_response: {str(e)}", exc_info=True)
|
801 |
-
# Return error message and no chart
|
802 |
-
return error_msg, None
|
803 |
|
804 |
# Custom CSS for the app
|
805 |
custom_css = """
|
|
|
750 |
# Update the assistant's message with the response
|
751 |
assistant_message["content"] = response_text
|
752 |
|
753 |
+
|
|
|
|
|
|
|
754 |
|
755 |
# Return the message in the correct format for Gradio Chatbot
|
756 |
# Format: list of tuples where each tuple is (user_msg, bot_msg)
|
|
|
791 |
else:
|
792 |
logger.info("Returning a chart figure to UI.")
|
793 |
return message_content, chart_fig
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
|
795 |
# Custom CSS for the app
|
796 |
custom_css = """
|