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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: resolve mypy type checking errors for Union type
Arshdeep Singha9f39396b24a
diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.pyindex 78ade173bf9..d2ec0471e78 100644--- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py+++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py@@ -68,7 +68,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):output_parse_pii: Optional[bool] = False,presidio_ad_hoc_recognizers: Optional[str] = None,logging_only: Optional[bool] = None,- pii_entities_config: Optional[Dict[PiiEntityType, PiiAction]] = None,+ pii_entities_config: Optional[Dict[Union[PiiEntityType, str], PiiAction]] = None,presidio_language: Optional[str] = None,**kwargs,):@@ -173,7 +173,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):analyze_payload["ad_hoc_recognizers"] = self.ad_hoc_recognizersif self.pii_entities_config:- analyze_payload["entities"] = list(self.pii_entities_config.keys())+ analyze_payload["entities"] = list(self.pii_entities_config.keys()) # type: ignore########################################################################### End of adding config params