From 2eb5580669d53328d1f39aaf4edbd3a5592b3c35 Mon Sep 17 00:00:00 2001 From: TobiMayr Date: Tue, 28 Jul 2026 20:40:39 +0100 Subject: [PATCH] fix: use Mapping[str, Any] instead of dict[str, Any] to avoid new LIT001 mutable-annotation violations --- .../litellm_completion_transformation/transformation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py index 876ee87ade3..42cb7af202f 100644 --- a/litellm/responses/litellm_completion_transformation/transformation.py +++ b/litellm/responses/litellm_completion_transformation/transformation.py @@ -5,7 +5,7 @@ Handles transforming from Responses API -> LiteLLM completion (Chat Completion import json import re from collections.abc import Sequence -from typing import Any, Literal, cast +from typing import Any, Literal, Mapping, cast from openai.types.responses import ResponseFunctionToolCall from openai.types.responses.response_create_params import ResponseInputParam @@ -168,8 +168,8 @@ class LiteLLMCompletionResponsesConfig: @staticmethod def _transform_tool_choice_for_responses_api_response( - tool_choice: str | dict[str, Any] | None, - ) -> str | dict[str, Any] | None: + tool_choice: str | Mapping[str, Any] | None, + ) -> str | Mapping[str, Any] | None: """ Inverse of ``_transform_tool_choice``: normalizes tool_choice into the shape ``ResponsesAPIResponse.tool_choice`` accepts (flat