ai-sdk-next-openai/app/api/use-object/schema.ts
2025-09-26 15:46:29 +00:00

17 lines
514 B
TypeScript

import { DeepPartial } from 'ai';
import { z } from 'zod';
// define a schema for the notifications
export const notificationSchema = z.object({
notifications: z.array(
z.object({
name: z.string().describe('Name of a fictional person.'),
message: z.string().describe('Message. Do not use emojis or links.'),
minutesAgo: z.number(),
}),
),
});
// define a type for the partial notifications during generation
export type PartialNotification = DeepPartial<typeof notificationSchema>;