forked from phoenix/litellm-mirror
fix(bedrock.py): add support for sts based boto3 initialization
https://github.com/BerriAI/litellm/issues/1476
This commit is contained in:
parent
d63147f342
commit
8e9dc09955
5 changed files with 106 additions and 4 deletions
|
@ -60,6 +60,7 @@ from .exceptions import (
|
|||
RateLimitError,
|
||||
ServiceUnavailableError,
|
||||
OpenAIError,
|
||||
PermissionDeniedError,
|
||||
ContextWindowExceededError,
|
||||
ContentPolicyViolationError,
|
||||
Timeout,
|
||||
|
@ -5924,6 +5925,14 @@ def exception_type(
|
|||
llm_provider="bedrock",
|
||||
response=original_exception.response,
|
||||
)
|
||||
if "AccessDeniedException" in error_str:
|
||||
exception_mapping_worked = True
|
||||
raise PermissionDeniedError(
|
||||
message=f"BedrockException PermissionDeniedError - {error_str}",
|
||||
model=model,
|
||||
llm_provider="bedrock",
|
||||
response=original_exception.response,
|
||||
)
|
||||
if (
|
||||
"throttlingException" in error_str
|
||||
or "ThrottlingException" in error_str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue