mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(presidio): remove redundant isinstance check for ModelResponseStream
ModelResponseStream and ModelResponse are sibling classes (both inherit from ModelResponseBase), so the guard was always True. Simplify to just isinstance(response, ModelResponse).
This commit is contained in:
parent
a2cae0070e
commit
b370fcd8de
1 changed files with 1 additions and 3 deletions
|
|
@ -806,9 +806,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
|
|||
if self.output_parse_pii is False and litellm.output_parse_pii is False:
|
||||
return response
|
||||
|
||||
if isinstance(response, ModelResponse) and not isinstance(
|
||||
response, ModelResponseStream
|
||||
): # /chat/completions requests
|
||||
if isinstance(response, ModelResponse): # /chat/completions requests
|
||||
if isinstance(response.choices[0].message.content, str):
|
||||
verbose_proxy_logger.debug(
|
||||
f"self.pii_tokens: {self.pii_tokens}; initial response: {response.choices[0].message.content}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue