Просмотр исходного кода

fix: variable name compatibility modification #415

zhayujie 3 лет назад
Родитель
Сommit
8fa4041fc2
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      bot/chatgpt/chat_gpt_bot.py

+ 1 - 1
bot/chatgpt/chat_gpt_bot.py

@@ -24,7 +24,7 @@ class ChatGPTBot(Bot):
         # acquire reply content
         if not context or not context.get('type') or context.get('type') == 'TEXT':
             logger.info("[OPEN_AI] query={}".format(query))
-            session_id = context['session_id']
+            session_id = context.get('session_id') or context.get('from_user_id')
             if query == '#清除记忆':
                 Session.clear_session(session_id)
                 return '记忆已清除'