From 85753e43cea2588a579ba588620d2e4d3fd52885 Mon Sep 17 00:00:00 2001 From: saum7800 Date: Mon, 15 Apr 2024 15:05:08 -0400 Subject: [PATCH] minor fix --- prompt2model/utils/api_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prompt2model/utils/api_tools.py b/prompt2model/utils/api_tools.py index 6a4c1d8b6..139f5c24f 100644 --- a/prompt2model/utils/api_tools.py +++ b/prompt2model/utils/api_tools.py @@ -169,14 +169,14 @@ async def _throttled_completion_acreate( if isinstance( e, ( - openai.ServiceUnavailableError, + openai.APIStatusError, openai.APIError, ), ): logging.warning( ERROR_ERRORS_TO_MESSAGES[type(e)].format(e=e) ) - elif isinstance(e, openai.InvalidRequestError): + elif isinstance(e, openai.BadRequestError): logging.warning(ERROR_ERRORS_TO_MESSAGES[type(e)]) return { "choices": [