From 502234c2ce99c576e3ed3180c80bfa5529182c8e Mon Sep 17 00:00:00 2001 From: zhayujie Date: Fri, 10 Mar 2023 09:25:56 +0800 Subject: [PATCH] fix: variable name compatibility modification #415 --- bot/chatgpt/chat_gpt_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index 43ffa61e4..78e344fd9 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -24,7 +24,7 @@ def reply(self, query, context=None): # 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 '记忆已清除'