Skip to content

Commit

Permalink
lower OpenAI errors to warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hussam789 committed Aug 12, 2024
1 parent 9c1ab06 commit 70da871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pr_agent/algo/ai_handlers/litellm_ai_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ async def chat_completion(self, model: str, system: str, user: str, temperature:

response = await acompletion(**kwargs)
except (openai.APIError, openai.APITimeoutError) as e:
get_logger().error("Error during OpenAI inference: ", e)
get_logger().warning("Error during OpenAI inference: ", e)
raise
except (openai.RateLimitError) as e:
get_logger().error("Rate limit error during OpenAI inference: ", e)
raise
except (Exception) as e:
get_logger().error("Unknown error during OpenAI inference: ", e)
get_logger().warning("Unknown error during OpenAI inference: ", e)
raise openai.APIError from e
if response is None or len(response["choices"]) == 0:
raise openai.APIError
Expand Down

0 comments on commit 70da871

Please sign in to comment.