fix(edenai): advertise reasoning_effort only for models the price map flags as reasoning

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yassin 2026-09-21 19:58:58 +00:00
parent ee97f7327e
commit 9dee1d86e7
2 changed files with 12 additions and 5 deletions

View file

@ -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:

View file

@ -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)