forked from phoenix/litellm-mirror
(feat) add Rate Limit Error for bedrock
This commit is contained in:
parent
93ceafc44b
commit
66cbba3f55
1 changed files with 8 additions and 1 deletions
|
@ -2495,13 +2495,20 @@ def exception_type(
|
||||||
model=model,
|
model=model,
|
||||||
llm_provider="bedrock"
|
llm_provider="bedrock"
|
||||||
)
|
)
|
||||||
if "The security token included in the request is invalid":
|
if "The security token included in the request is invalid" in error_str:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise AuthenticationError(
|
raise AuthenticationError(
|
||||||
message=f"BedrockException Invalid Authentication - {error_str}",
|
message=f"BedrockException Invalid Authentication - {error_str}",
|
||||||
model=model,
|
model=model,
|
||||||
llm_provider="bedrock"
|
llm_provider="bedrock"
|
||||||
)
|
)
|
||||||
|
if "throttlingException" in error_str:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise RateLimitError(
|
||||||
|
message=f"BedrockException: Rate Limit Error - {error_str}",
|
||||||
|
model=model,
|
||||||
|
llm_provider="bedrock"
|
||||||
|
)
|
||||||
elif custom_llm_provider == "sagemaker":
|
elif custom_llm_provider == "sagemaker":
|
||||||
if "Unable to locate credentials" in error_str:
|
if "Unable to locate credentials" in error_str:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue