mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix req changes
This commit is contained in:
parent
1badececa3
commit
1073ba6d13
1 changed files with 7 additions and 1 deletions
|
|
@ -508,7 +508,13 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
|
|||
masked_entity_count[entity_type] = (
|
||||
masked_entity_count.get(entity_type, 0) + 1
|
||||
)
|
||||
return redacted_text["text"]
|
||||
# When output_parse_pii is True, new_text contains UUID-suffixed
|
||||
# tokens that match the keys in pii_tokens. Returning
|
||||
# redacted_text["text"] (Presidio's original output) would send
|
||||
# un-suffixed tokens to the LLM, making unmasking impossible.
|
||||
# When output_parse_pii is False, new_text == redacted_text["text"]
|
||||
# because no UUID suffix is appended.
|
||||
return new_text
|
||||
else:
|
||||
raise Exception("Invalid anonymizer response: received None")
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue