mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-15 15:00:58 +00:00
perf: 更严格的重置条件判断
This commit is contained in:
@@ -114,7 +114,7 @@ def process_normal_message(text_message: str, mgr, config, launcher_type: str,
|
|||||||
reply = handle_exception("{}会话调用API失败:{}".format(session_name, e),
|
reply = handle_exception("{}会话调用API失败:{}".format(session_name, e),
|
||||||
"[bot]err:RateLimitError,请重试或联系作者,或等待修复")
|
"[bot]err:RateLimitError,请重试或联系作者,或等待修复")
|
||||||
except openai.error.InvalidRequestError as e:
|
except openai.error.InvalidRequestError as e:
|
||||||
if config.auto_reset:
|
if config.auto_reset and "This model's maximum context length is" in str(e):
|
||||||
session.reset()
|
session.reset()
|
||||||
reply = [tips_custom.session_auto_reset_message]
|
reply = [tips_custom.session_auto_reset_message]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user