Skip to content

Commit

Permalink
Bad Gateway exception retry
Browse files Browse the repository at this point in the history
  • Loading branch information
lichengzhe committed May 15, 2023
1 parent 0e8195a commit 2d7dd71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bot/chatgpt/chat_gpt_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def reply_text(self, session: ChatGPTSession, api_key=None, retry_count=0) -> di
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:
Expand Down

0 comments on commit 2d7dd71

Please sign in to comment.