From 3eccededccfd28e7e9cc4934a8304383f60cd21b Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Fri, 1 May 2026 17:33:50 +0530 Subject: [PATCH] Fix black --- litellm/_logging.py | 1 - litellm/cost_calculator.py | 4 +++- litellm/llms/azure/cost_calculation.py | 4 +++- litellm/llms/vertex_ai/gemini/transformation.py | 2 +- .../proxy/guardrails/guardrail_hooks/qohash/qohash.py | 9 +++++++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/litellm/_logging.py b/litellm/_logging.py index 8216777645..d072cc549d 100644 --- a/litellm/_logging.py +++ b/litellm/_logging.py @@ -24,7 +24,6 @@ _ENABLE_SECRET_REDACTION = ( _REDACTED = "REDACTED" - def _build_secret_patterns() -> re.Pattern: patterns: List[str] = [ # ── PEM private key / certificate blocks ── diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 4d7b44bfbd..9b4dd80265 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -513,7 +513,9 @@ def cost_per_token( # noqa: PLR0915 return fireworks_ai_cost_per_token(model=model, usage=usage_block) elif custom_llm_provider == "azure": return azure_openai_cost_per_token( - model=model, usage=usage_block, response_time_ms=response_time_ms, + model=model, + usage=usage_block, + response_time_ms=response_time_ms, service_tier=service_tier, ) elif custom_llm_provider == "gemini": diff --git a/litellm/llms/azure/cost_calculation.py b/litellm/llms/azure/cost_calculation.py index 2e2e0c4965..2a20c55a6c 100644 --- a/litellm/llms/azure/cost_calculation.py +++ b/litellm/llms/azure/cost_calculation.py @@ -12,7 +12,9 @@ from litellm.utils import get_model_info def cost_per_token( - model: str, usage: Usage, response_time_ms: Optional[float] = 0.0, + model: str, + usage: Usage, + response_time_ms: Optional[float] = 0.0, service_tier: Optional[str] = None, ) -> Tuple[float, float]: """ diff --git a/litellm/llms/vertex_ai/gemini/transformation.py b/litellm/llms/vertex_ai/gemini/transformation.py index 4d1b714db9..f756c7a7c5 100644 --- a/litellm/llms/vertex_ai/gemini/transformation.py +++ b/litellm/llms/vertex_ai/gemini/transformation.py @@ -225,7 +225,7 @@ def _process_gemini_media( # Gemini Files API references can be passed through as URI-only. file_data = cast(FileDataType, {"file_uri": image_url}) part = {"file_data": file_data} - return _apply_gemini_3_metadata( + return _apply_gemini_metadata( part, model, media_resolution_enum, video_metadata ) elif ( diff --git a/litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py b/litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py index 7de15192d6..a1bab6dbac 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py +++ b/litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py @@ -1,6 +1,7 @@ """ Qostodian Nexus (by Qohash) — LiteLLM guardrail integration. """ + import os from typing import TYPE_CHECKING, Literal, Optional, Type @@ -25,7 +26,9 @@ class QostodianNexus(GenericGuardrailAPI): api_base: Optional[str] = None, **kwargs, ): - api_base = api_base or os.environ.get("QOSTODIAN_NEXUS_API_BASE", "http://nexus:8800") + api_base = api_base or os.environ.get( + "QOSTODIAN_NEXUS_API_BASE", "http://nexus:8800" + ) kwargs["guardrail_name"] = kwargs.get("guardrail_name", GUARDRAIL_NAME) @@ -38,7 +41,9 @@ class QostodianNexus(GenericGuardrailAPI): ] existing = kwargs.get("extra_headers") or [] - kwargs["extra_headers"] = nexus_headers + [h for h in existing if h not in nexus_headers] + kwargs["extra_headers"] = nexus_headers + [ + h for h in existing if h not in nexus_headers + ] super().__init__( api_base=api_base,