youngtsai commited on
Commit
1325cdf
·
1 Parent(s): b5efa21

response_completion = "學習精靈有點累,請稍後再試!"

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1713,8 +1713,12 @@ def chat_with_ai(ai_name, password, video_id, trascript_state, key_moments, user
1713
  "instructions": instructions
1714
  }
1715
 
1716
- chatbot = Chatbot(chatbot_config)
1717
- response_completion = chatbot.chat(user_message, chat_history, socratic_mode, ai_name)
 
 
 
 
1718
 
1719
  try:
1720
  # 更新聊天历史
 
1713
  "instructions": instructions
1714
  }
1715
 
1716
+ try:
1717
+ chatbot = Chatbot(chatbot_config)
1718
+ response_completion = chatbot.chat(user_message, chat_history, socratic_mode, ai_name)
1719
+ except Exception as e:
1720
+ print(f"Error: {e}")
1721
+ response_completion = "學習精靈有點累,請稍後再試!"
1722
 
1723
  try:
1724
  # 更新聊天历史