mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
Merge a2b260a9b1 into 2dccc0dc79
This commit is contained in:
commit
49236016bb
2 changed files with 23 additions and 0 deletions
|
|
@ -134,6 +134,7 @@ class AzureOpenAIConfig(BaseConfig):
|
|||
"web_search_options",
|
||||
"prompt_cache_key",
|
||||
"store",
|
||||
"service_tier",
|
||||
]
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -52,6 +52,28 @@ class TestAzureOpenAIConfig:
|
|||
supported_params = config.get_supported_openai_params("gpt-4.1")
|
||||
assert "prompt_cache_key" in supported_params
|
||||
|
||||
def test_service_tier_supported(self):
|
||||
"""Test that 'service_tier' is in supported params for Azure OpenAI models and preserved with drop_params=True."""
|
||||
config: Final = AzureOpenAIConfig()
|
||||
supported_params: Final = config.get_supported_openai_params("gpt-4.1")
|
||||
assert "service_tier" in supported_params
|
||||
|
||||
mapped: Final = config.map_openai_params(
|
||||
non_default_params={"service_tier": "priority"},
|
||||
optional_params={},
|
||||
model="azure/gpt-4.1",
|
||||
drop_params=True,
|
||||
)
|
||||
assert mapped.get("service_tier") == "priority"
|
||||
|
||||
opt: Final = get_optional_params(
|
||||
model="azure/gpt-4o",
|
||||
custom_llm_provider="azure",
|
||||
service_tier="priority",
|
||||
drop_params=True,
|
||||
)
|
||||
assert opt.get("service_tier") == "priority"
|
||||
|
||||
|
||||
def test_map_openai_params_with_preview_api_version():
|
||||
config = AzureOpenAIConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue