forked from phoenix/litellm-mirror
fix raise correct provider on content policy violation
This commit is contained in:
parent
15c109f023
commit
8f9638f2c1
1 changed files with 7 additions and 4 deletions
|
@ -8808,11 +8808,14 @@ class CustomStreamWrapper:
|
|||
str_line.choices[0].content_filter_result
|
||||
)
|
||||
else:
|
||||
error_message = "Azure Response={}".format(
|
||||
str(dict(str_line))
|
||||
error_message = "{} Response={}".format(
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue