You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: Bug: extra_parameters should be passed as model_extras to the ChatCompletionsClient.complete() method, #13005
Package Name: azure-ai-inference
Package Version: 1.0.0b9
Operating System: macOS
Python Version: Python: 3.11.1
Describe the bug
When using AzureAIInferenceChatPromptExecutionSettings with extra_parameters to pass GPT-5 reasoning parameters (reasoning_effort, verbosity, enable_preamble), the SDK throws an error:
ClientSession._request() got an unexpected keyword argument 'extra_parameters'
To Reproduce
Steps to reproduce the behavior:
Create AzureAIInferenceChatPromptExecutionSettings with extra_parameters:
from semantic_kernel.connectors.ai.azure_ai_inference import AzureAIInferenceChatPromptExecutionSettings
settings = AzureAIInferenceChatPromptExecutionSettings(
temperature=0.5,
max_tokens=4000,
extra_parameters={
'reasoning_effort': 'medium',
'verbosity': 'medium',
'enable_preamble': True,
'reasoning_summary': 'auto'
}
)
Pass settings to ChatCompletionAgent via KernelArguments
Invoke agent with these settings
Error occurs when the SDK tries to make the API call
Expected behavior
The extra_parameters should be passed as model_extras to the ChatCompletionsClient.complete() method, allowing GPT-5 reasoning parameters to be used.
Actual Behavior
The SDK incorrectly passes extra_parameters as a keyword argument to the underlying HTTP client, causing the error.
Additional context
This bug prevents using GPT-5's new reasoning features (reasoning_effort, verbosity, preamble) through Azure AI Foundry with Semantic Kernel, blocking access to key GPT-5 capabilities announced in the recent GA release. This affects adoption of GPT-5 models as the reasoning visibility is a key differentiating feature.
Evan Mattson (@moonbox3)Marius (@marvika) If Semantic Kernel is calling any one of the clients implemented in azure-ai-inference package, and extra parameters are needed to pass in at the root of the request payload, they need to be set as the input dict model_extras when you create the azure-ai-inference client. For example, see the ChatCompletionsClient: https://learn.microsoft.com/en-us/python/api/azure-ai-inference/azure.ai.inference.chatcompletionsclient?view=azure-python-preview. Sounds like this is not being done at the moment - instead a parameter named extra_parameters is passed in, which is rejected by the service. You simply need to rename the parameter before you construct the azure-ai-inference client.
Tao Chen (@TaoChenOSU) what extra request parameters are supported depends on the selected AI model. The SDK does not know anything about those additional parameters. Try passing them in by adding model_extras = {"enable_preable": "true", "reasoning_summary": "auto"} to the chat completions call. You can turn on azure-ai-inference SDK logging to see the full request payload that was sent to the service, and verify that these two additional JSON elements were included. To turn on un-redacted logging, add this at the top of your code:
Activity
dargilco commentedon Aug 25, 2025
Per https://learn.microsoft.com/en-us/python/api/azure-ai-inference/azure.ai.inference.chatcompletionsclient?view=azure-python-preview , ChatCompletionsClient supports
models_extraas a dict of additional parameters that gets passed to the model on the root of the request.dargilco commentedon Aug 25, 2025
Opening this issue on behalf of marvika
moonbox3 commentedon Aug 29, 2025
Devs can use
AzureChatCompletionwhich supports the use of gpt-5 right now. What's specific to Azure AI Inference? Thanks. Marius (@marvika)dargilco commentedon Aug 29, 2025
Evan Mattson (@moonbox3) Marius (@marvika) If Semantic Kernel is calling any one of the clients implemented in azure-ai-inference package, and extra parameters are needed to pass in at the root of the request payload, they need to be set as the input dict
model_extraswhen you create the azure-ai-inference client. For example, see the ChatCompletionsClient: https://learn.microsoft.com/en-us/python/api/azure-ai-inference/azure.ai.inference.chatcompletionsclient?view=azure-python-preview. Sounds like this is not being done at the moment - instead a parameter namedextra_parametersis passed in, which is rejected by the service. You simply need to rename the parameter before you construct the azure-ai-inference client.moonbox3 commentedon Sep 2, 2025
Tao Chen (@TaoChenOSU) can you help take a look at this, please?
TaoChenOSU commentedon Sep 3, 2025
Hey Darren Cohen (@dargilco),
Could you confirm that these two parameters are supported?
dargilco commentedon Sep 3, 2025
Tao Chen (@TaoChenOSU) what extra request parameters are supported depends on the selected AI model. The SDK does not know anything about those additional parameters. Try passing them in by adding
model_extras = {"enable_preable": "true", "reasoning_summary": "auto"}to the chat completions call. You can turn on azure-ai-inference SDK logging to see the full request payload that was sent to the service, and verify that these two additional JSON elements were included. To turn on un-redacted logging, add this at the top of your code:import sys
import logging
logger = logging.getLogger("azure")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
And add this additional input parameter to the ChatCompletions client constructor:
logging_enable=True
Python: Fix Azure AI Inference connector `model_extras` duplication (#…
TaoChenOSU commentedon Sep 4, 2025
Addressed by #13066