From 1c7bd303dd4e3095930e789c4ff37f9ead41aacf Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Fri, 6 Feb 2026 13:08:43 +0530 Subject: [PATCH] Correct litellm/litellm/llms/anthropic/chat/transformation.py --- litellm/llms/anthropic/chat/transformation.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py index f4e08d2218c..fe178dd6021 100644 --- a/litellm/llms/anthropic/chat/transformation.py +++ b/litellm/llms/anthropic/chat/transformation.py @@ -172,7 +172,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig): @staticmethod def _is_claude_opus_4_6(model: str) -> bool: - """Check if the model is Claude Opus 4.6.""" + """Check if the model is Claude Opus 4.5.""" return "opus-4-6" in model.lower() or "opus_4_6" in model.lower() def get_supported_openai_params(self, model: str): @@ -647,9 +647,14 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig): new_v.append(v) if len(new_v) > 0: new_stop = new_v + return new_stop + + @staticmethod + def _map_reasoning_effort( + reasoning_effort: Optional[Union[REASONING_EFFORT, str]], + model: str, + ) -> Optional[AnthropicThinkingParam]: if AnthropicConfig._is_claude_opus_4_6(model): - if reasoning_effort is None: - return None return AnthropicThinkingParam( type="adaptive", )