fix(core): move drops_unsupported_params into core_helpers on lts/1.108.x

Prerequisite of #48931 on lts/1.108.x, hand-ported from the core_helpers move in b51b9b7d43 (#47347), which the line does not carry. tool_fields imports the helper from core_helpers, and the responses bridge now imports it from there too.
This commit is contained in:
mateo-berri 2026-11-05 16:30:41 -08:00
parent bf06bf1edb
commit 84a0d2950d
2 changed files with 6 additions and 5 deletions

View file

@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, Any, Final, Literal, Protocol, cast, runtime_c
import httpx
from pydantic import TypeAdapter, ValidationError
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.llm_response_utils.get_headers import get_provider_request_id
from litellm.types.llms.openai import AllMessageValues, OpenAIChatCompletionFinishReason
@ -92,6 +93,10 @@ def normalize_drop_params(value: object) -> bool | None:
return None
def drops_unsupported_params(drop_params: object) -> bool:
return litellm.drop_params is True or normalize_drop_params(drop_params) is True
def drop_params_flag(value: object, source: str, logger: logging.Logger) -> bool:
normalized: Final = normalize_drop_params(value)
if normalized is None and value is not None:

View file

@ -41,7 +41,7 @@ from litellm._logging import verbose_logger
from litellm.caching import InMemoryCache
from litellm.constants import REDACTED_BY_LITELLM, REDACTED_TOOL_CALL_ARGUMENTS_PLACEHOLDER
from litellm.integrations.anthropic_cache_control_hook import MAX_CACHE_CONTROL_BLOCKS, AnthropicCacheControlHook
from litellm.litellm_core_utils.core_helpers import normalize_drop_params
from litellm.litellm_core_utils.core_helpers import drops_unsupported_params, normalize_drop_params
from litellm.litellm_core_utils.get_supported_openai_params import (
get_supported_openai_params,
)
@ -322,10 +322,6 @@ def _dropped_cache_control(_: object) -> None:
return None
def drops_unsupported_params(drop_params: object) -> bool:
return litellm.drop_params is True or normalize_drop_params(drop_params) is True
def _without_cache_control_key(item: object) -> object:
if not isinstance(item, dict):
return item