From ad93e5d8f43b6ba434da7e05e90a685c95af1b04 Mon Sep 17 00:00:00 2001 From: shrey kharbanda Date: Thu, 24 Sep 2026 07:05:41 +0000 Subject: [PATCH] style(images): sort imports and register the depth-bounded json walk --- litellm/cost_calculator.py | 2 +- litellm/images/dimensions.py | 4 +++- tests/code_coverage_tests/recursive_detector.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 96c789ca4c7..b9a0eef475b 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -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, diff --git a/litellm/images/dimensions.py b/litellm/images/dimensions.py index e96cefa79ab..21b07f24717 100644 --- a/litellm/images/dimensions.py +++ b/litellm/images/dimensions.py @@ -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 diff --git a/tests/code_coverage_tests/recursive_detector.py b/tests/code_coverage_tests/recursive_detector.py index dc1f8592612..b32fe5902e1 100644 --- a/tests/code_coverage_tests/recursive_detector.py +++ b/tests/code_coverage_tests/recursive_detector.py @@ -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).