From eaaa81e8d4ba96ba746b0b840cb9d3377cec7e40 Mon Sep 17 00:00:00 2001 From: ege-arhan Date: Fri, 23 Oct 2026 03:57:22 +0000 Subject: [PATCH] chore(passthrough): annotate the three new dicts with mutable-ok reasons --- litellm/llms/openai_like/messages/transformation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/llms/openai_like/messages/transformation.py b/litellm/llms/openai_like/messages/transformation.py index 356cb1624e1..078c71a1b3d 100644 --- a/litellm/llms/openai_like/messages/transformation.py +++ b/litellm/llms/openai_like/messages/transformation.py @@ -95,13 +95,13 @@ class OpenAILikeAnthropicMessagesConfig(AnthropicMessagesConfig): model the cost map does not know (see #40890). Pop them before the base transform so no drop warning fires, restore afterwards. """ - params: Final[dict[str, object]] = anthropic_messages_optional_request_params - stashed: Final[dict[str, object]] = {} + params: Final[dict[str, object]] = anthropic_messages_optional_request_params # mutable-ok: popped below to detach the stashed keys + stashed: Final[dict[str, object]] = {} # mutable-ok: filled key-by-key, then restored onto the request for _key in ("thinking", "output_config", "temperature"): if _key in params: stashed[_key] = params.pop(_key) # base returns an unparameterized dict; annotate at the boundary - request: Final[dict[str, object]] = super().transform_anthropic_messages_request( # pyright: ignore[reportUnknownMemberType] # base signature is unparameterized + request: Final[dict[str, object]] = super().transform_anthropic_messages_request( # mutable-ok: base returns a dict the caller updates in place # pyright: ignore[reportUnknownMemberType] # base signature is unparameterized model=model, messages=messages, anthropic_messages_optional_request_params=params,