Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Add tests related to reasoning param none

Sameer Kankutec149ade6a8de
diff --git a/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py b/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py
index f48d1a1e93e..3095ff87f5a 100644
--- a/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py
+++ b/tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py
@@ -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(