Most AI models now support an option to provide structured output.
- Verify that the chat client options for all models that support structured output have a corresponding option.
BeanOutputConverter
does not take advantage of this model feature, it relies on prompt engineering which isn't as robuts.- Review issues listed below for further actions/features.
Comment From: dev-jonghoonpark
Issue #1854 can be resolved through PR https://github.com/spring-projects/spring-ai/pull/2754.
Comment From: mautini
We have the same need here. It would be greatly appreciated to have this feature included in the 1.0 release. This PR (https://github.com/spring-projects/spring-ai/pull/2754) addresses it for OpenAPI, but other models—such as Gemini, Mistral, etc.—also natively support structured output. Are there any plans to support them as well, or is any help needed to make that happen?
Comment From: johnsonr
This is becoming increasingly urgent, as gpt-4.1-mini
is more and more often failing to respect JSON schema appended to the prompt. It's possible to work around it with few shot examples, but that's not ideal.
Comment From: apappascs
I think this issue has been resolved for openai with this commit https://github.com/spring-projects/spring-ai/pull/1198 by @tzolov ?