From 4de70abf47acf1b58b9f4d37e945c6f110399121 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Mon, 26 Dec 2022 23:59:45 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20The=20server=20is=20overloaded=20or=20n?= =?UTF-8?q?ot=20ready=20yet.=E6=97=B6=E8=BF=9B=E8=A1=8C=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20#59?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/qqbot/process.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index a646dc99..886f4fd8 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -163,6 +163,9 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str) -> "completion_api_params中的max_tokens参数数值过大导致的,请尝试将其降低".format( session_name, e)) reply = ["[bot]err:API调用参数错误,请联系作者,或等待修复"] + except openai.error.ServiceUnavailableError as e: + # mgr.notify_admin("{}API调用服务不可用:{}".format(session_name, e)) + reply = ["[bot]err:API调用服务暂不可用,请尝试重试"] except Exception as e: logging.exception(e) reply = ["[bot]err:{}".format(e)]