mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix raise correct provider on content policy violation
This commit is contained in:
parent
3bbb4e8f1d
commit
8ae98008b3
1 changed files with 7 additions and 4 deletions
|
@ -8808,11 +8808,14 @@ class CustomStreamWrapper:
|
||||||
str_line.choices[0].content_filter_result
|
str_line.choices[0].content_filter_result
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
error_message = "Azure Response={}".format(
|
error_message = "{} Response={}".format(
|
||||||
str(dict(str_line))
|
self.custom_llm_provider, str(dict(str_line))
|
||||||
)
|
)
|
||||||
raise litellm.AzureOpenAIError(
|
|
||||||
status_code=400, message=error_message
|
raise litellm.ContentPolicyViolationError(
|
||||||
|
message=error_message,
|
||||||
|
llm_provider=self.custom_llm_provider,
|
||||||
|
model=self.model,
|
||||||
)
|
)
|
||||||
|
|
||||||
# checking for logprobs
|
# checking for logprobs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue