A model returns a string. Your component needs an object. Everything between those two sentences is where AI features break in production, and one Zod schema can own all of it: the constraint sent to the model, the validation of what comes back, the error text that drives a repair, and the TypeScript type the component consumes.

One schema, four jobs

// schema.ts

import { z } from "zod";

export const Ticket = z.object({