From fee105a772363c7ff2db8ed94da26019e76aa3a5 Mon Sep 17 00:00:00 2001 From: songkuan-zheng <252822057+songkuan-zheng@users.noreply.github.com> Date: Tue, 15 Sep 2026 07:04:37 +0000 Subject: [PATCH] fix(dashscope): keep the thinking override inside the type-discipline budget Main consumed the LIT001 budget headroom, so the override signature now takes Mapping for its parameters and marks the inherited dict/list return contracts as mutable-ok. Co-authored-by: songkuan-zheng <252822057+songkuan-zheng@users.noreply.github.com> Co-authored-by: songkuan-zheng --- litellm/llms/dashscope/chat/transformation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/dashscope/chat/transformation.py b/litellm/llms/dashscope/chat/transformation.py index 459369d4c60..d37c4610f5d 100644 --- a/litellm/llms/dashscope/chat/transformation.py +++ b/litellm/llms/dashscope/chat/transformation.py @@ -105,17 +105,17 @@ class DashScopeChatConfig(OpenAIGPTConfig): return resolved_api_base return f"{resolved_api_base}/chat/completions" - def get_supported_openai_params(self, model: str) -> list: + def get_supported_openai_params(self, model: str) -> list: # mutable-ok: inherited list contract of OpenAIGPTConfig base_params: Final = super().get_supported_openai_params(model) return [*base_params, "thinking", "reasoning_effort"] # mutable-ok: inherited list contract def _map_openai_params( self, - non_default_params: dict[str, object], - optional_params: dict[str, object], + non_default_params: Mapping[str, object], + optional_params: Mapping[str, object], model: str, drop_params: bool, - ) -> dict[str, object]: + ) -> dict[str, object]: # mutable-ok: dict return contract of OpenAIGPTConfig supported_openai_params: Final = frozenset(self.get_supported_openai_params(model)) passthrough_params: Final = MappingProxyType( {