From 2d7dd71a3dc6ec2cbdbf828e6138ab380d790866 Mon Sep 17 00:00:00 2001 From: lichengzhe <38408577@qq.com> Date: Mon, 15 May 2023 14:04:55 +0800 Subject: [PATCH] Bad Gateway exception retry --- bot/chatgpt/chat_gpt_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index d48bf38..6391b0b 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -134,7 +134,7 @@ class ChatGPTBot(Bot, OpenAIImage): result["content"] = "我没有收到你的消息" if need_retry: time.sleep(5) - elif isinstance(e, openai.error.APIError:): + elif isinstance(e, openai.error.APIError): logger.warn("[CHATGPT] Bad Gateway: {}".format(e)) result["content"] = "请再问我一次" if need_retry: