From 6e459da875896e094826841814714f3fdf9b1911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Sat, 26 Aug 2023 17:20:21 +0800 Subject: [PATCH] feat: +Exceeds the maximum retries exception --- metagpt/provider/openai_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 27f22e491..4fab92fb3 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -403,6 +403,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): error_str = traceback.format_exc() logger.error(f"Exception:{e}, stack:{error_str}") raise e + raise openai.error.OpenAIError("Exceeds the maximum retries") @staticmethod def retry_call(func, *args, **kwargs): @@ -420,5 +421,6 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): error_str = traceback.format_exc() logger.error(f"Exception:{e}, stack:{error_str}") raise e + raise openai.error.OpenAIError("Exceeds the maximum retries") MAX_TRY = 5