mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) ContentPolicyViolationError
This commit is contained in:
parent
cf98343eb5
commit
9da61bdf31
1 changed files with 4 additions and 4 deletions
|
@ -5551,10 +5551,10 @@ def exception_type(
|
|||
)
|
||||
elif (
|
||||
"invalid_request_error" in error_str
|
||||
and "Incorrect API key provided" not in error_str
|
||||
and "content_policy_violation" in error_str
|
||||
):
|
||||
exception_mapping_worked = True
|
||||
raise BadRequestError(
|
||||
raise ContentPolicyViolationError(
|
||||
message=f"OpenAIException - {original_exception.message}",
|
||||
llm_provider="openai",
|
||||
model=model,
|
||||
|
@ -5562,10 +5562,10 @@ def exception_type(
|
|||
)
|
||||
elif (
|
||||
"invalid_request_error" in error_str
|
||||
and "content_policy_violation" in error_str
|
||||
and "Incorrect API key provided" not in error_str
|
||||
):
|
||||
exception_mapping_worked = True
|
||||
raise Con(
|
||||
raise BadRequestError(
|
||||
message=f"OpenAIException - {original_exception.message}",
|
||||
llm_provider="openai",
|
||||
model=model,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue