Skip to content

Commit

Permalink
feat(agents-api): Add some LiteLLM exceptions to the list of non-retr…
Browse files Browse the repository at this point in the history
…yable errors (#622)

Added the following exceptions:

- `litellm.exceptions.NotFoundError`.
- `litellm.exceptions.InvalidRequestError`.
- `litellm.exceptions.AuthenticationError`.
- `litellm.exceptions.ServiceUnavailableError`.
- `litellm.exceptions.OpenAIError`.
- `litellm.exceptions.APIError`.
<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add LiteLLM exceptions to non-retryable errors in `tasks.py`.
> 
>   - **Exceptions**:
> - Added `litellm.exceptions.NotFoundError`, `InvalidRequestError`,
`AuthenticationError`, `ServiceUnavailableError`, `OpenAIError`, and
`APIError` to `NON_RETRYABLE_ERROR_TYPES` in `tasks.py`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral)<sup>
for 018360c. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
  • Loading branch information
HamadaSalhab authored Oct 10, 2024
1 parent 7cfa193 commit 4fe49d1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions agents-api/agents_api/common/exceptions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import httpx
import jinja2
import jsonschema.exceptions
import litellm
import pydantic
import requests
import temporalio.exceptions
Expand Down Expand Up @@ -70,10 +71,12 @@
pydantic.ValidationError,
requests.exceptions.InvalidURL,
requests.exceptions.MissingSchema,
#
# Box exceptions
box.exceptions.BoxKeyError,
box.exceptions.BoxTypeError,
box.exceptions.BoxValueError,
#
# Beartype exceptions
beartype.roar.BeartypeException,
beartype.roar.BeartypeDecorException,
Expand All @@ -88,6 +91,14 @@
beartype.roar.BeartypeCallHintReturnViolation,
beartype.roar.BeartypeDecorHintParamDefaultViolation,
beartype.roar.BeartypeDoorHintViolation,
#
# LiteLLM exceptions
litellm.exceptions.NotFoundError,
litellm.exceptions.InvalidRequestError,
litellm.exceptions.AuthenticationError,
litellm.exceptions.ServiceUnavailableError,
litellm.exceptions.OpenAIError,
litellm.exceptions.APIError,
]


Expand Down

0 comments on commit 4fe49d1

Please sign in to comment.