mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Litellm fix router testing (#5748)
* test: fix testing - azure changed content policy error logic * test: fix tests to use mock responses * test(test_image_generation.py): handle api instability * test(test_image_generation.py): handle azure api instability * fix(utils.py): fix unbounded variable error * fix(utils.py): fix unbounded variable error * test: refactor test to use mock response * test: mark flaky azure tests
This commit is contained in:
parent
8d4339c702
commit
dd602753c0
8 changed files with 36 additions and 11 deletions
|
@ -6281,6 +6281,7 @@ def exception_type(
|
|||
):
|
||||
return original_exception
|
||||
exception_mapping_worked = False
|
||||
exception_provider = custom_llm_provider
|
||||
if litellm.suppress_debug_info is False:
|
||||
print() # noqa
|
||||
print( # noqa
|
||||
|
@ -6322,7 +6323,6 @@ def exception_type(
|
|||
_deployment = _metadata.get("deployment")
|
||||
extra_information = f"\nModel: {model}"
|
||||
|
||||
exception_provider = "Unknown"
|
||||
if (
|
||||
isinstance(custom_llm_provider, str)
|
||||
and len(custom_llm_provider) > 0
|
||||
|
@ -7923,6 +7923,7 @@ def exception_type(
|
|||
)
|
||||
or "Your task failed as a result of our safety system" in error_str
|
||||
or "The model produced invalid content" in error_str
|
||||
or "content_filter_policy" in error_str
|
||||
):
|
||||
exception_mapping_worked = True
|
||||
raise ContentPolicyViolationError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue