From 1ac430cfeafdbae9d8d960d67c7cf161a9919358 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 4 May 2026 13:01:34 -0700 Subject: [PATCH] style: make _model_supports_effort_param more concise --- litellm/llms/anthropic/chat/transformation.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py index 6e76a9c85e..de021ed0c4 100644 --- a/litellm/llms/anthropic/chat/transformation.py +++ b/litellm/llms/anthropic/chat/transformation.py @@ -285,10 +285,8 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig): @staticmethod def _model_supports_effort_param(model: str) -> bool: """Whether the model accepts ``output_config.effort`` at all.""" - for level in ("low", "minimal", "medium", "high", "xhigh", "max"): - if AnthropicConfig._supports_effort_level(model, level): - return True - return False + return any(AnthropicConfig._supports_effort_level(model, level) + for level in ("low", "minimal", "medium", "high", "xhigh", "max")) def get_supported_openai_params(self, model: str): params = [