spring-ai
spring-ai copied to clipboard
Support for native Structured Output provided by recent OpenAI models
Recently OpenAI released gpt-4o-2024-08-06 model that natively supports Structured Output (https://openai.com/index/introducing-structured-outputs-in-the-api/). It would be good to consider using this native mechanism in Spring AI for OpenAI. According to OpenAI their Structured Output allowed model to follow even complex JSON schemas with much higher reliability than before.
Expected Behavior
Spring AI could use native Structed Output for OpenAI models that support it.
Current Behavior
Currently Spring AI has great implementation of Structured Output. It's best part is that it is generic, but sometimes it's not 100% reliable. It is possible that using native Structured Output would improve it's reliability when it comes to following desired JSON schema.