mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-23 04:46:07 +00:00
bug:修复上次更新后不响应的问题
This commit is contained in:
@@ -89,7 +89,7 @@ def get_prompt(name: str = None) -> str:
|
|||||||
with open(json_file, 'r', encoding ='utf-8') as f:
|
with open(json_file, 'r', encoding ='utf-8') as f:
|
||||||
json_content = json.load(f)
|
json_content = json.load(f)
|
||||||
logging.debug('succeed to load json: {}'.format(json_file))
|
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:
|
except FileNotFoundError:
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,8 @@ class Session:
|
|||||||
|
|
||||||
if expired:
|
if expired:
|
||||||
pkg.utils.context.get_database_manager().set_session_expired(self.name, self.create_timestamp)
|
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.create_timestamp = int(time.time())
|
||||||
self.last_interact_timestamp = int(time.time())
|
self.last_interact_timestamp = int(time.time())
|
||||||
self.just_switched_to_exist_session = False
|
self.just_switched_to_exist_session = False
|
||||||
|
|||||||
Reference in New Issue
Block a user