When using AI SDK from Vercel, when providing a zod schema when doing object generation it will always output the expected structure regardless if the model supports it or not.
I assume they detect if the model natively supports structured output and uses that, otherwise just injects the schema into the prompt.
Right now, if someone working on prompts has everything working well with structured outputs, but we has to use another model, they would have to copy and paste that into the prompt manually.
Maybe a good way to do this is to define a default template for how the json schema will be injected and make that customizable as well.