JSON schema response format does not set 'strict' parameter for OpenAI models #5808
Labels
area-AI
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
untriaged
Description
When using the OpenAIChatClient provided by the
Microsoft.Extensions.AI.OpenAI
package, thestrict
parameter of the chat response format is not set.Reproduction Steps
Try with the following setup. Here I am using a model on Azure.
Expected behavior
I'd expect there to either be a parameter for strict behavior, or strict behavior to be the default.
Actual behavior
The
ChatResponseFormatJson
does not have a property for strict, and theForJsonSchema
method does not have a parameter for it. Thus it just silently defaults tonull
.Regression?
This did not work in any previous release.
Known Workarounds
You could implement your own version of the OpenAIChatClient. In there the
strict
parameter could be set to a different default value.Configuration
Using version
9.1.0-preview.1.25064.3
of the package with .NET 9.Other information
No response
The text was updated successfully, but these errors were encountered: