From 9e78bf3d218f9e6fc1f548439aa16e316a9fe07e Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Thu, 8 Jun 2023 13:49:20 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9B=B4=E4=B8=A5=E6=A0=BC=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/qqbot/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/qqbot/message.py b/pkg/qqbot/message.py index 68715922..4c0207df 100644 --- a/pkg/qqbot/message.py +++ b/pkg/qqbot/message.py @@ -114,7 +114,7 @@ def process_normal_message(text_message: str, mgr, config, launcher_type: str, reply = handle_exception("{}会话调用API失败:{}".format(session_name, e), "[bot]err:RateLimitError,请重试或联系作者,或等待修复") 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() reply = [tips_custom.session_auto_reset_message] else: