diff --git a/litellm/llms/edenai/chat/transformation.py b/litellm/llms/edenai/chat/transformation.py index 65c7e21f39b..4fd5a9d550b 100644 --- a/litellm/llms/edenai/chat/transformation.py +++ b/litellm/llms/edenai/chat/transformation.py @@ -57,7 +57,12 @@ class EdenAIChatCompletionStreamingHandler(OpenAIChatCompletionStreamingHandler) class EdenAIChatConfig(OpenAIGPTConfig): def get_supported_openai_params(self, model: str) -> list[str]: # mutable-ok: inherited contract - return [*super().get_supported_openai_params(model), "reasoning_effort"] # mutable-ok: inherited contract + reasoning: Final[tuple[str, ...]] = ( + ("reasoning_effort",) + if litellm.supports_reasoning(model=model, custom_llm_provider=litellm.LlmProviders.EDENAI.value) + else () + ) + return [*super().get_supported_openai_params(model), *reasoning] # mutable-ok: inherited contract @staticmethod def get_api_key(api_key: str | None = None) -> str | None: diff --git a/tests/test_litellm/llms/edenai/chat/test_edenai_chat_transformation.py b/tests/test_litellm/llms/edenai/chat/test_edenai_chat_transformation.py index 945b2713d46..4f1e2c11a51 100644 --- a/tests/test_litellm/llms/edenai/chat/test_edenai_chat_transformation.py +++ b/tests/test_litellm/llms/edenai/chat/test_edenai_chat_transformation.py @@ -133,11 +133,13 @@ class TestRegistration: assert supported is not None assert {"tools", "tool_choice", "response_format", "stream_options", "max_completion_tokens"} <= set(supported) - def test_reasoning_effort_is_supported_because_eden_forwards_it_to_reasoning_models(self): - supported = litellm.get_supported_openai_params(model="openai/gpt-5-mini", custom_llm_provider="edenai") + def test_reasoning_effort_is_supported_only_for_models_the_price_map_flags_as_reasoning(self): + reasoning = litellm.get_supported_openai_params(model="openai/gpt-5-mini", custom_llm_provider="edenai") + plain = litellm.get_supported_openai_params(model="openai/gpt-4.1-nano", custom_llm_provider="edenai") - assert supported is not None - assert "reasoning_effort" in supported + assert reasoning is not None and plain is not None + assert "reasoning_effort" in reasoning + assert "reasoning_effort" not in plain def test_validate_environment_names_the_eden_key(self, monkeypatch): monkeypatch.delenv("EDENAI_API_KEY", raising=False)