forked from phoenix/litellm-mirror
fix(utils.py): add exception mapping for bedrock image internal server error
This commit is contained in:
parent
4de19cb116
commit
e2d275f1b7
2 changed files with 9 additions and 0 deletions
|
@ -592,6 +592,8 @@ def test_bedrock_claude_3(image_url):
|
||||||
assert len(response.choices) > 0
|
assert len(response.choices) > 0
|
||||||
assert len(response.choices[0].message.content) > 0
|
assert len(response.choices[0].message.content) > 0
|
||||||
|
|
||||||
|
except litellm.InternalServerError:
|
||||||
|
pass
|
||||||
except RateLimitError:
|
except RateLimitError:
|
||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -6813,6 +6813,13 @@ def exception_type(
|
||||||
model=model,
|
model=model,
|
||||||
llm_provider="bedrock",
|
llm_provider="bedrock",
|
||||||
)
|
)
|
||||||
|
elif "Could not process image" in error_str:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise litellm.InternalServerError(
|
||||||
|
message=f"BedrockException - {error_str}",
|
||||||
|
model=model,
|
||||||
|
llm_provider="bedrock",
|
||||||
|
)
|
||||||
elif hasattr(original_exception, "status_code"):
|
elif hasattr(original_exception, "status_code"):
|
||||||
if original_exception.status_code == 500:
|
if original_exception.status_code == 500:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue