Browse Source

增加#清除所有人记忆指令

develop
zwssunny 1 year ago
parent
commit
b81d947dbb
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      bot/openai/open_ai_bot.py

+ 7
- 0
bot/openai/open_ai_bot.py View File

@@ -22,6 +22,9 @@ class OpenAIBot(Bot):
if query == '#清除记忆':
Session.clear_session(from_user_id)
return '记忆已清除'
elif query == '#清除所有':
Session.clear_all_session()
return '所有人记忆已清除'

new_query = Session.build_session_query(query, from_user_id)
logger.debug("[OPEN_AI] session query={}".format(new_query))
@@ -157,3 +160,7 @@ class Session(object):
@staticmethod
def clear_session(user_id):
user_session[user_id] = []

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

Loading…
Cancel
Save