Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[AI extensions] Add jsonSchemaIsStrict option to OpenAI options mapping - #6064

#6064
Merged
stephentoub merged 2 commits into
dotnet:maindotnet/extensions:mainfrom
danielwinkler:feature/strict-output-openaidanielwinkler/dotnet-extensions:feature/strict-output-openaiCopy head branch name to clipboard
Mar 16, 2025
Merged

[AI extensions] Add jsonSchemaIsStrict option to OpenAI options mapping#6064
stephentoub merged 2 commits into
dotnet:maindotnet/extensions:mainfrom
danielwinkler:feature/strict-output-openaidanielwinkler/dotnet-extensions:feature/strict-output-openaiCopy head branch name to clipboard

Conversation

@danielwinkler

@danielwinkler danielwinkler commented Mar 10, 2025

Copy link
Copy Markdown
Contributor

See #6062

Microsoft Reviewers: Open in CodeFlow

@danielwinkler
danielwinkler requested a review from a team as a code owner March 10, 2025 15:25
@github-actions github-actions Bot added the area-ai Microsoft.Extensions.AI libraries label Mar 10, 2025
@danielwinkler

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@stephentoub

Copy link
Copy Markdown
Member

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?

@SteveSandersonMS

Copy link
Copy Markdown
Member

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.

@stephentoub
stephentoub force-pushed the feature/strict-output-openai branch from f8ab339 to 5148a45 Compare March 16, 2025 14:59
@stephentoub

Copy link
Copy Markdown
Member

I pushed an update to your branch to fix up the remaining strict handling.

@stephentoub stephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@stephentoub
stephentoub enabled auto-merge (squash) March 16, 2025 15:00
@stephentoub
stephentoub merged commit e4e3187 into dotnet:main Mar 16, 2025
eiriktsarpalis added a commit to eiriktsarpalis/extensions that referenced this pull request Apr 11, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.