style(images): sort imports and register the depth-bounded json walk

This commit is contained in:
shrey kharbanda 2026-09-24 07:05:41 +00:00
parent d09932e524
commit ad93e5d8f4
3 changed files with 5 additions and 2 deletions

View file

@ -26,9 +26,9 @@ from litellm.litellm_core_utils.llm_cost_calc.usage_object_transformation import
TranscriptionUsageObjectTransformation,
)
from litellm.litellm_core_utils.llm_cost_calc.utils import (
_DEPLOYMENT_PRICING_KEYS, # pyright: ignore[reportPrivateUsage] # declared-pricing key set shared with sibling calculators
BilledTokenRates,
CostCalculatorUtils,
_DEPLOYMENT_PRICING_KEYS, # pyright: ignore[reportPrivateUsage] # declared-pricing key set shared with sibling calculators
_generic_cost_per_character,
_get_regional_uplift_multiplier,
_get_service_tier_cost_key,

View file

@ -6,7 +6,9 @@ from dataclasses import dataclass
from io import BytesIO
from typing import IO, Final, cast
from httpx._types import RequestFiles # pyright: ignore[reportPrivateImportUsage] # same source the base transform classes use
from httpx._types import (
RequestFiles, # pyright: ignore[reportPrivateImportUsage] # same source the base transform classes use
)
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.token_counter import get_image_type

View file

@ -68,6 +68,7 @@ IGNORE_FUNCTIONS = [
"_restore_redacted_nested_value", # max depth set (default 10), mirrors _redact_agent_params_tree on the write side.
"_unqualified", # bounded by the qualifier depth of a static TypedDict annotation (Annotated, Required/NotRequired, ReadOnly around one type, no cycles possible).
"_render_json", # bounded by the nesting depth of a pydantic-validated JsonValue from the operator's config (a finite JSON tree, no cycles possible).
"_embedded_image_values", # max depth set (_EMBEDDED_IMAGE_MAX_DEPTH); image fields past the cap are not scanned.
"completion_cost", # max depth 1: recursion only fires for mixed-tier Responses WS logging objects, and each split part carries a single service_tier so _split_responses_ws_logging_object_by_service_tier returns None.
"_string_leaves", # bounded by the nesting depth of a safe_json_structure output (a finite JSON tree, no cycles possible).
"_replace_string_leaves", # bounded by the nesting depth of a safe_json_structure output (a finite JSON tree, no cycles possible).