ai 7.0.93 → 7.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.94
4
+
5
+ ### Patch Changes
6
+
7
+ - a4ba394: feat: support per-request models in batch
8
+ - 36b3364: fix(ai): enforce tool choices in streamText
9
+ - 45099da: Retry unclassified empty image results, preserve retry-attempt accounting, add provider-independent result retryability classification, and mark Google and Google Vertex prompt blocks as terminal.
10
+ - Updated dependencies [a4ba394]
11
+ - Updated dependencies [e9bf5e3]
12
+ - Updated dependencies [45099da]
13
+ - Updated dependencies [56c004c]
14
+ - Updated dependencies [9e1d1b2]
15
+ - Updated dependencies [a495511]
16
+ - @ai-sdk/provider@4.0.11
17
+ - @ai-sdk/gateway@4.0.76
18
+ - @ai-sdk/provider-utils@5.0.37
19
+
3
20
  ## 7.0.93
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EmbeddingModelV4Embedding, EmbeddingModelV4, EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV4Middleware, ImageModelV4ProviderMetadata, ImageModelV2ProviderMetadata, ImageModelV4, ImageModelV3, ImageModelV2, ImageModelV4Middleware, JSONValue as JSONValue$1, LanguageModelV4Source, SharedV4Warning, LanguageModelV4, LanguageModelV3, LanguageModelV2, LanguageModelV4Middleware, RerankingModelV4, RerankingModelV3, SharedV4ProviderMetadata, SharedV4ProviderReference, SpeechModelV4, SpeechModelV3, SpeechModelV2, TranscriptionModelV4, TranscriptionModelV3, TranscriptionModelV2, JSONObject, ImageModelV4Usage, LanguageModelV4CallOptions, LanguageModelV4Prompt, AISDKError, LanguageModelV4ToolCall, JSONSchema7, ProviderV4, ProviderV3, ProviderV2, Experimental_BatchV4Error, Experimental_BatchLanguageModelV4, Experimental_BatchV4Status, Experimental_BatchV4StartResult, SharedV4Headers, LanguageModelV4ToolChoice, LanguageModelV4Content, JSONParseError, TypeValidationError, Experimental_VideoModelV4, Experimental_VideoModelV3, Experimental_VideoModelV4FrameType, Experimental_VideoModelV4OperationWebhook, Experimental_VideoModelV4OperationStatusResult, EmbeddingModelV4CallOptions, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4SessionConfig, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeFactoryV4, Experimental_RealtimeFactoryV4GetTokenOptions, Experimental_RealtimeFactoryV4GetTokenResult, Experimental_RealtimeModelV4ToolDefinition, FilesV4, SkillsV4, NoSuchModelError, SharedV4AudioFormat, Experimental_SpeechTranslationModelV4, Experimental_SpeechTranslationModelV4Usage, FilesV4UploadFileCallOptions, SkillsV4UploadSkillResult, SkillsV4UploadSkillCallOptions, SkillsV4File } from '@ai-sdk/provider';
1
+ import { EmbeddingModelV4Embedding, EmbeddingModelV4, EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV4Middleware, ImageModelV4ProviderMetadata, ImageModelV2ProviderMetadata, ImageModelV4, ImageModelV3, ImageModelV2, ImageModelV4Middleware, JSONValue as JSONValue$1, LanguageModelV4Source, SharedV4Warning, LanguageModelV4, LanguageModelV3, LanguageModelV2, LanguageModelV4Middleware, RerankingModelV4, RerankingModelV3, SharedV4ProviderMetadata, SharedV4ProviderReference, SpeechModelV4, SpeechModelV3, SpeechModelV2, TranscriptionModelV4, TranscriptionModelV3, TranscriptionModelV2, JSONObject, ImageModelV4Usage, LanguageModelV4CallOptions, LanguageModelV4Prompt, AISDKError, LanguageModelV4ToolCall, JSONSchema7, ProviderV4, ProviderV3, ProviderV2, Experimental_BatchV4Status, Experimental_BatchV4Error, Experimental_BatchV4, Experimental_BatchV4ModelIds, Experimental_BatchV4StartResult, SharedV4Headers, LanguageModelV4ToolChoice, LanguageModelV4Content, JSONParseError, TypeValidationError, Experimental_VideoModelV4, Experimental_VideoModelV3, Experimental_VideoModelV4FrameType, Experimental_VideoModelV4OperationWebhook, Experimental_VideoModelV4OperationStatusResult, EmbeddingModelV4CallOptions, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4SessionConfig, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeFactoryV4, Experimental_RealtimeFactoryV4GetTokenOptions, Experimental_RealtimeFactoryV4GetTokenResult, Experimental_RealtimeModelV4ToolDefinition, FilesV4, SkillsV4, NoSuchModelError, SharedV4AudioFormat, Experimental_SpeechTranslationModelV4, Experimental_SpeechTranslationModelV4Usage, FilesV4UploadFileCallOptions, SkillsV4UploadSkillResult, SkillsV4UploadSkillCallOptions, SkillsV4File } from '@ai-sdk/provider';
2
2
  export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
3
3
  import { GatewayModelId } from '@ai-sdk/gateway';
4
4
  export { GatewayAsyncJobMetadata, GatewayModelId, GatewayProviderMetadata, createGateway, gateway } from '@ai-sdk/gateway';
@@ -6230,28 +6230,20 @@ declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends
6230
6230
  } & UIMessageStreamResponseInit & UIMessageStreamOptions<UIMessage<MESSAGE_METADATA, never, InferUITools<TOOLS>>>): Promise<void>;
6231
6231
 
6232
6232
  /**
6233
- * Language model input that can be used for durable batch processing.
6234
- *
6235
- * String model IDs are resolved through the global provider and checked for
6236
- * batch support at runtime.
6233
+ * Provider or lower-level batch interface used for batch processing.
6237
6234
  */
6238
- type BatchLanguageModel = GlobalProviderModelId | Experimental_BatchLanguageModelV4;
6235
+ type BatchProvider = ProviderV4 | Experimental_BatchV4;
6236
+ type InferBatchModelIds<PROVIDER extends BatchProvider> = PROVIDER extends Experimental_BatchV4<infer MODEL_IDS> ? MODEL_IDS : PROVIDER extends {
6237
+ experimental_batch(): Experimental_BatchV4<infer MODEL_IDS>;
6238
+ } ? MODEL_IDS : Experimental_BatchV4ModelIds;
6239
6239
  /**
6240
- * The persisted reference for a text batch.
6240
+ * The persisted reference for a batch.
6241
6241
  */
6242
- type TextBatchReference = {
6243
- readonly version: 1;
6244
- readonly type: 'text';
6242
+ type BatchReference = {
6243
+ readonly version: 2;
6245
6244
  readonly id: string;
6246
6245
  readonly provider: string;
6247
- readonly modelId: string;
6248
6246
  };
6249
- /**
6250
- * Persisted reference for any supported batch type.
6251
- *
6252
- * Additional modality-specific references can be added to this union.
6253
- */
6254
- type BatchReference = TextBatchReference;
6255
6247
  /**
6256
6248
  * Serializable error information for a batch or batch item.
6257
6249
  */
@@ -6261,17 +6253,27 @@ type BatchError = Experimental_BatchV4Error;
6261
6253
  */
6262
6254
  type BatchStatus = Experimental_BatchV4Status;
6263
6255
  /**
6264
- * A text batch and its latest normalized lifecycle status.
6256
+ * A batch and its latest normalized lifecycle status.
6265
6257
  */
6266
- type TextBatch = TextBatchReference & BatchStatus;
6258
+ type Batch = BatchReference & BatchStatus;
6267
6259
  /**
6268
6260
  * One text generation request within a batch.
6269
6261
  */
6270
- type TextBatchRequest = Prompt & LanguageModelCallOptions & {
6262
+ type TextBatchRequest<ModelId extends string = string, TOOLS extends ToolSet = ToolSet> = Prompt & LanguageModelCallOptions & {
6271
6263
  id: string;
6264
+ type: 'text';
6265
+ model: ModelId;
6266
+ tools?: TOOLS;
6267
+ toolChoice?: ToolChoice<NoInfer<TOOLS>>;
6268
+ toolOrder?: ToolOrder<TOOLS>;
6269
+ toolsContext?: InferToolSetContext<TOOLS>;
6272
6270
  providerOptions?: ProviderOptions;
6273
6271
  };
6274
- type BatchRequestOptions = {
6272
+ /**
6273
+ * One request within a batch, discriminated by modality.
6274
+ */
6275
+ type BatchRequest<ModelIds extends Experimental_BatchV4ModelIds = Experimental_BatchV4ModelIds, TOOLS extends ToolSet = ToolSet> = TextBatchRequest<ModelIds['text'], TOOLS>;
6276
+ type BatchCallOptions = {
6275
6277
  abortSignal?: AbortSignal;
6276
6278
  headers?: Record<string, string | undefined>;
6277
6279
  timeout?: number | {
@@ -6279,31 +6281,15 @@ type BatchRequestOptions = {
6279
6281
  };
6280
6282
  };
6281
6283
  /**
6282
- * Options for starting a text batch.
6284
+ * Options for starting a batch.
6283
6285
  */
6284
- type StartTextBatchOptions<TOOLS extends ToolSet = ToolSet> = {
6285
- model: BatchLanguageModel;
6286
- requests: ReadonlyArray<TextBatchRequest>;
6287
- /**
6288
- * Tools that the model can call for every request in the batch.
6289
- *
6290
- * Tool definitions are sent to the provider, but their `execute` functions
6291
- * are never invoked by batch processing.
6292
- */
6293
- tools?: TOOLS;
6294
- /**
6295
- * The tool choice strategy. Default: 'auto'.
6296
- */
6297
- toolChoice?: ToolChoice<NoInfer<TOOLS>>;
6298
- /**
6299
- * Controls the order in which tools are sent to the provider. Tools not
6300
- * listed are appended alphabetically.
6301
- */
6302
- toolOrder?: ToolOrder<TOOLS>;
6286
+ type StartBatchOptions<TOOLS extends ToolSet = ToolSet, PROVIDER extends BatchProvider = BatchProvider> = {
6303
6287
  /**
6304
- * Context used when resolving dynamic tool descriptions.
6288
+ * Provider used to process the batch. Defaults to the global provider, or
6289
+ * the Vercel AI Gateway when no global provider is configured.
6305
6290
  */
6306
- toolsContext?: InferToolSetContext<TOOLS>;
6291
+ provider?: PROVIDER;
6292
+ requests: ReadonlyArray<BatchRequest<InferBatchModelIds<PROVIDER>, TOOLS>>;
6307
6293
  providerOptions?: ProviderOptions;
6308
6294
  /**
6309
6295
  * URL that the provider should notify when the batch reaches a terminal
@@ -6311,29 +6297,38 @@ type StartTextBatchOptions<TOOLS extends ToolSet = ToolSet> = {
6311
6297
  * unsupported warning.
6312
6298
  */
6313
6299
  webhookUrl?: string;
6314
- } & BatchRequestOptions;
6300
+ } & BatchCallOptions;
6315
6301
  /**
6316
- * The acknowledged text batch and warnings produced while starting it.
6302
+ * The acknowledged batch and warnings produced while starting it.
6317
6303
  */
6318
- type StartTextBatchResult = TextBatch & {
6304
+ type StartBatchResult = Batch & {
6319
6305
  readonly warnings: Experimental_BatchV4StartResult['warnings'];
6320
6306
  };
6321
6307
  /**
6322
- * Options shared by batch status and result retrieval operations.
6308
+ * Options for retrieving batch status.
6323
6309
  */
6324
- type BatchOperationOptions<TOOLS extends ToolSet = ToolSet> = {
6325
- model: BatchLanguageModel;
6310
+ type GetBatchStatusOptions = {
6311
+ /**
6312
+ * Provider used to access the batch. Defaults to the global provider, or
6313
+ * the Vercel AI Gateway when no global provider is configured.
6314
+ */
6315
+ provider?: BatchProvider;
6326
6316
  batch: BatchReference;
6317
+ providerOptions?: ProviderOptions;
6318
+ maxRetries?: number;
6319
+ } & BatchCallOptions;
6320
+ /**
6321
+ * Options for retrieving batch results.
6322
+ */
6323
+ type GetBatchResultsOptions<TOOLS extends ToolSet = ToolSet> = GetBatchStatusOptions & {
6327
6324
  /**
6328
- * Definitions for client tools that were provided to `startTextBatch`.
6325
+ * Definitions for client tools that were provided to `startBatch` requests.
6329
6326
  *
6330
6327
  * The definitions are used only to validate and normalize returned tool
6331
6328
  * calls. Their `execute` functions are never invoked.
6332
6329
  */
6333
6330
  tools?: TOOLS;
6334
- providerOptions?: ProviderOptions;
6335
- maxRetries?: number;
6336
- } & BatchRequestOptions;
6331
+ };
6337
6332
  /**
6338
6333
  * A normalized result for a successful text batch item.
6339
6334
  */
@@ -6368,19 +6363,23 @@ type TextBatchItemResult<TOOLS extends ToolSet = ToolSet> = (TextBatchGeneration
6368
6363
  readonly error?: BatchError;
6369
6364
  readonly providerMetadata?: ProviderMetadata;
6370
6365
  };
6366
+ /**
6367
+ * A complete terminal result for one request in a batch.
6368
+ */
6369
+ type BatchItemResult<TOOLS extends ToolSet = ToolSet> = TextBatchItemResult<TOOLS>;
6371
6370
 
6372
6371
  /**
6373
- * Starts a durable text-generation batch.
6372
+ * Starts a batch.
6374
6373
  */
6375
- declare function startTextBatch<TOOLS extends ToolSet>({ model: modelArg, requests, tools, toolChoice, toolOrder, toolsContext, providerOptions, webhookUrl, abortSignal, headers, timeout, }: StartTextBatchOptions<TOOLS>): Promise<StartTextBatchResult>;
6374
+ declare function startBatch<TOOLS extends ToolSet, PROVIDER extends BatchProvider>({ provider, requests, providerOptions, webhookUrl, abortSignal, headers, timeout, }: StartBatchOptions<TOOLS, PROVIDER>): Promise<StartBatchResult>;
6376
6375
  /**
6377
- * Retrieves the latest normalized status for a durable batch.
6376
+ * Retrieves the latest normalized status for a batch.
6378
6377
  */
6379
- declare function getBatchStatus({ model: modelArg, batch, providerOptions, maxRetries, abortSignal, headers, timeout, }: Omit<BatchOperationOptions, 'tools'>): Promise<BatchStatus>;
6378
+ declare function getBatchStatus({ provider, batch, providerOptions, maxRetries, abortSignal, headers, timeout, }: GetBatchStatusOptions): Promise<BatchStatus>;
6380
6379
  /**
6381
- * Streams complete terminal results for the requests in a durable batch.
6380
+ * Streams complete terminal results for the requests in a batch.
6382
6381
  */
6383
- declare function getBatchResults<TOOLS extends ToolSet>({ model: modelArg, batch, tools, providerOptions, maxRetries, abortSignal, headers, timeout, }: BatchOperationOptions<TOOLS>): AsyncIterableStream<TextBatchItemResult<TOOLS>>;
6382
+ declare function getBatchResults<TOOLS extends ToolSet>({ provider, batch, tools, providerOptions, maxRetries, abortSignal, headers, timeout, }: GetBatchResultsOptions<TOOLS>): AsyncIterableStream<BatchItemResult<TOOLS>>;
6384
6383
 
6385
6384
  /**
6386
6385
  * The result of an `embed` call.
@@ -7403,7 +7402,7 @@ type GenerateImagePrompt = string | {
7403
7402
  * @param seed - Seed for the image generation.
7404
7403
  * @param providerOptions - Additional provider-specific options that are passed through to the provider
7405
7404
  * as body parameters.
7406
- * @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
7405
+ * @param maxRetries - Maximum number of retries per image model call, including retries after unclassified empty responses. Empty responses marked as not retryable by the provider are not retried. Set to 0 to disable retries. Default: 2.
7407
7406
  * @param abortSignal - An optional abort signal that can be used to cancel the call.
7408
7407
  * @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
7409
7408
  *
@@ -7454,7 +7453,9 @@ declare function generateImage({ model: modelArg, prompt: promptArg, n, maxImage
7454
7453
  */
7455
7454
  providerOptions?: ProviderOptions;
7456
7455
  /**
7457
- * Maximum number of retries per image model call. Set to 0 to disable retries.
7456
+ * Maximum number of retries per image model call, including retries after
7457
+ * unclassified empty responses. Empty responses marked as not retryable by
7458
+ * the provider are not retried. Set to 0 to disable retries.
7458
7459
  *
7459
7460
  * @default 2
7460
7461
  */
@@ -9741,4 +9742,4 @@ declare function uploadSkill({ api, files, displayTitle, providerOptions, }: {
9741
9742
  files: UploadSkillFile[];
9742
9743
  }): Promise<UploadSkillResult>;
9743
9744
 
9744
- export { AI_SDK_TELEMETRY_TRACING_CHANNEL, AbstractChat, type ActiveTools, type Agent, type AgentCallParameters, type AgentStreamParameters, type AsyncIterableStream, type CallSettings, type CallWarning, type ChatAddToolApproveResponseFunction, type ChatAddToolOutputFunction, type ChatInit, type ChatOnDataCallback, type ChatOnErrorCallback, type ChatOnFinishCallback, type ChatOnToolCallCallback, type ChatRequestOptions, type ChatState, type ChatStatus, type ChatTransport, type ChunkDetector, type CompletionRequestOptions, type ContentPart, type CreateUIMessage, type CustomContentUIPart, type DataUIPart, type DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, type DirectChatTransportOptions, type DynamicToolCall, type DynamicToolError, type DynamicToolResult, type DynamicToolUIPart, type EmbedEndEvent, type EmbedManyResult, type EmbedResult, type EmbedStartEvent, type Embedding, type EmbeddingModel, type EmbeddingModelCallEndEvent, type EmbeddingModelCallStartEvent, type EmbeddingModelMiddleware, type EmbeddingModelUsage, type ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, type ToolLoopAgentSettings as Experimental_AgentSettings, type BatchError as Experimental_BatchError, type BatchLanguageModel as Experimental_BatchLanguageModel, type BatchOperationOptions as Experimental_BatchOperationOptions, type BatchReference as Experimental_BatchReference, type BatchStatus as Experimental_BatchStatus, type DownloadFunction as Experimental_DownloadFunction, type Experimental_GeneratedImage, type InferAgentUIMessage as Experimental_InferAgentUIMessage, type LanguageModelStreamPart as Experimental_LanguageModelStreamPart, type LogWarningsFunction as Experimental_LogWarningsFunction, type RealtimeClientEvent as Experimental_RealtimeClientEvent, type RealtimeFactory as Experimental_RealtimeFactory, type RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, type RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, type RealtimeModel as Experimental_RealtimeModel, type RealtimeServerEvent as Experimental_RealtimeServerEvent, type RealtimeSessionConfig as Experimental_RealtimeSessionConfig, type RealtimeSessionOptions as Experimental_RealtimeSessionOptions, type RealtimeSetupResponse as Experimental_RealtimeSetupResponse, type RealtimeState as Experimental_RealtimeState, type RealtimeStatus as Experimental_RealtimeStatus, type RealtimeToolDefinition as Experimental_RealtimeToolDefinition, type Experimental_SpeechResult, type StartTextBatchOptions as Experimental_StartTextBatchOptions, type StartTextBatchResult as Experimental_StartTextBatchResult, type StreamTranslationResult as Experimental_StreamTranslationResult, type TextBatch as Experimental_TextBatch, type TextBatchGenerationResult as Experimental_TextBatchGenerationResult, type TextBatchItemResult as Experimental_TextBatchItemResult, type TextBatchReference as Experimental_TextBatchReference, type TextBatchRequest as Experimental_TextBatchRequest, type Experimental_ToolCallers, type Experimental_TranscriptionResult, type TranslationStreamPart as Experimental_TranslationStreamPart, type FileUIPart, type FinishReason, type GenerateImageCall, type GenerateImageResult, type GenerateObjectEndEvent, type GenerateObjectResult, type GenerateObjectStartEvent, type GenerateObjectStepEndEvent, type GenerateObjectStepStartEvent, type GenerateTextAbortEvent, type GenerateTextEndEvent, type GenerateTextInclude, type GenerateTextOnAbortCallback, type GenerateTextOnEndCallback, type GenerateTextOnFinishCallback, type GenerateTextOnStartCallback, type GenerateTextOnStepEndCallback, type GenerateTextOnStepFinishCallback, type GenerateTextOnStepStartCallback, type GenerateTextResult, type GenerateTextStartEvent, type GenerateTextStepEndEvent, type GenerateTextStepStartEvent, type GenerateVideoPrompt, type GenerateVideoResult, type GeneratedAudioFile, type GeneratedFile, type GenericToolApprovalFunction, type GetVideoStatusResult, HttpChatTransport, type HttpChatTransportInitOptions, type ImageModel, type ImageModelMiddleware, type ImageModelProviderMetadata, type ImageModelResponseMetadata, type ImageModelUsage, type InferAgentUIMessage, type InferCompleteOutput as InferGenerateOutput, type InferPartialOutput as InferStreamOutput, type InferTelemetryEvent, type InferUIDataParts, type InferUIMessageChunk, type InferUITool, type InferUITools, type Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, type JSONValue, JsonToSseTransformStream, type LanguageModel, type LanguageModelCallEndEvent, type LanguageModelCallOptions, type LanguageModelCallStartEvent, type LanguageModelMiddleware, type LanguageModelRequestMetadata, type LanguageModelResponseMetadata, type LanguageModelUsage, type LogWarningsFunction, MessageConversionError, MissingToolResultsError, type ModelInfo, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, type ObjectStreamPart, type OnFinishEvent, type OnLanguageModelCallEndCallback, type OnLanguageModelCallStartCallback, type OnStartEvent, type OnStepFinishEvent, type OnStepStartEvent, type OnToolCallFinishEvent, type OnToolCallStartEvent, type OnToolExecutionEndCallback, type OnToolExecutionStartCallback, output as Output, type OutputChunkTimingStats, type Output as OutputInterface, type PrepareReconnectToStreamRequest, type PrepareSendMessagesRequest, type PrepareStepFunction, type PrepareStepResult, type Prompt, type Provider, type ProviderMetadata, type ProviderReference, type ProviderRegistryProvider, type ReasoningFileOutput, type ReasoningFileUIPart, type ReasoningOutput, type ReasoningUIPart, type RepairTextFunction, type RequestOptions, type RerankEndEvent, type RerankResult, type RerankStartEvent, type RerankingModel, type RerankingModelCallEndEvent, type RerankingModelCallStartEvent, RetryError, type SafeValidateUIMessagesResult, SerialJobExecutor, type SingleToolApprovalFunction, type SourceDocumentUIPart, type SourceUrlUIPart, type SpeechModel, type SpeechModelResponseMetadata, type SpeechResult, type StartVideoResult, type StaticToolCall, type StaticToolError, type StaticToolOutputDenied, type StaticToolResult, type StepResult, type StepResultPerformance, type StepStartUIPart, type StopCondition, type StreamObjectOnFinishCallback, type StreamObjectResult, StreamProviderError, type StreamTextEndEvent, type StreamTextInclude, type StreamTextOnChunkCallback, type StreamTextOnEndCallback, type StreamTextOnErrorCallback, type StreamTextOnErrorResult, type StreamTextOnErrorRetryCallback, type StreamTextResult, type StreamTextTransform, type StreamTranscriptionResult, type Telemetry, type TelemetryOptions, type TelemetryTracingChannelMessage, type TelemetryTracingEventType, TextStreamChatTransport, type TextStreamPart, type TextUIPart, type TimeoutConfiguration, type ToUIMessageChunkOptions, type ToolApprovalConfiguration, type ToolApprovalRequestOutput, type ToolApprovalResponseOutput, type ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallRepairError, type ToolCallRepairFunction, type ToolChoice, ToolChoiceViolationError, type ToolExecutionEndEvent, type ToolExecutionStartEvent, type ToolInputRefinement, ToolLoopAgent, type ToolLoopAgentSettings, type ToolOrder, type ToolUIPart, type TranscriptionModel, type TranscriptionModelResponseMetadata, type TranscriptionResult, type TranscriptionStreamPart, type TypedToolCall, type TypedToolError, type TypedToolOutputDenied, type TypedToolResult, type UIDataPartSchemas, type UIDataTypes, type UIMessage, type UIMessageChunk, type UIMessagePart, UIMessageStreamError, type UIMessageStreamOnEndCallback, type UIMessageStreamOnFinishCallback, type UIMessageStreamOnStepEndCallback, type UIMessageStreamOnStepFinishCallback, type UIMessageStreamOptions, type UIMessageStreamOutcome, type UIMessageStreamWriter, type UIMessageStreamWriterWithOutcome, type UITool, type UIToolInvocation, type UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, type UploadFileResult, type UploadSkillResult, type UseCompletionOptions, type Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, embed, embedMany, experimental_createProviderRegistry, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, resampleAudio as experimental_resampleAudio, startTextBatch as experimental_startTextBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isTextUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, isStepCount as stepCountIs, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, toolModelMessageSchema, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
9745
+ export { AI_SDK_TELEMETRY_TRACING_CHANNEL, AbstractChat, type ActiveTools, type Agent, type AgentCallParameters, type AgentStreamParameters, type AsyncIterableStream, type CallSettings, type CallWarning, type ChatAddToolApproveResponseFunction, type ChatAddToolOutputFunction, type ChatInit, type ChatOnDataCallback, type ChatOnErrorCallback, type ChatOnFinishCallback, type ChatOnToolCallCallback, type ChatRequestOptions, type ChatState, type ChatStatus, type ChatTransport, type ChunkDetector, type CompletionRequestOptions, type ContentPart, type CreateUIMessage, type CustomContentUIPart, type DataUIPart, type DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, type DirectChatTransportOptions, type DynamicToolCall, type DynamicToolError, type DynamicToolResult, type DynamicToolUIPart, type EmbedEndEvent, type EmbedManyResult, type EmbedResult, type EmbedStartEvent, type Embedding, type EmbeddingModel, type EmbeddingModelCallEndEvent, type EmbeddingModelCallStartEvent, type EmbeddingModelMiddleware, type EmbeddingModelUsage, type ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, type ToolLoopAgentSettings as Experimental_AgentSettings, type Batch as Experimental_Batch, type BatchError as Experimental_BatchError, type BatchItemResult as Experimental_BatchItemResult, type BatchProvider as Experimental_BatchProvider, type BatchReference as Experimental_BatchReference, type BatchRequest as Experimental_BatchRequest, type BatchStatus as Experimental_BatchStatus, type DownloadFunction as Experimental_DownloadFunction, type Experimental_GeneratedImage, type GetBatchResultsOptions as Experimental_GetBatchResultsOptions, type GetBatchStatusOptions as Experimental_GetBatchStatusOptions, type InferAgentUIMessage as Experimental_InferAgentUIMessage, type LanguageModelStreamPart as Experimental_LanguageModelStreamPart, type LogWarningsFunction as Experimental_LogWarningsFunction, type RealtimeClientEvent as Experimental_RealtimeClientEvent, type RealtimeFactory as Experimental_RealtimeFactory, type RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, type RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, type RealtimeModel as Experimental_RealtimeModel, type RealtimeServerEvent as Experimental_RealtimeServerEvent, type RealtimeSessionConfig as Experimental_RealtimeSessionConfig, type RealtimeSessionOptions as Experimental_RealtimeSessionOptions, type RealtimeSetupResponse as Experimental_RealtimeSetupResponse, type RealtimeState as Experimental_RealtimeState, type RealtimeStatus as Experimental_RealtimeStatus, type RealtimeToolDefinition as Experimental_RealtimeToolDefinition, type Experimental_SpeechResult, type StartBatchOptions as Experimental_StartBatchOptions, type StartBatchResult as Experimental_StartBatchResult, type StreamTranslationResult as Experimental_StreamTranslationResult, type TextBatchGenerationResult as Experimental_TextBatchGenerationResult, type TextBatchItemResult as Experimental_TextBatchItemResult, type TextBatchRequest as Experimental_TextBatchRequest, type Experimental_ToolCallers, type Experimental_TranscriptionResult, type TranslationStreamPart as Experimental_TranslationStreamPart, type FileUIPart, type FinishReason, type GenerateImageCall, type GenerateImageResult, type GenerateObjectEndEvent, type GenerateObjectResult, type GenerateObjectStartEvent, type GenerateObjectStepEndEvent, type GenerateObjectStepStartEvent, type GenerateTextAbortEvent, type GenerateTextEndEvent, type GenerateTextInclude, type GenerateTextOnAbortCallback, type GenerateTextOnEndCallback, type GenerateTextOnFinishCallback, type GenerateTextOnStartCallback, type GenerateTextOnStepEndCallback, type GenerateTextOnStepFinishCallback, type GenerateTextOnStepStartCallback, type GenerateTextResult, type GenerateTextStartEvent, type GenerateTextStepEndEvent, type GenerateTextStepStartEvent, type GenerateVideoPrompt, type GenerateVideoResult, type GeneratedAudioFile, type GeneratedFile, type GenericToolApprovalFunction, type GetVideoStatusResult, HttpChatTransport, type HttpChatTransportInitOptions, type ImageModel, type ImageModelMiddleware, type ImageModelProviderMetadata, type ImageModelResponseMetadata, type ImageModelUsage, type InferAgentUIMessage, type InferCompleteOutput as InferGenerateOutput, type InferPartialOutput as InferStreamOutput, type InferTelemetryEvent, type InferUIDataParts, type InferUIMessageChunk, type InferUITool, type InferUITools, type Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, type JSONValue, JsonToSseTransformStream, type LanguageModel, type LanguageModelCallEndEvent, type LanguageModelCallOptions, type LanguageModelCallStartEvent, type LanguageModelMiddleware, type LanguageModelRequestMetadata, type LanguageModelResponseMetadata, type LanguageModelUsage, type LogWarningsFunction, MessageConversionError, MissingToolResultsError, type ModelInfo, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, type ObjectStreamPart, type OnFinishEvent, type OnLanguageModelCallEndCallback, type OnLanguageModelCallStartCallback, type OnStartEvent, type OnStepFinishEvent, type OnStepStartEvent, type OnToolCallFinishEvent, type OnToolCallStartEvent, type OnToolExecutionEndCallback, type OnToolExecutionStartCallback, output as Output, type OutputChunkTimingStats, type Output as OutputInterface, type PrepareReconnectToStreamRequest, type PrepareSendMessagesRequest, type PrepareStepFunction, type PrepareStepResult, type Prompt, type Provider, type ProviderMetadata, type ProviderReference, type ProviderRegistryProvider, type ReasoningFileOutput, type ReasoningFileUIPart, type ReasoningOutput, type ReasoningUIPart, type RepairTextFunction, type RequestOptions, type RerankEndEvent, type RerankResult, type RerankStartEvent, type RerankingModel, type RerankingModelCallEndEvent, type RerankingModelCallStartEvent, RetryError, type SafeValidateUIMessagesResult, SerialJobExecutor, type SingleToolApprovalFunction, type SourceDocumentUIPart, type SourceUrlUIPart, type SpeechModel, type SpeechModelResponseMetadata, type SpeechResult, type StartVideoResult, type StaticToolCall, type StaticToolError, type StaticToolOutputDenied, type StaticToolResult, type StepResult, type StepResultPerformance, type StepStartUIPart, type StopCondition, type StreamObjectOnFinishCallback, type StreamObjectResult, StreamProviderError, type StreamTextEndEvent, type StreamTextInclude, type StreamTextOnChunkCallback, type StreamTextOnEndCallback, type StreamTextOnErrorCallback, type StreamTextOnErrorResult, type StreamTextOnErrorRetryCallback, type StreamTextResult, type StreamTextTransform, type StreamTranscriptionResult, type Telemetry, type TelemetryOptions, type TelemetryTracingChannelMessage, type TelemetryTracingEventType, TextStreamChatTransport, type TextStreamPart, type TextUIPart, type TimeoutConfiguration, type ToUIMessageChunkOptions, type ToolApprovalConfiguration, type ToolApprovalRequestOutput, type ToolApprovalResponseOutput, type ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallRepairError, type ToolCallRepairFunction, type ToolChoice, ToolChoiceViolationError, type ToolExecutionEndEvent, type ToolExecutionStartEvent, type ToolInputRefinement, ToolLoopAgent, type ToolLoopAgentSettings, type ToolOrder, type ToolUIPart, type TranscriptionModel, type TranscriptionModelResponseMetadata, type TranscriptionResult, type TranscriptionStreamPart, type TypedToolCall, type TypedToolError, type TypedToolOutputDenied, type TypedToolResult, type UIDataPartSchemas, type UIDataTypes, type UIMessage, type UIMessageChunk, type UIMessagePart, UIMessageStreamError, type UIMessageStreamOnEndCallback, type UIMessageStreamOnFinishCallback, type UIMessageStreamOnStepEndCallback, type UIMessageStreamOnStepFinishCallback, type UIMessageStreamOptions, type UIMessageStreamOutcome, type UIMessageStreamWriter, type UIMessageStreamWriterWithOutcome, type UITool, type UIToolInvocation, type UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, type UploadFileResult, type UploadSkillResult, type UseCompletionOptions, type Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, embed, embedMany, experimental_createProviderRegistry, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isTextUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, isStepCount as stepCountIs, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, toolModelMessageSchema, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };