Create the OpenAI ResponseFormat with its builder

Proprietary

Spring AI 2.0 moved org.springframework.ai.openai.api.ResponseFormat to OpenAiChatModel.ResponseFormat, which has no public constructor. This replaces new ResponseFormat(type, schema) with ResponseFormat.builder().jsonSchema(schema).type(type).build(), which Spring AI 2.0 sends with strict schema adherence, as the constructor did.

io.moderne.java.spring.ai2.UseOpenAiResponseFormatBuilder
mod run . --recipe=io.moderne.java.spring.ai2.UseOpenAiResponseFormatBuilder

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.