mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-29 10:20:54 +00:00
Fix black
This commit is contained in:
@@ -24,7 +24,6 @@ _ENABLE_SECRET_REDACTION = (
|
||||
_REDACTED = "REDACTED"
|
||||
|
||||
|
||||
|
||||
def _build_secret_patterns() -> re.Pattern:
|
||||
patterns: List[str] = [
|
||||
# ── PEM private key / certificate blocks ──
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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]:
|
||||
"""
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user