mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
feat(presidio): annotate the analyzer-result locals the token suffix reads
entity_type and value come out of an untyped analyzer mapping. They only fed an f-string before, where an Any costs nothing; passing them to _stable_token_suffix makes them call arguments, which is what the remaining unknown-argument error was.
This commit is contained in:
parent
a0b6cd5a67
commit
b2fcef83cc
1 changed files with 4 additions and 2 deletions
|
|
@ -869,8 +869,10 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
|
|||
for ar in reversed(sorted_forward):
|
||||
start = ar["start"]
|
||||
end = ar["end"]
|
||||
entity_type = ar["entity_type"]
|
||||
value = text[start:end]
|
||||
# Annotated because the analyzer result is an untyped mapping: both now
|
||||
# reach _stable_token_suffix as call arguments, where an Any counts.
|
||||
entity_type: str = ar["entity_type"]
|
||||
value: str = text[start:end]
|
||||
suffix = (
|
||||
self._stable_token_suffix(entity_type, value)
|
||||
if self.presidio_stable_tokens
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue