mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-15 04:19:08 +00:00
fix: allow app.nz reasoning effort
This commit is contained in:
parent
0d88d85b6c
commit
aca10df765
4 changed files with 28 additions and 1 deletions
|
|
@ -94,6 +94,9 @@ def create_config_class(provider: SimpleProviderConfig):
|
|||
from litellm.utils import supports_function_calling
|
||||
|
||||
supported_params = super().get_supported_openai_params(model=model)
|
||||
supported_params = list(
|
||||
dict.fromkeys([*supported_params, *provider.extra_supported_params])
|
||||
)
|
||||
|
||||
_supports_fc = supports_function_calling(model=model, custom_llm_provider=provider.slug)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class SimpleProviderConfig:
|
|||
self.api_base_env = data.get("api_base_env")
|
||||
self.base_class = data.get("base_class", "openai_gpt")
|
||||
self.param_mappings = data.get("param_mappings", {})
|
||||
self.extra_supported_params = data.get("extra_supported_params", [])
|
||||
self.constraints = data.get("constraints", {})
|
||||
self.special_handling = data.get("special_handling", {})
|
||||
self.supported_endpoints = data.get("supported_endpoints", [])
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@
|
|||
"base_url": "https://app.nz/v1",
|
||||
"api_key_env": "APP_NZ_API_KEY",
|
||||
"api_base_env": "APP_NZ_API_BASE",
|
||||
"base_class": "openai_gpt"
|
||||
"base_class": "openai_gpt",
|
||||
"extra_supported_params": ["reasoning_effort"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class TestAppNZProviderConfig:
|
|||
assert app_nz.api_key_env == "APP_NZ_API_KEY"
|
||||
assert app_nz.api_base_env == "APP_NZ_API_BASE"
|
||||
assert app_nz.base_class == "openai_gpt"
|
||||
assert app_nz.extra_supported_params == ["reasoning_effort"]
|
||||
|
||||
def test_appnz_provider_resolution(self):
|
||||
"""Resolving an app_nz/* model returns the default app.nz base URL"""
|
||||
|
|
@ -82,3 +83,24 @@ class TestAppNZProviderConfig:
|
|||
)
|
||||
|
||||
assert url == "https://app.nz/v1/chat/completions"
|
||||
|
||||
def test_appnz_supports_reasoning_effort(self):
|
||||
"""app.nz forwards its documented reasoning_effort parameter"""
|
||||
from litellm.llms.openai_like.dynamic_config import create_config_class
|
||||
from litellm.llms.openai_like.json_loader import JSONProviderRegistry
|
||||
|
||||
provider = JSONProviderRegistry.get("app_nz")
|
||||
config_class = create_config_class(provider)
|
||||
config = config_class()
|
||||
|
||||
supported_params = config.get_supported_openai_params(model="app/auto")
|
||||
assert "reasoning_effort" in supported_params
|
||||
|
||||
optional_params = config.map_openai_params(
|
||||
non_default_params={"reasoning_effort": "auto"},
|
||||
optional_params={},
|
||||
model="app/auto",
|
||||
drop_params=False,
|
||||
)
|
||||
|
||||
assert optional_params["reasoning_effort"] == "auto"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue