bug:修复上次更新后不响应的问题

This commit is contained in:
chordfish 2023-03-10 13:55:56 +08:00
parent e2e93afd06
commit c94a9e1ae6
2 changed files with 3 additions and 2 deletions

View File

@ -89,7 +89,7 @@ def get_prompt(name: str = None) -> str:
with open(json_file, 'r', encoding ='utf-8') as f:
json_content = json.load(f)
logging.debug('succeed to load json: {}'.format(json_file))
return json_content['prompt']
return json_content['prompt'], json_content['name'], json_content['filter']
except FileNotFoundError:

View File

@ -306,7 +306,8 @@ class Session:
if expired:
pkg.utils.context.get_database_manager().set_session_expired(self.name, self.create_timestamp)
self.prompt = self.get_default_prompt(use_prompt)
# a, b为bot_name和bot_filter占位变量
self.prompt, a, b = self.get_default_prompt(use_prompt)
self.create_timestamp = int(time.time())
self.last_interact_timestamp = int(time.time())
self.just_switched_to_exist_session = False