-
Notifications
You must be signed in to change notification settings - Fork 813
[AI extensions] Add jsonSchemaIsStrict option to OpenAI options mapping #6064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AI extensions] Add jsonSchemaIsStrict option to OpenAI options mapping #6064
Conversation
@dotnet-policy-service agree |
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIModelMapper.ChatCompletion.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIModelMapper.ChatCompletion.cs
Show resolved
Hide resolved
What are the downsides to just always setting strict? I think it's "just" that if a schema is provided the OpenAI doesn't understand, it'll fail? Should we just always set strict and then optionally use something in additional properties as an override? |
There's nothing in OpenAI's announcement that clarifies the drawbacks. Maybe they just didn't know whether it would always work. As per this longer explanation, I'd support always setting strict if there's a schema. And like you say, if OpenAI really needs to support some non-strict mode, that's very OpenAI-specific and could be handled by something in additional properties to override this. |
f8ab339
to
5148a45
Compare
I pushed an update to your branch to fix up the remaining strict handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
See #6062
Microsoft Reviewers: Open in CodeFlow