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(presidio): remove redundant isinstance check for ModelResponseStream
Chesarsb370fcd8de09
diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.pyindex d3f1fd17816..b4b25e2d909 100644--- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py+++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py@@ -806,9 +806,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):if self.output_parse_pii is False and litellm.output_parse_pii is False:return response- if isinstance(response, ModelResponse) and not isinstance(- response, ModelResponseStream- ): # /chat/completions requests+ if isinstance(response, ModelResponse): # /chat/completions requestsif isinstance(response.choices[0].message.content, str):verbose_proxy_logger.debug(f"self.pii_tokens: {self.pii_tokens}; initial response: {response.choices[0].message.content}"