Open History to see the last commit
1import { z } from 'zod'
2
3export const guitarRecommendationSchema = z.object({
4 name: z.string(),
5 price: z.number(),
6 reason: z.string(),
7 rating: z.number().min(1).max(5),
8})
9
10export const imageAnalysisSchema = z.object({
11 description: z.string(),
12 objects: z.array(z.string()),
13 mood: z.string(),
14})
15
16/**
17 * Recipe schema for the `multi-turn-structured` e2e feature. Mirrors the
18 * example app's RecipeSchema in
19 * `examples/ts-react-chat/src/routes/api.structured-chat.ts` so the harness
20 * exercises the same shape end users see in the demo.
21 *
22 * Constraints (`min`, `int`, `default`) are intentionally avoided — OpenAI
23 * strict structured outputs reject `integer`, `minimum`/`maximum`,
24 * `minLength`/`maxLength`, `minItems`/`maxItems`, and `default`.
25 */
26export const recipeSchema = z.object({
27 title: z.string(),
28 cuisine: z.string(),
29 servings: z.number(),
30 estimatedCostUsd: z.number(),
31 ingredients: z.array(
32 z.object({
33 item: z.string(),
34 amount: z.string(),
35 }),
36 ),
37 steps: z.array(z.string()),
38 tips: z.array(z.string()),
39})
40
41export type Recipe = z.infer<typeof recipeSchema>