Fix: add stop param as supported for openai and azure

This commit is contained in:
Sameer Kankute
2026-02-19 11:26:38 +05:30
parent e00c181f0c
commit 44a68cf1c6
4 changed files with 41 additions and 3 deletions
-1
View File
@@ -578,7 +578,6 @@ OPENAI_CHAT_COMPLETION_PARAMS = [
"thinking",
"web_search_options",
"service_tier",
"store",
"prompt_cache_key",
"prompt_cache_retention",
"safety_identifier",
@@ -106,6 +106,7 @@ class AzureOpenAIConfig(BaseConfig):
"audio",
"web_search_options",
"prompt_cache_key",
"store",
]
def _is_response_format_supported_model(self, model: str) -> bool:
@@ -158,7 +159,6 @@ class AzureOpenAIConfig(BaseConfig):
api_version: str = "",
) -> dict:
supported_openai_params = self.get_supported_openai_params(model)
api_version_times = api_version.split("-")
if len(api_version_times) >= 3:
@@ -245,7 +245,6 @@ class AzureOpenAIConfig(BaseConfig):
optional_params["tools"].extend(value)
elif param in supported_openai_params:
optional_params[param] = value
return optional_params
def transform_request(
@@ -162,6 +162,7 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig):
"service_tier",
"safety_identifier",
"prompt_cache_key",
"store",
] # works across all models
model_specific_params = []
@@ -2045,3 +2045,42 @@ def test_store_in_openai_chat_completion_params():
result = get_standard_openai_params({"store": True, "temperature": 0.7})
assert "store" in result
assert result["store"] is True
def test_store_param_passed_through_openai_azure():
"""
Test that the `store` parameter is correctly passed through to OpenAI
and Azure OpenAI providers when using get_optional_params().
This verifies the fix for the regression where `store` was being filtered
out by get_non_default_completion_params() due to architectural issues
in parameter processing pipeline.
Ref: https://github.com/BerriAI/litellm/issues/19700
"""
# Test OpenAI provider
optional_params_openai = get_optional_params(
model="gpt-4o",
custom_llm_provider="openai",
store=True,
)
assert "store" in optional_params_openai
assert optional_params_openai["store"] is True
# Test Azure OpenAI provider
optional_params_azure = get_optional_params(
model="gpt-4.1-2025-04-14",
custom_llm_provider="azure",
store=True,
)
assert "store" in optional_params_azure
assert optional_params_azure["store"] is True
# Test with store=False
optional_params_false = get_optional_params(
model="gpt-4o",
custom_llm_provider="openai",
store=False,
)
assert "store" in optional_params_false
assert optional_params_false["store"] is False