Add tests related to reasoning param none

This commit is contained in:
Sameer Kankute
2025-11-25 13:57:15 +05:30
parent a50083a87b
commit c149ade6a8
@@ -104,17 +104,17 @@ def test_azure_gpt5_codex_series_transform_request(config: AzureOpenAIGPT5Config
# GPT-5.1 temperature handling tests for Azure
def test_azure_gpt5_1_temperature_with_reasoning_effort_none(config: AzureOpenAIGPT5Config):
"""Test that Azure GPT-5.1 supports any temperature when reasoning_effort='none'.
"""Test that Azure GPT-5.1 supports any temperature when reasoning_effort='none' and drop_params=True.
Note: Azure OpenAI doesn't support reasoning_effort='none', so it's dropped from the params.
However, the temperature logic still works correctly because the parent treats missing
reasoning_effort the same as 'none' for gpt-5.1.
Note: Azure OpenAI doesn't support reasoning_effort='none', so it's dropped from the params
when drop_params=True. The temperature logic still works correctly because the parent treats
missing reasoning_effort the same as 'none' for gpt-5.1.
"""
params = config.map_openai_params(
non_default_params={"temperature": 0.5, "reasoning_effort": "none"},
optional_params={},
model="azure/gpt-5.1",
drop_params=False,
drop_params=True,
api_version="2024-05-01-preview",
)
assert params["temperature"] == 0.5
@@ -122,6 +122,18 @@ def test_azure_gpt5_1_temperature_with_reasoning_effort_none(config: AzureOpenAI
assert "reasoning_effort" not in params or params.get("reasoning_effort") != "none"
def test_azure_gpt5_1_reasoning_effort_none_error_when_drop_params_false(config: AzureOpenAIGPT5Config):
"""Test that Azure GPT-5.1 raises error for reasoning_effort='none' when drop_params=False."""
with pytest.raises(litellm.utils.UnsupportedParamsError):
config.map_openai_params(
non_default_params={"reasoning_effort": "none"},
optional_params={},
model="azure/gpt-5.1",
drop_params=False,
api_version="2024-05-01-preview",
)
def test_azure_gpt5_1_temperature_without_reasoning_effort(config: AzureOpenAIGPT5Config):
"""Test that Azure GPT-5.1 supports any temperature when reasoning_effort is not specified."""
params = config.map_openai_params(