import { z } from 'zod'; type Message = SystemMessage | UserMessage | AssistantMessage | ToolResultMessage; type SystemMessage = { role: 'system'; content: string; /** * Application-owned metadata for this message. Provider adapters ignore * this field and never serialize it to provider APIs. */ metadata?: Record; }; type UserMessage = { role: 'user'; content: string | UserContentPart[]; }; type UserContentPart = TextPart | ImagePart | FilePart | AudioPart; type TextPart = { type: 'text'; text: string; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; }; type ImagePart = { type: 'image'; source: { type: 'base64'; mediaType: string; data: string; } | { type: 'url'; url: string; }; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; }; type FilePart = { type: 'file'; data: string; mimeType: string; filename?: string; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; }; type AudioPart = { type: 'audio'; source: { type: 'base64'; mediaType: string; data: string; }; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; }; type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'max'; type ReasoningConfig = { effort: ReasoningEffort; }; type AssistantTextPart = { type: 'text'; text: string; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; }; type ReasoningPart = { type: 'reasoning'; text: string; /** * Application-owned metadata for this part. Provider adapters ignore this * field and never serialize it to provider APIs. */ metadata?: Record; /** * Provider-namespaced metadata for this reasoning block. The top-level key is * the provider identifier (e.g. `'anthropic'`, `'openai'`, `'azure-openai'`), * which also serves as the ownership discriminator: an adapter checks for the * presence of its own key to detect cross-provider blocks. Cross-provider * blocks are downgraded to plain text (preserving context) rather than * forwarding opaque metadata that would cause an API error on the receiving * provider. * * @example Anthropic: `{ anthropic: { signature: '...' } }` * @example OpenAI: `{ openai: { encryptedContent: '...' } }` * @example Azure OpenAI: `{ 'azure-openai': { encryptedContent: '...' } }` */ providerMetadata?: Record>; }; type ToolCallPart = { type: 'tool-call'; toolCall: ToolCall; /** * Provider-namespaced metadata for this tool call. The top-level key is the * provider identifier and serves as the ownership discriminator, exactly as * for `ReasoningPart`: an adapter only forwards metadata stored under its * own key and ignores blocks produced by another provider. * * Some providers require this data to be replayed verbatim. Gemini 3 rejects * a request when a function call from the current turn is sent back without * the thought signature it was issued with. * * @example Google: `{ google: { thoughtSignature: '...' } }` */ providerMetadata?: Record>; }; type AssistantContentPart = AssistantTextPart | ReasoningPart | ToolCallPart; type AssistantMessage = { role: 'assistant'; parts: AssistantContentPart[]; }; type ToolCall = { id: string; name: string; arguments: Record; /** * Application-owned metadata for this tool call. Provider adapters ignore * this field and never serialize it to provider APIs. */ metadata?: Record; }; type ToolResultMessage = { role: 'tool'; toolCallId: string; content: string; isError?: boolean; /** * Application-owned metadata for this tool result. Provider adapters ignore * this field and never serialize it to provider APIs. */ metadata?: Record; }; type ToolDefinition = { name: string; description: string; parameters: TParameters; /** * `true` opts this tool into provider-enforced schema adherence. The * schema must then satisfy the strict-capable schema contract (closed * objects, every key required — use `.nullable()` instead of * `.optional()` — and the shared keyword subset). Omitted or `false` * means non-strict on every provider. Check * `model.capabilities.tools.strictSchemas` before opting in. */ strict?: boolean; }; type ToolSet = Record; type ToolChoice = 'auto' | 'none' | 'required' | { type: 'tool'; toolName: string; }; type ToolChoiceMode = 'auto' | 'none' | 'required' | 'tool'; /** * Modalities a chat model can accept in user messages. * * `file` covers document attachments such as PDFs. `video` is reserved for a * future input part. */ type ChatInputModality = 'text' | 'image' | 'file' | 'audio' | 'video'; /** * Modalities a chat model can emit as assistant content. * * Dedicated generators (`ImageModel`, and future audio/video models) are * separate operations. Chat `output` describes native multimodal responses * from `generate` / `stream`, not those dedicated APIs. */ type ChatOutputModality = 'text' | 'image' | 'audio' | 'video'; type ToolSchemaStrictnessCapabilities = { supported: false; } | { supported: true; maxStrictTools?: number; }; type ModelCapabilities = { reasoning: { mode: 'unsupported' | 'optional' | 'always-on'; supportedEfforts: readonly ReasoningEffort[]; /** * Whether reasoning changes which sampling parameters or values the * provider accepts. */ restrictsSamplingParams: boolean; supportedToolChoices: readonly ToolChoiceMode[]; }; modalities: { /** Modalities accepted in user messages. Always includes `'text'`. */ input: readonly ChatInputModality[]; /** * Modalities the model can emit as assistant content. Always includes * `'text'`. Does not describe dedicated `ImageModel` generation. */ output: readonly ChatOutputModality[]; }; tools: { strictSchemas: ToolSchemaStrictnessCapabilities; }; }; type ChatModel = { readonly provider: string; readonly modelId: string; readonly capabilities: ModelCapabilities; generate(options: GenerateOptions): Promise; stream(options: GenerateOptions): Promise; generateObject(options: GenerateObjectOptions): Promise>; streamObject(options: StreamObjectOptions): Promise>; }; interface GenerateProviderOptions { [key: string]: Record | undefined; } interface EmbedProviderOptions { [key: string]: Record | undefined; } interface ImageProviderOptions { [key: string]: Record | undefined; } type ChatModelMiddleware = { generate?: (args: { execute: (options?: GenerateOptions) => Promise; options: GenerateOptions; model: ChatModel; }) => Promise; stream?: (args: { execute: (options?: GenerateOptions) => Promise; options: GenerateOptions; model: ChatModel; }) => Promise; generateObject?: (args: { execute: (options?: GenerateObjectOptions) => Promise>; options: GenerateObjectOptions; model: ChatModel; }) => Promise>; streamObject?: (args: { execute: (options?: StreamObjectOptions) => Promise>; options: StreamObjectOptions; model: ChatModel; }) => Promise>; }; type EmbeddingModelMiddleware = { embed?: (args: { execute: (options?: EmbedOptions) => Promise; options: EmbedOptions; model: EmbeddingModel; }) => Promise; }; type ImageModelMiddleware = { generate?: (args: { execute: (options?: ImageGenerateOptions) => Promise; options: ImageGenerateOptions; model: ImageModel; }) => Promise; }; type BaseGenerateOptions = { messages: Message[]; temperature?: number; maxTokens?: number; topP?: number; reasoning?: ReasoningConfig; metadata?: Record; providerOptions?: GenerateProviderOptions; signal?: AbortSignal; }; type GenerateOptions = BaseGenerateOptions & { tools?: ToolSet; toolChoice?: ToolChoice; }; type GenerateResult = { parts: AssistantContentPart[]; content: string | null; reasoning: string | null; toolCalls: ToolCall[]; finishReason: FinishReason; usage: ChatUsage; }; type GenerateObjectOptions = BaseGenerateOptions & { schema: TSchema; schemaName?: string; schemaDescription?: string; }; type StreamObjectOptions = GenerateObjectOptions; type GenerateObjectResult = { object: z.infer; finishReason: FinishReason; usage: ChatUsage; }; type FinishReason = 'stop' | 'length' | 'tool-calls' | 'content-filter' | 'unknown'; /** * Token usage reported by the model after a chat completion. * * `inputTokens` is always the **total** input token count, including cached * reads and cache writes. Anthropic's `input_tokens` is normalized by adding * `cache_read_input_tokens` and `cache_creation_input_tokens`. * * `outputTokens` is always the **total** output token count, including both * visible text and internal reasoning. * * `inputTokenDetails` and `outputTokenDetails` provide provider-independent * breakdowns for cache and reasoning accounting. */ type ChatUsage = { /** Total input tokens, including cached and cache-write tokens. */ inputTokens: number; /** Total output tokens, including both visible text and reasoning. */ outputTokens: number; /** Breakdown of input token categories. */ inputTokenDetails: ChatInputTokenDetails; /** Breakdown of output token categories. */ outputTokenDetails: ChatOutputTokenDetails; }; type ChatInputTokenDetails = { /** Input tokens served from a prior cache entry. Subset of `inputTokens`. */ cacheReadTokens: number; /** * Input tokens written to cache for future reuse. Subset of `inputTokens`. * Only Anthropic reports this; other providers report `0`. */ cacheWriteTokens: number; }; type ChatOutputTokenDetails = { /** * Tokens consumed by internal reasoning/thinking. Subset of `outputTokens`. * Omitted when the provider does not report a breakdown. */ reasoningTokens?: number; }; type StreamEvent = { type: 'reasoning-start'; } | { type: 'reasoning-delta'; text: string; } | { type: 'reasoning-end'; metadata?: Record; providerMetadata?: Record>; } | { type: 'text-start'; } | { type: 'text-delta'; text: string; } | { type: 'text-end'; metadata?: Record; } | { type: 'tool-call-start'; toolCallId: string; toolName: string; } | { type: 'tool-call-delta'; toolCallId: string; argumentsDelta: string; } | { type: 'tool-call-end'; toolCall: ToolCall; providerMetadata?: Record>; } | { type: 'finish'; finishReason: FinishReason; usage: ChatUsage; }; /** * Handle for a single in-flight chat streaming operation. * * The handle is replayable: iterating after some or all events have already * arrived replays the buffered event history before waiting for later events. * * `result` resolves with the aggregated final response when the operation * completes successfully, and rejects on abort or upstream failure. * * `events` always resolves with all observed events up to the terminal point, * including abort and failure cases. */ type ChatStream = AsyncIterable & { readonly result: Promise; readonly events: Promise; }; type ObjectStreamEvent = { type: 'object-delta'; text: string; } | { type: 'object'; object: z.infer; } | { type: 'finish'; finishReason: FinishReason; usage: ChatUsage; }; /** * Handle for a single in-flight structured object streaming operation. * * The lifecycle semantics mirror `ChatStream`: iteration is replayable, * `result` settles independently of event consumption, and `events` resolves * with the observed history. */ type ObjectStream = AsyncIterable> & { readonly result: Promise>; readonly events: Promise[]>; }; type EmbeddingModel = { readonly provider: string; readonly modelId: string; embed(options: EmbedOptions): Promise; }; type EmbedOptions = { input: string | string[]; dimensions?: number; metadata?: Record; providerOptions?: EmbedProviderOptions; }; type EmbedResult = { embeddings: number[][]; /** * Optional embedding usage metadata. Some providers/models do not expose * token usage for embedding calls. */ usage?: EmbeddingUsage; }; type EmbeddingUsage = { /** Number of tokens consumed by embedding input. */ inputTokens: number; }; type ImageModel = { readonly provider: string; readonly modelId: string; generate(options: ImageGenerateOptions): Promise; }; type ImageGenerateOptions = { prompt: string; n?: number; size?: string; metadata?: Record; providerOptions?: ImageProviderOptions; }; type ImageGenerateResult = { images: GeneratedImage[]; }; type GeneratedImage = { base64?: string; url?: string; revisedPrompt?: string; }; /** * A single violation of the strict-capable schema contract, reported against * the JSON Schema derived from the tool's Zod `parameters`. */ type StrictToolSchemaViolation = { toolName: string; /** Dot path into the tool's JSON Schema, e.g. `properties.limit`. */ path: string; /** What is wrong and how to fix it. */ message: string; }; /** * Checks the JSON Schema of a strict tool against the strict-capable schema * contract: closed objects with every key required, the basic type set, and * the keyword/format subset every strict-capable provider accepts. * * Pure and non-throwing — returns every violation found so callers can report * them all at once. */ declare function getStrictToolSchemaViolations(toolName: string, schema: Record): StrictToolSchemaViolation[]; declare class CoreAIError extends Error { readonly cause?: unknown; readonly provider?: string; constructor(message: string, cause?: unknown, provider?: string); } declare class ValidationError extends CoreAIError { constructor(message: string, cause?: unknown, provider?: string); } type ToolSchemaStrictnessErrorReason = 'unsupported' | 'limit-exceeded' | 'invalid-schema'; type ToolSchemaStrictnessErrorOptions = { providerId: string; modelId: string; toolNames: readonly string[]; } & ({ reason: 'unsupported'; } | { reason: 'limit-exceeded'; maxStrictTools: number; } | { reason: 'invalid-schema'; violations: readonly StrictToolSchemaViolation[]; }); declare class ToolSchemaStrictnessError extends ValidationError { readonly providerId: string; readonly modelId: string; readonly toolNames: readonly string[]; readonly reason: ToolSchemaStrictnessErrorReason; readonly maxStrictTools?: number; readonly violations?: readonly StrictToolSchemaViolation[]; constructor(options: ToolSchemaStrictnessErrorOptions); } type UnsupportedInputModalityErrorOptions = { modelId: string; providerId: string; requestedModalities: readonly string[]; supportedModalities: readonly string[]; unsupportedModalities: readonly string[]; }; /** * Thrown when user messages include content parts the model does not accept. * Extends {@link ValidationError} so existing `instanceof ValidationError` * checks still match. */ declare class UnsupportedInputModalityError extends ValidationError { readonly requestedModalities: readonly string[]; readonly supportedModalities: readonly string[]; readonly unsupportedModalities: readonly string[]; constructor(options: UnsupportedInputModalityErrorOptions); } declare class AbortedError extends CoreAIError { constructor(cause?: unknown, provider?: string); } declare class StreamAbortedError extends AbortedError { constructor(cause?: unknown, provider?: string); } type ProviderErrorOptions = { statusCode?: number; /** * Provider-specific error code or type as reported by the API, e.g. * `insufficient_quota`, `invalid_request_error`, `RESOURCE_EXHAUSTED`. * Stable machine-readable identifier for logging and classification * where the message itself cannot be recorded. */ code?: string; cause?: unknown; }; declare class ProviderError extends CoreAIError { readonly statusCode?: number; readonly code?: string; /** * @param message Human-readable error message (may include provider text). * @param provider Provider id (e.g. `'openai'`, `'anthropic'`). * @param options Optional HTTP status, provider code, and underlying cause. */ constructor(message: string, provider: string, options?: ProviderErrorOptions); } /** * Base class for transient provider failures that are safe to retry * (rate limits, overload, temporary unavailability). * Discriminate with `instanceof RetryableProviderError`. */ declare class RetryableProviderError extends ProviderError { constructor(message: string, provider: string, options?: ProviderErrorOptions); } type ContextLengthExceededErrorOptions = ProviderErrorOptions & { maxTokens?: number; actualTokens?: number; }; declare class ContextLengthExceededError extends ProviderError { readonly maxTokens?: number; readonly actualTokens?: number; constructor(message: string, provider: string, options?: ContextLengthExceededErrorOptions); } type ProviderQuotaExceededErrorOptions = ProviderErrorOptions; /** * The provider account cannot accept requests because its billing quota or * credit balance is exhausted. This is not retryable until the account * configuration changes. */ declare class ProviderQuotaExceededError extends ProviderError { constructor(message: string, provider: string, options?: ProviderQuotaExceededErrorOptions); } type RateLimitErrorOptions = ProviderErrorOptions & { retryAfterSeconds?: number; }; declare class RateLimitError extends RetryableProviderError { readonly retryAfterSeconds?: number; constructor(message: string, provider: string, options?: RateLimitErrorOptions); } type ModelOverloadedErrorOptions = ProviderErrorOptions; declare class ModelOverloadedError extends RetryableProviderError { constructor(message: string, provider: string, options?: ModelOverloadedErrorOptions); } type ServiceUnavailableErrorOptions = ProviderErrorOptions; declare class ServiceUnavailableError extends RetryableProviderError { constructor(message: string, provider: string, options?: ServiceUnavailableErrorOptions); } type StructuredOutputErrorOptions = { statusCode?: number; cause?: unknown; rawOutput?: string; }; declare class StructuredOutputError extends CoreAIError { readonly statusCode?: number; readonly rawOutput?: string; constructor(message: string, provider: string, options?: StructuredOutputErrorOptions); } declare class StructuredOutputNoObjectGeneratedError extends StructuredOutputError { constructor(message: string, provider: string, options?: StructuredOutputErrorOptions); } declare class StructuredOutputParseError extends StructuredOutputError { constructor(message: string, provider: string, options?: StructuredOutputErrorOptions); } declare class StructuredOutputValidationError extends StructuredOutputError { readonly issues: string[]; constructor(message: string, provider: string, issues: string[], options?: StructuredOutputErrorOptions); } /** * Shared helpers for provider error wrappers. * Providers decide which error subclass to throw; these utilities only * extract common SDK shapes and thin HTTP status conventions. * Provider-specific message heuristics stay in each wrap*Error. */ declare function isRateLimitStatus(statusCode: number | undefined): boolean; declare function isTransientUnavailableStatus(statusCode: number | undefined): boolean; declare function getErrorMessage(error: unknown): string; declare function asRecord(value: unknown): Record | undefined; declare function getString(source: Record | undefined, key: string): string | undefined; /** * Reads a finite numeric HTTP status from common SDK error shapes * (`status` and/or `statusCode`). */ declare function getHttpStatusCode(error: unknown, keys?: readonly ('status' | 'statusCode')[]): number | undefined; declare function isAbortErrorByName(error: unknown): boolean; /** * Parses retry delay from a `Headers` instance or plain header map. * Prefers Azure `retry-after-ms` (ceil ms → seconds), then `Retry-After` * as integer seconds or HTTP-date. */ declare function parseRetryAfterSeconds(headers: Headers | Record | undefined): number | undefined; /** Reads `Retry-After` from common SDK error shapes that expose `headers`. */ declare function getRetryAfterSecondsFromError(error: unknown): number | undefined; declare function defineTool(options: ToolDefinition): ToolDefinition; /** * Convert a Zod schema to a JSON Schema object using Zod 4's native * `z.toJSONSchema()`. */ declare function zodSchemaToJsonSchema(schema: z.ZodType): Record; /** * Normalizes the JSON Schema of a strict tool for providers whose strict mode * requires closed objects (OpenAI-style APIs). The transform is semantics * preserving with respect to the tool's Zod schema: * * - drops `$schema` (metadata, not a constraint), * - sets `additionalProperties: false` on object nodes where absent, which * matches `z.object()` semantics (unknown keys are stripped at parse time), * - drops Zod's implicit safe-integer bounds on integer nodes (see * {@link isImplicitSafeIntegerBound}), * - rewrites `oneOf` to `anyOf`. Zod emits `oneOf` only for * `z.discriminatedUnion()`, whose branches are disjoint by construction, so * the two keywords accept the same values there — and strict-capable * providers accept `anyOf` only. * * It never widens or narrows what the user's Zod schema accepts; schemas that * cannot be expressed in the strict subset are rejected by the contract * validator instead of being rewritten. */ declare function normalizeStrictJsonSchema(schema: Record): Record; declare function stripModelDateSuffix(modelId: string): string; declare const UNSUPPORTED_TOOL_SCHEMA_STRICTNESS: Readonly<{ readonly supported: false; }>; declare const SUPPORTED_TOOL_SCHEMA_STRICTNESS: Readonly<{ readonly supported: true; }>; declare function clampReasoningEffort(effort: ReasoningEffort, supportedEfforts: readonly ReasoningEffort[]): ReasoningEffort; /** Text in, text out — the default chat modality profile. */ declare const TEXT_ONLY_MODALITIES: { readonly input: readonly ["text"]; readonly output: readonly ["text"]; }; /** * Text, image, and file in; text out. * * Typical vision / document chat models. Audio support is advertised separately * by providers whose adapters accept `AudioPart`. */ declare const MULTIMODAL_INPUT_MODALITIES: { readonly input: readonly ["text", "image", "file"]; readonly output: readonly ["text"]; }; declare function supportsInputModality(capabilities: ModelCapabilities, modality: ChatInputModality): boolean; declare function supportsOutputModality(capabilities: ModelCapabilities, modality: ChatOutputModality): boolean; type ValidateInputModalitiesOptions = { messages: Message[]; capabilities: ModelCapabilities; modelId: string; providerId: string; }; /** * Rejects user content parts whose modalities are not in * `capabilities.modalities.input`. Part `type` values map 1:1 to input * modalities (`text`, `image`, `file`, and future `audio` / `video`). */ declare function validateInputModalities({ messages, capabilities, modelId, providerId, }: ValidateInputModalitiesOptions): void; type ValidateToolSchemaStrictnessOptions = { tools: ToolSet; capabilities: ModelCapabilities; providerId: string; modelId: string; }; /** * Validates the strict tools of a request before it reaches the provider. * * Strictness is per-tool opt-in: only tools with `strict: true` are checked. * Throws {@link ToolSchemaStrictnessError} when the model is known not to * support strict schemas (`unsupported`), when more tools opt in than the * model allows (`limit-exceeded`), or when a strict tool's schema falls * outside the strict-capable schema contract (`invalid-schema`). */ declare function validateToolSchemaStrictness({ tools, capabilities, providerId, modelId, }: ValidateToolSchemaStrictnessOptions): void; declare const UNKNOWN_MODEL: unique symbol; type ModelCapabilitiesRegistry = Record & { [UNKNOWN_MODEL]?: TCapabilities; }; declare function getRegisteredModelCapabilities(registry: ModelCapabilitiesRegistry | undefined, modelId: string): TCapabilities | undefined; declare function asObject(value: unknown): Record; declare function safeParseJsonObject(json: string): Record; type ResultToMessageOptions = { includeReasoning?: boolean; }; declare function resultToMessage(result: GenerateResult, options?: ResultToMessageOptions): AssistantMessage; declare function assistantMessage(content: string): AssistantMessage; type GenerateParams = GenerateOptions & { model: ChatModel; }; declare function generate(params: GenerateParams): Promise; type GenerateObjectParams = GenerateObjectOptions & { model: ChatModel; }; declare function generateObject(params: GenerateObjectParams): Promise>; type StreamParams = GenerateOptions & { model: ChatModel; }; declare function stream(params: StreamParams): Promise; type StreamObjectParams = StreamObjectOptions & { model: ChatModel; }; declare function streamObject(params: StreamObjectParams): Promise>; declare function createObjectStream(source: AsyncIterable>, options?: { signal?: AbortSignal; }): ObjectStream; type CreateChatStreamOptions = { signal?: AbortSignal; /** * Maps errors raised while opening or iterating the source — including * in-band SDK failures after HTTP 200 — onto a {@link CoreAIError}. * Already-typed core-ai errors pass through unchanged. */ mapError?: (error: unknown) => CoreAIError; }; declare function createChatStream(source: AsyncIterable | (() => Promise>), options?: CreateChatStreamOptions): ChatStream; declare function wrapChatModel(config: { model: ChatModel; middleware: ChatModelMiddleware | ChatModelMiddleware[]; }): ChatModel; declare function wrapEmbeddingModel(config: { model: EmbeddingModel; middleware: EmbeddingModelMiddleware | EmbeddingModelMiddleware[]; }): EmbeddingModel; declare function wrapImageModel(config: { model: ImageModel; middleware: ImageModelMiddleware | ImageModelMiddleware[]; }): ImageModel; declare function getProviderMetadata>(providerMetadata: Record> | undefined, provider: string): T | undefined; type EmbedParams = EmbedOptions & { model: EmbeddingModel; }; declare function embed(params: EmbedParams): Promise; type GenerateImageParams = ImageGenerateOptions & { model: ImageModel; }; declare function generateImage(params: GenerateImageParams): Promise; export { AbortedError, type AssistantContentPart, type AssistantMessage, type AssistantTextPart, type AudioPart, type BaseGenerateOptions, type ChatInputModality, type ChatInputTokenDetails, type ChatModel, type ChatModelMiddleware, type ChatOutputModality, type ChatOutputTokenDetails, type ChatStream, type ChatUsage, ContextLengthExceededError, type ContextLengthExceededErrorOptions, CoreAIError, type CreateChatStreamOptions, type EmbedOptions, type EmbedProviderOptions, type EmbedResult, type EmbeddingModel, type EmbeddingModelMiddleware, type EmbeddingUsage, type FilePart, type FinishReason, type GenerateObjectOptions, type GenerateObjectResult, type GenerateOptions, type GenerateProviderOptions, type GenerateResult, type GeneratedImage, type ImageGenerateOptions, type ImageGenerateResult, type ImageModel, type ImageModelMiddleware, type ImagePart, type ImageProviderOptions, MULTIMODAL_INPUT_MODALITIES, type Message, type ModelCapabilities, type ModelCapabilitiesRegistry, ModelOverloadedError, type ModelOverloadedErrorOptions, type ObjectStream, type ObjectStreamEvent, ProviderError, type ProviderErrorOptions, ProviderQuotaExceededError, type ProviderQuotaExceededErrorOptions, RateLimitError, type RateLimitErrorOptions, type ReasoningConfig, type ReasoningEffort, type ReasoningPart, RetryableProviderError, SUPPORTED_TOOL_SCHEMA_STRICTNESS, ServiceUnavailableError, type ServiceUnavailableErrorOptions, StreamAbortedError, type StreamEvent, type StreamObjectOptions, type StrictToolSchemaViolation, StructuredOutputError, StructuredOutputNoObjectGeneratedError, StructuredOutputParseError, StructuredOutputValidationError, type SystemMessage, TEXT_ONLY_MODALITIES, type TextPart, type ToolCall, type ToolCallPart, type ToolChoice, type ToolDefinition, type ToolResultMessage, type ToolSchemaStrictnessCapabilities, ToolSchemaStrictnessError, type ToolSchemaStrictnessErrorOptions, type ToolSchemaStrictnessErrorReason, type ToolSet, UNKNOWN_MODEL, UNSUPPORTED_TOOL_SCHEMA_STRICTNESS, UnsupportedInputModalityError, type UnsupportedInputModalityErrorOptions, type UserContentPart, type UserMessage, type ValidateInputModalitiesOptions, type ValidateToolSchemaStrictnessOptions, ValidationError, asObject, asRecord, assistantMessage, clampReasoningEffort, createChatStream, createObjectStream, defineTool, embed, generate, generateImage, generateObject, getErrorMessage, getHttpStatusCode, getProviderMetadata, getRegisteredModelCapabilities, getRetryAfterSecondsFromError, getStrictToolSchemaViolations, getString, isAbortErrorByName, isRateLimitStatus, isTransientUnavailableStatus, normalizeStrictJsonSchema, parseRetryAfterSeconds, resultToMessage, safeParseJsonObject, stream, streamObject, stripModelDateSuffix, supportsInputModality, supportsOutputModality, validateInputModalities, validateToolSchemaStrictness, wrapChatModel, wrapEmbeddingModel, wrapImageModel, zodSchemaToJsonSchema };