(fix) ContentPolicyViolationError
This commit is contained in:
parent
cf98343eb5
commit
9da61bdf31
@ -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…
Reference in New Issue
Block a user