From ba3ce77e2967e40e1cbf483cc5dcedf018271f5f Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 5 Mar 2026 17:02:14 -0500 Subject: [PATCH] test(openai): cover gpt-5.4-pro parameter behavior --- .../llms/openai/test_gpt5_transformation.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_litellm/llms/openai/test_gpt5_transformation.py b/tests/test_litellm/llms/openai/test_gpt5_transformation.py index 53a554ecb1..70ed96c91a 100644 --- a/tests/test_litellm/llms/openai/test_gpt5_transformation.py +++ b/tests/test_litellm/llms/openai/test_gpt5_transformation.py @@ -316,6 +316,26 @@ def test_gpt5_4_allows_reasoning_effort_xhigh(config: OpenAIConfig): assert params["reasoning_effort"] == "xhigh" +def test_gpt5_4_pro_allows_reasoning_effort_xhigh(config: OpenAIConfig): + params = config.map_openai_params( + non_default_params={"reasoning_effort": "xhigh"}, + optional_params={}, + model="gpt-5.4-pro", + drop_params=False, + ) + assert params["reasoning_effort"] == "xhigh" + + +def test_gpt5_4_pro_rejects_non_default_temperature(config: OpenAIConfig): + with pytest.raises(litellm.utils.UnsupportedParamsError): + config.map_openai_params( + non_default_params={"temperature": 0.5}, + optional_params={}, + model="gpt-5.4-pro", + drop_params=False, + ) + + def test_gpt5_1_temperature_without_reasoning_effort(config: OpenAIConfig): """Test that GPT-5.1 supports any temperature when reasoning_effort is not specified.