mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(presidio_pii_masking.py): support logging_only pii masking
This commit is contained in:
parent
abd682323c
commit
1a57e49e46
5 changed files with 145 additions and 8 deletions
|
@ -42,7 +42,17 @@ def initialize_callbacks_on_proxy(
|
|||
_OPTIONAL_PresidioPIIMasking,
|
||||
)
|
||||
|
||||
pii_masking_object = _OPTIONAL_PresidioPIIMasking()
|
||||
presidio_logging_only: Optional[bool] = litellm_settings.get(
|
||||
"presidio_logging_only", None
|
||||
)
|
||||
if presidio_logging_only is not None:
|
||||
presidio_logging_only = bool(
|
||||
presidio_logging_only
|
||||
) # validate boolean given
|
||||
|
||||
pii_masking_object = _OPTIONAL_PresidioPIIMasking(
|
||||
logging_only=presidio_logging_only
|
||||
)
|
||||
imported_list.append(pii_masking_object)
|
||||
elif isinstance(callback, str) and callback == "llamaguard_moderations":
|
||||
from enterprise.enterprise_hooks.llama_guard import (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue