forked from phoenix/litellm-mirror
fix(presidio_pii_masking.py): fix conditional check
This commit is contained in:
parent
f68b656040
commit
6b91f48c64
2 changed files with 3 additions and 3 deletions
|
@ -154,8 +154,8 @@ class _OPTIONAL_PresidioPIIMasking(CustomLogger):
|
|||
if litellm.output_parse_pii == False:
|
||||
return response
|
||||
|
||||
if isinstance(response, ModelResponse) and isinstance(
|
||||
response.choices, StreamingChoices
|
||||
if isinstance(response, ModelResponse) and not isinstance(
|
||||
response.choices[0], StreamingChoices
|
||||
): # /chat/completions requests
|
||||
if isinstance(response.choices[0].message.content, str):
|
||||
verbose_proxy_logger.debug(
|
||||
|
|
|
@ -53,7 +53,7 @@ async def test_output_parsing():
|
|||
mock_response="Hello <PERSON>! How can I assist you today?",
|
||||
)
|
||||
new_response = await pii_masking.async_post_call_success_hook(
|
||||
user_api_key_dict=UserAPIKeyAuth(), response=response, call_type="completion"
|
||||
user_api_key_dict=UserAPIKeyAuth(), response=response
|
||||
)
|
||||
|
||||
assert (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue