/** * Provider-specific options for AI SDK models * * This file imports and re-exports provider options from AI SDK v5 packages * to provide type-safe provider options based on the selected provider. */ import type { AnthropicProviderOptions } from '../../_types/@ai-sdk_anthropic-v6/dist/index.d.ts'; import type { DeepSeekChatOptions } from '../../_types/@ai-sdk_deepseek-v5/dist/index.d.ts'; import type { GoogleGenerativeAIProviderOptions } from '../../_types/@ai-sdk_google-v6/dist/index.d.ts'; import type { OpenAIResponsesProviderOptions } from '../../_types/@ai-sdk_openai-v6/dist/index.d.ts'; import type { SharedV2ProviderOptions } from '../../_types/@ai-sdk_provider-v5/dist/index.d.ts'; import type { SharedV3ProviderOptions } from '../../_types/@ai-sdk_provider-v6/dist/index.d.ts'; import type { XaiProviderOptions } from '../../_types/@ai-sdk_xai-v6/dist/index.d.ts'; export type { AnthropicProviderOptions, DeepSeekChatOptions, GoogleGenerativeAIProviderOptions, OpenAIResponsesProviderOptions, XaiProviderOptions, }; export type GoogleProviderOptions = GoogleGenerativeAIProviderOptions; export type OpenAITransport = 'auto' | 'websocket' | 'fetch'; export type ResponsesWebSocketOptions = { /** * WebSocket endpoint URL. * @default 'wss://api.openai.com/v1/responses' */ url?: string; /** * Additional headers sent when establishing the WebSocket connection. * Authorization and OpenAI-Beta are managed internally. */ headers?: Record; /** * Whether to close the WebSocket connection when the stream finishes. * @default true */ closeOnFinish?: boolean; }; export type OpenAIWebSocketOptions = ResponsesWebSocketOptions; export type OpenAIProviderOptions = OpenAIResponsesProviderOptions & { /** * Select the transport used for streaming responses. * - `fetch` uses HTTP streaming. * - `websocket` uses the OpenAI Responses WebSocket API when supported. * - `auto` chooses WebSocket when supported, otherwise falls back to fetch. */ transport?: OpenAITransport; /** * WebSocket-specific configuration for OpenAI streaming. */ websocket?: OpenAIWebSocketOptions; }; export type AzureWebSocketOptions = Omit & { /** * WebSocket endpoint URL. * @default resource-specific Azure OpenAI Responses URL */ url?: string; }; export type AzureProviderOptions = OpenAIResponsesProviderOptions & { /** * Select the transport used for streaming responses. * - `fetch` uses HTTP streaming. * - `websocket` uses the Azure OpenAI Responses WebSocket API when supported. * - `auto` chooses WebSocket when supported, otherwise falls back to fetch. */ transport?: OpenAITransport; /** * WebSocket-specific configuration for Azure OpenAI Responses streaming. */ websocket?: AzureWebSocketOptions; }; export type DeepSeekProviderOptions = DeepSeekChatOptions; /** * Provider options for AI SDK models. * * Provider options are keyed by provider ID and contain provider-specific configuration. * This type extends SharedV2ProviderOptions to maintain compatibility with AI SDK. * * Each provider's options can include both known typed options and unknown keys for * forward compatibility with new provider features. * * @example * ```ts * const result = await agent.generate('hello', { * providerOptions: { * anthropic: { * sendReasoning: true, * thinking: { type: 'enabled', budget: ['low'] } * } * } * }); * ``` */ export type ProviderOptions = (SharedV2ProviderOptions | SharedV3ProviderOptions) & { anthropic?: AnthropicProviderOptions & Record; deepseek?: DeepSeekProviderOptions & Record; google?: GoogleProviderOptions & Record; openai?: OpenAIProviderOptions & Record; azure?: AzureProviderOptions & Record; xai?: XaiProviderOptions & Record; }; /** * Recursively deep-merges provider-options. When both sides have plain objects * at the same key, their keys are merged. Arrays and class instances (Date, * Map, etc.) are replaced wholesale. Within colliding leaf keys, `override` * wins. */ export declare function mergeProviderOptions(base: T | undefined, override: T | undefined): T | undefined; //# sourceMappingURL=provider-options.d.ts.map