Generation arguments.
Prompt file name.
Output schema.
OptionalschemaDescription?: stringOutput schema description.
OptionalschemaName?: stringOutput schema name.
Optionalvariables?: Record<string, string | number | boolean>Variables to interpolate.
Prompt file name.
Variables to interpolate.
Output schema.
Output schema name.
Output schema description.
AI SDK response with object and metadata.
Since v0.3.0. Use generateText() with Output.object({ schema }) instead. Will be removed in v1.0.0.
// Before (deprecated):
const { object } = await generateObject({ prompt: 'my_prompt', schema: MySchema });
// After (recommended):
const { output } = await generateText({ prompt: 'my_prompt', output: Output.object({ schema: MySchema }) });
generateText for the recommended replacement
Use an LLM model to generate an object with a fixed schema.