Skip to content

Commit

Permalink
fix: variable name compatibility modification
Browse files Browse the repository at this point in the history
  • Loading branch information
zhayujie authored Mar 10, 2023
1 parent b4611c7 commit d73003b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/openai/open_ai_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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))
from_user_id = context['from_user_id']
from_user_id = context.get('from_user_id') or context.get('session_id')
if query == '#清除记忆':
Session.clear_session(from_user_id)
return '记忆已清除'
Expand Down Expand Up @@ -163,4 +163,4 @@ def clear_session(user_id):

@staticmethod
def clear_all_session():
user_session.clear()
user_session.clear()

0 comments on commit d73003b

Please sign in to comment.