ONEROCKS commited on
Commit
adeb6db
·
verified ·
1 Parent(s): 69acee4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- print("Raw error response:", e.response.text)
85
- history.append((message, f"Error: {str(e)}"))
 
 
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():