Litellm dev 10 26 2024 (#6472)

* docs(exception_mapping.md): add missing exception types

Fixes https://github.com/Aider-AI/aider/issues/2120#issuecomment-2438971183

* fix(main.py): register custom model pricing with specific key

Ensure custom model pricing is registered to the specific model+provider key combination

* test: make testing more robust for custom pricing

* fix(redis_cache.py): instrument otel logging for sync redis calls

ensures complete coverage for all redis cache calls
This commit is contained in:
Krish Dholakia 2024-10-28 15:05:43 -07:00 committed by GitHub
parent f44ab00de2
commit 70111a7abd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 310 additions and 72 deletions

View file

@ -661,13 +661,7 @@ class APIResponseValidationError(openai.APIResponseValidationError): # type: ig
return _message
class OpenAIError(openai.OpenAIError): # type: ignore
def __init__(self, original_exception=None):
super().__init__()
self.llm_provider = "openai"
class JSONSchemaValidationError(APIError):
class JSONSchemaValidationError(APIResponseValidationError):
def __init__(
self, model: str, llm_provider: str, raw_response: str, schema: str
) -> None:
@ -678,9 +672,13 @@ class JSONSchemaValidationError(APIError):
model, raw_response, schema
)
self.message = message
super().__init__(
model=model, message=message, llm_provider=llm_provider, status_code=500
)
super().__init__(model=model, message=message, llm_provider=llm_provider)
class OpenAIError(openai.OpenAIError): # type: ignore
def __init__(self, original_exception=None):
super().__init__()
self.llm_provider = "openai"
class UnsupportedParamsError(BadRequestError):