Defined in: packages/typescript/ai/src/types.ts:656
Options passed into the SDK and further piped to the AI provider.
TProviderOptionsSuperset extends Record<string, any> = Record<string, any>
TProviderOptionsForModel = TProviderOptionsSuperset
optional abortController: AbortController;optional abortController: AbortController;Defined in: packages/typescript/ai/src/types.ts:740
AbortController for request cancellation.
Allows you to cancel an in-progress request using an AbortController. Useful for implementing timeouts or user-initiated cancellations.
const abortController = new AbortController();
setTimeout(() => abortController.abort(), 5000); // Cancel after 5 seconds
await chat({ ..., abortController });const abortController = new AbortController();
setTimeout(() => abortController.abort(), 5000); // Cancel after 5 seconds
await chat({ ..., abortController });https://developer.mozilla.org/en-US/docs/Web/API/AbortController
optional agentLoopStrategy: AgentLoopStrategy;optional agentLoopStrategy: AgentLoopStrategy;Defined in: packages/typescript/ai/src/types.ts:664
optional conversationId: string;optional conversationId: string;Defined in: packages/typescript/ai/src/types.ts:726
Conversation ID for correlating client and server-side devtools events. When provided, server-side events will be linked to the client conversation in devtools.
optional maxTokens: number;optional maxTokens: number;Defined in: packages/typescript/ai/src/types.ts:699
The maximum number of tokens to generate in the response.
Provider usage:
messages: ModelMessage<
| string
| ContentPart<unknown, unknown, unknown, unknown, unknown>[]
| null>[];messages: ModelMessage<
| string
| ContentPart<unknown, unknown, unknown, unknown, unknown>[]
| null>[];Defined in: packages/typescript/ai/src/types.ts:661
optional metadata: Record<string, any>;optional metadata: Record<string, any>;Defined in: packages/typescript/ai/src/types.ts:710
Additional metadata to attach to the request. Can be used for tracking, debugging, or passing custom information. Structure and constraints vary by provider.
Provider usage:
model: string;model: string;Defined in: packages/typescript/ai/src/types.ts:660
optional modelOptions: TProviderOptionsForModel;optional modelOptions: TProviderOptionsForModel;Defined in: packages/typescript/ai/src/types.ts:711
optional outputSchema: SchemaInput;optional outputSchema: SchemaInput;Defined in: packages/typescript/ai/src/types.ts:721
Schema for structured output. When provided, the adapter should use the provider's native structured output API to ensure the response conforms to this schema. The schema will be converted to JSON Schema format before being sent to the provider. Supports any Standard JSON Schema compliant library (Zod, ArkType, Valibot, etc.).
optional request: Request | RequestInit;optional request: Request | RequestInit;Defined in: packages/typescript/ai/src/types.ts:712
optional runId: string;optional runId: string;Defined in: packages/typescript/ai/src/types.ts:751
Run ID for AG-UI protocol run correlation. When provided, this will be used in RunStartedEvent and RunFinishedEvent. If not provided, a unique ID will be generated.
optional systemPrompts: string[];optional systemPrompts: string[];Defined in: packages/typescript/ai/src/types.ts:663
optional temperature: number;optional temperature: number;Defined in: packages/typescript/ai/src/types.ts:677
Controls the randomness of the output. Higher values (e.g., 0.8) make output more random, lower values (e.g., 0.2) make it more focused and deterministic. Range: [0.0, 2.0]
Note: Generally recommended to use either temperature or topP, but not both.
Provider usage:
optional threadId: string;optional threadId: string;Defined in: packages/typescript/ai/src/types.ts:745
Thread ID for AG-UI protocol run correlation. When provided, this will be used in RunStartedEvent and RunFinishedEvent.
optional tools: Tool<any, any, any>[];optional tools: Tool<any, any, any>[];Defined in: packages/typescript/ai/src/types.ts:662
optional topP: number;optional topP: number;Defined in: packages/typescript/ai/src/types.ts:690
Nucleus sampling parameter. An alternative to temperature sampling. The model considers the results of tokens with topP probability mass. For example, 0.1 means only tokens comprising the top 10% probability mass are considered.
Note: Generally recommended to use either temperature or topP, but not both.
Provider usage: