-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Adding support for OCI exception mapping logic in Litellm #17390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…i exception mapping
…ke line length violations and inline comments.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ated to HTTP 409 code for OCI error mapping update, added ConflictError to list of exception types
…t from exceptions.py as part of test case for added logic in PR
| _message += f", LiteLLM Max Retries: {self.max_retries}" | ||
| return _message | ||
|
|
||
| class ConflictError(openai.ConflictError): # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like a new exception - what version of openai is required for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 2.8.1
python -c "import openai; print(openai.version); print(hasattr(openai, 'ConflictError'))"
2.8.1
True
It is also documented here https://platform.openai.com/docs/guides/error-codes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Adding support for OCI exception mapping logic in Litellm
Relevant issues
In testing LiteLLM with OCI, error mapping is not occurring as expected. Errors are returned wrapped in a LiteLLM 500 error by the LiteLLM exception_mapping_utils. py file. This includes when errors are actually 401, 404, 429, and other errors as returned by OCI they are wrapped in a 500 LiteLLM error. This can lead to misleading developers and users of the actual issue occurring.
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🐛 Bug Fix
✅ Test
Changes
Added exception mapping functions and logic specifically for OCI in the oci_exception_mapping_utils.py file in the same style as other providers. Added the test files in the tests directory per the contributing hard requirement checklist..