Learn how to use Vercel AI SDK for structured data generation in Tuturuuu.
generateObject
and streamObject
functions. You can use Zod schemas to specify the shape of the data that you want, and the AI model will generate data that conforms to that structure.
packages/ai/src/object/types.ts
using Zod.
Here are some examples of schemas used in Tuturuuu:
packages/ai/src/models.ts
:
packages/types/src/supabase.ts
. These types are automatically generated when you run bun sb:typegen
or bun sb:reset
and are accessible to all apps that have the @tuturuuu/types
package installed.
You can use these types to ensure type safety when working with Supabase data in your AI features:
packages/types/src/db.ts
. These are easier to use and remember than the full database type paths:
workspace_secrets
table to enable or disable AI features for specific workspaces:
.describe()
method to provide clear instructions to the AI model.min()
, .max()
, .regex()
, etc.).enum()
.env.local
file in the root of your Next.js app