Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: update PresidioAnalyzeRequest type to support Union entities

Arshdeep Singhcb14bb341d4c
diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.py
index d2ec0471e78..e3f114c746f 100644
--- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py
+++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py
@@ -173,7 +173,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
analyze_payload["ad_hoc_recognizers"] = self.ad_hoc_recognizers
if self.pii_entities_config:
- analyze_payload["entities"] = list(self.pii_entities_config.keys()) # type: ignore
+ analyze_payload["entities"] = list(self.pii_entities_config.keys())
##################################################################
######### End of adding config params
diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py
index 5e480db4826..89e0f39c438 100644
--- a/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py
+++ b/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py
@@ -9,7 +9,7 @@ class PresidioAnalyzeRequest(TypedDict, total=False):
text: str
language: Optional[str]
ad_hoc_recognizers: Optional[List[str]]
- entities: Optional[List[PiiEntityType]]
+ entities: Optional[List[Union[PiiEntityType, str]]]
class PresidioAnalyzeResponseItem(TypedDict, total=False):