From 2c82d7758a0220cbcbe4ab58868cf189fd51b247 Mon Sep 17 00:00:00 2001 From: Ege Arhan Date: Fri, 23 Oct 2026 08:11:50 +0000 Subject: [PATCH] fix(passthrough): use bracket pyright ignore at base-call boundary --- .../openai_like/messages/transformation.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/litellm/llms/openai_like/messages/transformation.py b/litellm/llms/openai_like/messages/transformation.py index 8d1140b7235..878f89de965 100644 --- a/litellm/llms/openai_like/messages/transformation.py +++ b/litellm/llms/openai_like/messages/transformation.py @@ -1,4 +1,4 @@ -from typing import Any, Final, cast +from typing import Any, Final import litellm from litellm.litellm_core_utils.url_utils import join_api_base @@ -100,18 +100,13 @@ class OpenAILikeAnthropicMessagesConfig(AnthropicMessagesConfig): for _key in ("thinking", "output_config", "temperature"): if _key in params: stashed[_key] = params.pop(_key) - # base signature is unparameterized; cast at the boundary - base_request: Final[dict[str, object]] = cast( - dict[str, object], - super().transform_anthropic_messages_request( - model=model, - messages=messages, - anthropic_messages_optional_request_params=params, - litellm_params=litellm_params, - headers=headers, - ), + request: Final[dict[str, object]] = super().transform_anthropic_messages_request( # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # the shared base returns a bare dict # mutable-ok: stash restored into it before returning + model=model, + messages=messages, + anthropic_messages_optional_request_params=params, + litellm_params=litellm_params, + headers=headers, ) - request: Final[dict[str, object]] = base_request # mutable-ok: stash restored into it before returning if self.supports_cache_control_ttl(): request.update(stashed) return request