fix(azure/gpt-5): restore 'user' param after azure/ normalization

OpenAIGPTConfig.get_supported_openai_params only adds 'user' when the
model is found in litellm.open_ai_chat_completion_models. Normalizing
the model to 'azure/<name>' for capability lookups caused that check
to miss, dropping 'user' from the supported params list for Azure GPT-5
models. Add it back explicitly, mirroring the existing tool_choice fix.

Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
Cursor Agent 2026-05-22 20:28:52 +00:00
parent a3bf293610
commit c293056b38
No known key found for this signature in database

View file

@ -90,6 +90,14 @@ class AzureOpenAIGPT5Config(AzureOpenAIConfig, OpenAIGPT5Config):
if "tool_choice" not in params:
params.append("tool_choice")
# Azure OpenAI supports the "user" param for GPT-5 deployments, but the
# grandparent OpenAIGPTConfig only adds it when the model is in
# litellm.open_ai_chat_completion_models. Normalizing to "azure/<name>"
# for capability lookups above causes that check to miss, so add it
# back here.
if "user" not in params:
params.append("user")
# Only gpt-5.2+ has been verified to support logprobs on Azure.
# The base OpenAI class includes logprobs for gpt-5.1+, but Azure
# hasn't verified support for gpt-5.1, so remove them unless gpt-5.2/5.4+.