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:
|
if litellm.output_parse_pii == False:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
if isinstance(response, ModelResponse) and isinstance(
|
if isinstance(response, ModelResponse) and not isinstance(
|
||||||
response.choices, StreamingChoices
|
response.choices[0], StreamingChoices
|
||||||
): # /chat/completions requests
|
): # /chat/completions requests
|
||||||
if isinstance(response.choices[0].message.content, str):
|
if isinstance(response.choices[0].message.content, str):
|
||||||
verbose_proxy_logger.debug(
|
verbose_proxy_logger.debug(
|
||||||
|
|
|
@ -53,7 +53,7 @@ async def test_output_parsing():
|
||||||
mock_response="Hello <PERSON>! How can I assist you today?",
|
mock_response="Hello <PERSON>! How can I assist you today?",
|
||||||
)
|
)
|
||||||
new_response = await pii_masking.async_post_call_success_hook(
|
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 (
|
assert (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue