Generation arguments.
Prompt file name.
Output schema (array item).
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 (array item).
Output schema name.
Output schema description.
AI SDK response with array and metadata.
Since v0.3.0. Use generateText() with Output.array({ element }) instead. Will be removed in v1.0.0.
// Before (deprecated):
const { object } = await generateArray({ prompt: 'my_prompt', schema: ItemSchema });
// After (recommended):
const { output } = await generateText({ prompt: 'my_prompt', output: Output.array({ element: ItemSchema }) });
generateText for the recommended replacement
Use an LLM model to generate an array of values with a fixed schema.