Skip to content

Revert M.E.AI.OpenAI change that turns on strict by default #6266

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

Open
stephentoub opened this issue Apr 9, 2025 · 3 comments · May be fixed by #6285
Open

Revert M.E.AI.OpenAI change that turns on strict by default #6266

stephentoub opened this issue Apr 9, 2025 · 3 comments · May be fixed by #6285
Assignees
Labels
area-ai Microsoft.Extensions.AI libraries bug This issue describes a behavior which is not expected - a bug.

Comments

@stephentoub
Copy link
Member

stephentoub commented Apr 9, 2025

While we now ourselves generate schema that we think conforms to what OpenAI allows in strict mode, not all AIFunctions come from AIFunctionFactory. Any other AIFunction that gets its schema from somewhere else doesn't necessarily conform to the strict rules OpenAI puts in place, and using it via an abstraction makes it really hard to have such hard constraints there by default. We see this with MCP, for example, where MCP tools advertise valid schema that OpenAI's strict mode rejects, e.g. using default.

@stephentoub stephentoub added area-ai Microsoft.Extensions.AI libraries bug This issue describes a behavior which is not expected - a bug. labels Apr 9, 2025
@NiceWaffel
Copy link

While strict schema compliance doesn't necessarily need to be the default, at least the option to set it should be provided (for example as an additional property).

@stephentoub
Copy link
Member Author

stephentoub commented Apr 9, 2025

It was already possible by setting a value into AdditionalProperties.

@eiriktsarpalis
Copy link
Member

eiriktsarpalis commented Apr 11, 2025

Should we disable some of the other nonstandard settings imposed by OpenAI restrictions? Thinking of IncludeTypeInEnumSchemas, DisallowAdditionalProperties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ai Microsoft.Extensions.AI libraries bug This issue describes a behavior which is not expected - a bug.
Projects
None yet
4 participants