mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Fix Fireworks AI 429 error mapping to use RateLimitError instead of BadRequestError
This commit is contained in:
parent
7262606411
commit
cf8d75b7fd
2 changed files with 61 additions and 0 deletions
|
@ -20,6 +20,15 @@ class FireworksAIMixin:
|
|||
def get_error_class(
|
||||
self, error_message: str, status_code: int, headers: Union[dict, Headers]
|
||||
) -> BaseLLMException:
|
||||
# Check if it's a rate limit error (status code 429)
|
||||
if status_code == 429:
|
||||
from litellm.exceptions import RateLimitError
|
||||
return RateLimitError(
|
||||
message=f"Fireworks_aiException - {error_message}",
|
||||
llm_provider="fireworks_ai",
|
||||
model="", # This will be set later in the exception mapping
|
||||
response=None, # This will be set later in the exception mapping
|
||||
)
|
||||
return FireworksAIException(
|
||||
status_code=status_code,
|
||||
message=error_message,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue