Update app.py
Browse files
app.py
CHANGED
|
@@ -81,8 +81,10 @@ def chat_with_ai(message, history, role):
|
|
| 81 |
|
| 82 |
except Exception as e:
|
| 83 |
if hasattr(e, 'response') and e.response is not None:
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
| 86 |
return history
|
| 87 |
|
| 88 |
def create_chatbot():
|
|
|
|
| 81 |
|
| 82 |
except Exception as e:
|
| 83 |
if hasattr(e, 'response') and e.response is not None:
|
| 84 |
+
error_msg = f"Error: {e.response.text}"
|
| 85 |
+
else:
|
| 86 |
+
error_msg = f"Error: {str(e)}"
|
| 87 |
+
history.append((message, error_msg))
|
| 88 |
return history
|
| 89 |
|
| 90 |
def create_chatbot():
|