ai 7.0.92 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/index.d.ts +239 -214
  3. package/dist/index.js +391 -138
  4. package/dist/index.js.map +1 -1
  5. package/dist/internal/index.d.ts +3 -2
  6. package/dist/internal/index.js +8 -5
  7. package/dist/internal/index.js.map +1 -1
  8. package/docs/02-foundations/02-providers-and-models.mdx +1 -1
  9. package/docs/03-agents/04-loop-control.mdx +5 -3
  10. package/docs/03-agents/07-workflow-agent.mdx +27 -6
  11. package/docs/03-ai-sdk-core/10-generating-structured-data.mdx +15 -3
  12. package/docs/03-ai-sdk-core/16-mcp-tools.mdx +64 -1
  13. package/docs/03-ai-sdk-core/35-image-generation.mdx +9 -0
  14. package/docs/03-ai-sdk-core/36-transcription.mdx +36 -35
  15. package/docs/03-ai-sdk-core/37-speech.mdx +0 -17
  16. package/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +36 -0
  17. package/docs/04-ai-sdk-ui/20-streaming-data.mdx +11 -6
  18. package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +14 -0
  19. package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +15 -1
  20. package/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +2 -1
  21. package/docs/07-reference/01-ai-sdk-core/28-output.mdx +27 -1
  22. package/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +1 -1
  23. package/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +4 -0
  24. package/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +6 -1
  25. package/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +42 -28
  26. package/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +7 -0
  27. package/package.json +12 -12
  28. package/src/agent/tool-loop-agent-settings.ts +15 -0
  29. package/src/batch/batch-types.ts +76 -68
  30. package/src/batch/batch.ts +169 -101
  31. package/src/batch/index.ts +9 -7
  32. package/src/embed/embed-many.ts +27 -2
  33. package/src/error/no-image-generated-error.ts +9 -0
  34. package/src/generate-image/generate-image.ts +51 -10
  35. package/src/generate-text/output.ts +111 -1
  36. package/src/generate-text/stream-language-model-call.ts +82 -0
  37. package/src/generate-text/stream-text.ts +5 -1
  38. package/src/ui/chat.ts +1 -1
  39. package/src/ui/convert-to-model-messages.ts +8 -2
  40. package/src/ui/validate-ui-messages.ts +14 -0
  41. package/src/util/data-url.ts +1 -1
  42. package/src/util/merge-abort-signals.ts +1 -1
  43. package/src/util/prepare-retries.ts +7 -1
  44. package/src/util/retry-with-exponential-backoff.ts +9 -4
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';
@@ -3814,13 +3814,23 @@ declare const object: <OBJECT>({ schema: inputSchema, name, description, }: {
3814
3814
  * When the model generates a text response, it will return an array of elements.
3815
3815
  *
3816
3816
  * @param element - The schema of the array elements to generate.
3817
+ * @param minItems - Optional minimum number of elements to generate.
3818
+ * @param maxItems - Optional maximum number of elements to generate.
3817
3819
  * @param name - Optional name of the output that should be generated. Used by some providers for additional LLM guidance, e.g. via tool or schema name.
3818
3820
  * @param description - Optional description of the output that should be generated. Used by some providers for additional LLM guidance, e.g. via tool or schema description.
3819
3821
  *
3820
3822
  * @returns An output specification for generating an array of elements.
3821
3823
  */
3822
- declare const array: <ELEMENT>({ element: inputElementSchema, name, description, }: {
3824
+ declare const array: <ELEMENT>({ element: inputElementSchema, minItems, maxItems, name, description, }: {
3823
3825
  element: FlexibleSchema<ELEMENT>;
3826
+ /**
3827
+ * Optional minimum number of elements to generate.
3828
+ */
3829
+ minItems?: number;
3830
+ /**
3831
+ * Optional maximum number of elements to generate.
3832
+ */
3833
+ maxItems?: number;
3824
3834
  /**
3825
3835
  * Optional name of the output that should be generated.
3826
3836
  * Used by some providers for additional LLM guidance, e.g. via tool or schema name.
@@ -5156,6 +5166,15 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUN
5156
5166
  * @deprecated Use `onStepStart` instead.
5157
5167
  */
5158
5168
  experimental_onStepStart?: GenerateTextOnStepStartCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
5169
+ /**
5170
+ * Callback that is called immediately before the provider model call begins.
5171
+ */
5172
+ onLanguageModelCallStart?: OnLanguageModelCallStartCallback;
5173
+ /**
5174
+ * Callback that is called after the model response has been normalized and parsed,
5175
+ * but before any client-side tool execution begins.
5176
+ */
5177
+ onLanguageModelCallEnd?: OnLanguageModelCallEndCallback<NoInfer<TOOLS>>;
5159
5178
  /**
5160
5179
  * Callback that is called before each tool execution begins.
5161
5180
  */
@@ -6211,28 +6230,20 @@ declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends
6211
6230
  } & UIMessageStreamResponseInit & UIMessageStreamOptions<UIMessage<MESSAGE_METADATA, never, InferUITools<TOOLS>>>): Promise<void>;
6212
6231
 
6213
6232
  /**
6214
- * Language model input that can be used for durable batch processing.
6215
- *
6216
- * String model IDs are resolved through the global provider and checked for
6217
- * batch support at runtime.
6233
+ * Provider or lower-level batch interface used for batch processing.
6218
6234
  */
6219
- 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;
6220
6239
  /**
6221
- * The persisted reference for a text batch.
6240
+ * The persisted reference for a batch.
6222
6241
  */
6223
- type TextBatchReference = {
6224
- readonly version: 1;
6225
- readonly type: 'text';
6242
+ type BatchReference = {
6243
+ readonly version: 2;
6226
6244
  readonly id: string;
6227
6245
  readonly provider: string;
6228
- readonly modelId: string;
6229
6246
  };
6230
- /**
6231
- * Persisted reference for any supported batch type.
6232
- *
6233
- * Additional modality-specific references can be added to this union.
6234
- */
6235
- type BatchReference = TextBatchReference;
6236
6247
  /**
6237
6248
  * Serializable error information for a batch or batch item.
6238
6249
  */
@@ -6242,17 +6253,27 @@ type BatchError = Experimental_BatchV4Error;
6242
6253
  */
6243
6254
  type BatchStatus = Experimental_BatchV4Status;
6244
6255
  /**
6245
- * A text batch and its latest normalized lifecycle status.
6256
+ * A batch and its latest normalized lifecycle status.
6246
6257
  */
6247
- type TextBatch = TextBatchReference & BatchStatus;
6258
+ type Batch = BatchReference & BatchStatus;
6248
6259
  /**
6249
6260
  * One text generation request within a batch.
6250
6261
  */
6251
- type TextBatchRequest = Prompt & LanguageModelCallOptions & {
6262
+ type TextBatchRequest<ModelId extends string = string, TOOLS extends ToolSet = ToolSet> = Prompt & LanguageModelCallOptions & {
6252
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>;
6253
6270
  providerOptions?: ProviderOptions;
6254
6271
  };
6255
- 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 = {
6256
6277
  abortSignal?: AbortSignal;
6257
6278
  headers?: Record<string, string | undefined>;
6258
6279
  timeout?: number | {
@@ -6260,31 +6281,15 @@ type BatchRequestOptions = {
6260
6281
  };
6261
6282
  };
6262
6283
  /**
6263
- * Options for starting a text batch.
6284
+ * Options for starting a batch.
6264
6285
  */
6265
- type StartTextBatchOptions<TOOLS extends ToolSet = ToolSet> = {
6266
- model: BatchLanguageModel;
6267
- requests: ReadonlyArray<TextBatchRequest>;
6268
- /**
6269
- * Tools that the model can call for every request in the batch.
6270
- *
6271
- * Tool definitions are sent to the provider, but their `execute` functions
6272
- * are never invoked by batch processing.
6273
- */
6274
- tools?: TOOLS;
6275
- /**
6276
- * The tool choice strategy. Default: 'auto'.
6277
- */
6278
- toolChoice?: ToolChoice<NoInfer<TOOLS>>;
6279
- /**
6280
- * Controls the order in which tools are sent to the provider. Tools not
6281
- * listed are appended alphabetically.
6282
- */
6283
- toolOrder?: ToolOrder<TOOLS>;
6286
+ type StartBatchOptions<TOOLS extends ToolSet = ToolSet, PROVIDER extends BatchProvider = BatchProvider> = {
6284
6287
  /**
6285
- * 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.
6286
6290
  */
6287
- toolsContext?: InferToolSetContext<TOOLS>;
6291
+ provider?: PROVIDER;
6292
+ requests: ReadonlyArray<BatchRequest<InferBatchModelIds<PROVIDER>, TOOLS>>;
6288
6293
  providerOptions?: ProviderOptions;
6289
6294
  /**
6290
6295
  * URL that the provider should notify when the batch reaches a terminal
@@ -6292,29 +6297,38 @@ type StartTextBatchOptions<TOOLS extends ToolSet = ToolSet> = {
6292
6297
  * unsupported warning.
6293
6298
  */
6294
6299
  webhookUrl?: string;
6295
- } & BatchRequestOptions;
6300
+ } & BatchCallOptions;
6296
6301
  /**
6297
- * The acknowledged text batch and warnings produced while starting it.
6302
+ * The acknowledged batch and warnings produced while starting it.
6298
6303
  */
6299
- type StartTextBatchResult = TextBatch & {
6304
+ type StartBatchResult = Batch & {
6300
6305
  readonly warnings: Experimental_BatchV4StartResult['warnings'];
6301
6306
  };
6302
6307
  /**
6303
- * Options shared by batch status and result retrieval operations.
6308
+ * Options for retrieving batch status.
6304
6309
  */
6305
- type BatchOperationOptions<TOOLS extends ToolSet = ToolSet> = {
6306
- 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;
6307
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 & {
6308
6324
  /**
6309
- * Definitions for client tools that were provided to `startTextBatch`.
6325
+ * Definitions for client tools that were provided to `startBatch` requests.
6310
6326
  *
6311
6327
  * The definitions are used only to validate and normalize returned tool
6312
6328
  * calls. Their `execute` functions are never invoked.
6313
6329
  */
6314
6330
  tools?: TOOLS;
6315
- providerOptions?: ProviderOptions;
6316
- maxRetries?: number;
6317
- } & BatchRequestOptions;
6331
+ };
6318
6332
  /**
6319
6333
  * A normalized result for a successful text batch item.
6320
6334
  */
@@ -6349,19 +6363,23 @@ type TextBatchItemResult<TOOLS extends ToolSet = ToolSet> = (TextBatchGeneration
6349
6363
  readonly error?: BatchError;
6350
6364
  readonly providerMetadata?: ProviderMetadata;
6351
6365
  };
6366
+ /**
6367
+ * A complete terminal result for one request in a batch.
6368
+ */
6369
+ type BatchItemResult<TOOLS extends ToolSet = ToolSet> = TextBatchItemResult<TOOLS>;
6352
6370
 
6353
6371
  /**
6354
- * Starts a durable text-generation batch.
6372
+ * Starts a batch.
6355
6373
  */
6356
- 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>;
6357
6375
  /**
6358
- * Retrieves the latest normalized status for a durable batch.
6376
+ * Retrieves the latest normalized status for a batch.
6359
6377
  */
6360
- 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>;
6361
6379
  /**
6362
- * Streams complete terminal results for the requests in a durable batch.
6380
+ * Streams complete terminal results for the requests in a batch.
6363
6381
  */
6364
- 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>>;
6365
6383
 
6366
6384
  /**
6367
6385
  * The result of an `embed` call.
@@ -6839,6 +6857,156 @@ declare class MissingToolResultsError extends AISDKError {
6839
6857
  static isInstance(error: unknown): error is MissingToolResultsError;
6840
6858
  }
6841
6859
 
6860
+ type ActiveToolSubset<TOOLS extends ToolSet | undefined, ACTIVE_TOOL_NAMES extends ActiveTools<NonNullable<TOOLS>>> = TOOLS extends undefined ? undefined : [ACTIVE_TOOL_NAMES] extends [NonNullable<ActiveTools<NonNullable<TOOLS>>>] ? Pick<NonNullable<TOOLS>, ACTIVE_TOOL_NAMES[number]> : TOOLS;
6861
+ /**
6862
+ * Filters the tools to only include the active tools.
6863
+ * When activeTools is provided, we only include the tools that are in the list.
6864
+ *
6865
+ * @param tools - The tools to filter.
6866
+ * @param activeTools - The active tools to include.
6867
+ * @returns The filtered tools.
6868
+ */
6869
+ declare function filterActiveTools<TOOLS extends ToolSet | undefined, ACTIVE_TOOL_NAMES extends ActiveTools<NonNullable<TOOLS>>>({ tools, activeTools, }: {
6870
+ tools: TOOLS;
6871
+ activeTools: ACTIVE_TOOL_NAMES;
6872
+ }): ActiveToolSubset<TOOLS, ACTIVE_TOOL_NAMES>;
6873
+
6874
+ /**
6875
+ * Prunes model messages from a list of model messages.
6876
+ *
6877
+ * @param messages - The list of model messages to prune.
6878
+ * @param reasoning - How to remove reasoning content from assistant messages. Default is `'none'`.
6879
+ * @param toolCalls - How to prune tool call/results/approval content. Default is `[]`.
6880
+ * @param emptyMessages - Whether to keep or remove messages whose content is empty after pruning. Default is `'remove'`.
6881
+ *
6882
+ * @returns The pruned list of model messages.
6883
+ */
6884
+ declare function pruneMessages({ messages, reasoning, toolCalls, emptyMessages, }: {
6885
+ messages: ModelMessage[];
6886
+ reasoning?: 'all' | 'before-last-message' | 'none';
6887
+ toolCalls?: 'all' | 'before-last-message' | `before-last-${number}-messages` | 'none' | Array<{
6888
+ type: 'all' | 'before-last-message' | `before-last-${number}-messages`;
6889
+ tools?: string[];
6890
+ }>;
6891
+ emptyMessages?: 'keep' | 'remove';
6892
+ }): ModelMessage[];
6893
+
6894
+ /**
6895
+ * Detects the first chunk in a buffer.
6896
+ *
6897
+ * @param buffer - The buffer to detect the first chunk in.
6898
+ *
6899
+ * @returns The first detected chunk, or `undefined` if no chunk was detected.
6900
+ */
6901
+ type ChunkDetector = (buffer: string) => string | undefined | null;
6902
+ /**
6903
+ * Smooths text and reasoning streaming output.
6904
+ *
6905
+ * @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay. The delay is skipped while the document is hidden (e.g. browser background tabs), where timer throttling would otherwise stall the stream.
6906
+ * @param chunking - Controls how the text is chunked for streaming. Use "word" to stream word by word (default), "line" to stream line by line, provide a custom RegExp pattern that does not match the empty string for custom chunking, provide an Intl.Segmenter for locale-aware word segmentation (recommended for CJK languages), or provide a custom ChunkDetector function.
6907
+ *
6908
+ * @returns A transform stream that smooths text streaming output.
6909
+ */
6910
+ declare function smoothStream<TOOLS extends ToolSet>({ delayInMs, chunking, _internal: { delay }, }?: {
6911
+ delayInMs?: number | null;
6912
+ chunking?: 'word' | 'line' | RegExp | ChunkDetector | Intl.Segmenter;
6913
+ /**
6914
+ * Internal. For test use only. May change without notice.
6915
+ */
6916
+ _internal?: {
6917
+ delay?: (delayInMs: number | null) => Promise<void>;
6918
+ };
6919
+ }): (options: {
6920
+ tools: TOOLS;
6921
+ }) => TransformStream<TextStreamPart<TOOLS>, TextStreamPart<TOOLS>>;
6922
+
6923
+ /**
6924
+ * Fingerprint the server-controlled, security-relevant fields of each tool in a
6925
+ * `ToolSet`: `description` (string form only), the resolved input JSON schema,
6926
+ * and `title`. Returns a map of tool name to a stable digest.
6927
+ *
6928
+ * Capture a baseline at trust time (first connect, human-reviewed) and compare
6929
+ * later fetches with {@link detectToolDrift} to catch MCP tool-definition drift
6930
+ * ("rug pull"). Baseline storage and the drift response are the app's concern.
6931
+ */
6932
+ declare function fingerprintTools(tools: ToolSet): Promise<Record<string, string>>;
6933
+ /**
6934
+ * Pure diff of two fingerprint maps produced by {@link fingerprintTools}.
6935
+ * `added`/`removed` are tools present in only one map; `changed` are tools whose
6936
+ * pinned definition differs. Uses own-property lookups so a tool literally named
6937
+ * `constructor` or `toString` diffs correctly.
6938
+ */
6939
+ declare function detectToolDrift(current: Record<string, string>, baseline: Record<string, string>): {
6940
+ added: string[];
6941
+ removed: string[];
6942
+ changed: string[];
6943
+ };
6944
+
6945
+ /**
6946
+ * The result of one underlying image model call.
6947
+ */
6948
+ interface GenerateImageCall {
6949
+ /**
6950
+ * The images generated by this call.
6951
+ */
6952
+ readonly images: Array<GeneratedFile>;
6953
+ /**
6954
+ * Provider-specific metadata for this call.
6955
+ */
6956
+ readonly providerMetadata?: ImageModelV4ProviderMetadata;
6957
+ /**
6958
+ * Response metadata from the provider.
6959
+ */
6960
+ readonly response: ImageModelResponseMetadata;
6961
+ /**
6962
+ * Warnings for this call, e.g. unsupported settings.
6963
+ */
6964
+ readonly warnings: Array<Warning>;
6965
+ /**
6966
+ * Token usage for this call, if reported by the provider.
6967
+ */
6968
+ readonly usage?: ImageModelUsage;
6969
+ }
6970
+ /**
6971
+ * The result of a `generateImage` call.
6972
+ * It contains the images and additional information.
6973
+ */
6974
+ interface GenerateImageResult {
6975
+ /**
6976
+ * The first image that was generated.
6977
+ */
6978
+ readonly image: GeneratedFile;
6979
+ /**
6980
+ * The images that were generated.
6981
+ */
6982
+ readonly images: Array<GeneratedFile>;
6983
+ /**
6984
+ * The results of the underlying image model calls.
6985
+ */
6986
+ readonly calls: Array<GenerateImageCall>;
6987
+ /**
6988
+ * Warnings for the call, e.g. unsupported settings.
6989
+ */
6990
+ readonly warnings: Array<Warning>;
6991
+ /**
6992
+ * Response metadata from the provider. There may be multiple responses if we made multiple calls to the model.
6993
+ *
6994
+ * @deprecated Use `calls` to preserve each response with its corresponding images, metadata, warnings, and usage.
6995
+ */
6996
+ readonly responses: Array<ImageModelResponseMetadata>;
6997
+ /**
6998
+ * Provider-specific metadata. They are passed through from the provider to the AI SDK and enable provider-specific
6999
+ * results that can be fully encapsulated in the provider.
7000
+ *
7001
+ * @deprecated Use the provider metadata in `calls` or on individual `images` to preserve its scope.
7002
+ */
7003
+ readonly providerMetadata: ImageModelProviderMetadata;
7004
+ /**
7005
+ * Combined token usage across all underlying provider calls for this image generation.
7006
+ */
7007
+ readonly usage: ImageModelUsage;
7008
+ }
7009
+
6842
7010
  declare const symbol$f: unique symbol;
6843
7011
  /**
6844
7012
  * Thrown when no image could be generated. This can have multiple causes:
@@ -6848,13 +7016,18 @@ declare const symbol$f: unique symbol;
6848
7016
  */
6849
7017
  declare class NoImageGeneratedError extends AISDKError {
6850
7018
  private readonly [symbol$f];
7019
+ /**
7020
+ * The results of the underlying image model calls.
7021
+ */
7022
+ readonly calls: Array<GenerateImageCall> | undefined;
6851
7023
  /**
6852
7024
  * The response metadata for each call.
6853
7025
  */
6854
7026
  readonly responses: Array<ImageModelResponseMetadata> | undefined;
6855
- constructor({ message, cause, responses, }: {
7027
+ constructor({ message, cause, calls, responses, }: {
6856
7028
  message?: string;
6857
7029
  cause?: Error;
7030
+ calls?: Array<GenerateImageCall>;
6858
7031
  responses?: Array<ImageModelResponseMetadata>;
6859
7032
  });
6860
7033
  static isInstance(error: unknown): error is NoImageGeneratedError;
@@ -7212,156 +7385,6 @@ declare class RetryError extends AISDKError {
7212
7385
  static isInstance(error: unknown): error is RetryError;
7213
7386
  }
7214
7387
 
7215
- type ActiveToolSubset<TOOLS extends ToolSet | undefined, ACTIVE_TOOL_NAMES extends ActiveTools<NonNullable<TOOLS>>> = TOOLS extends undefined ? undefined : [ACTIVE_TOOL_NAMES] extends [NonNullable<ActiveTools<NonNullable<TOOLS>>>] ? Pick<NonNullable<TOOLS>, ACTIVE_TOOL_NAMES[number]> : TOOLS;
7216
- /**
7217
- * Filters the tools to only include the active tools.
7218
- * When activeTools is provided, we only include the tools that are in the list.
7219
- *
7220
- * @param tools - The tools to filter.
7221
- * @param activeTools - The active tools to include.
7222
- * @returns The filtered tools.
7223
- */
7224
- declare function filterActiveTools<TOOLS extends ToolSet | undefined, ACTIVE_TOOL_NAMES extends ActiveTools<NonNullable<TOOLS>>>({ tools, activeTools, }: {
7225
- tools: TOOLS;
7226
- activeTools: ACTIVE_TOOL_NAMES;
7227
- }): ActiveToolSubset<TOOLS, ACTIVE_TOOL_NAMES>;
7228
-
7229
- /**
7230
- * Prunes model messages from a list of model messages.
7231
- *
7232
- * @param messages - The list of model messages to prune.
7233
- * @param reasoning - How to remove reasoning content from assistant messages. Default is `'none'`.
7234
- * @param toolCalls - How to prune tool call/results/approval content. Default is `[]`.
7235
- * @param emptyMessages - Whether to keep or remove messages whose content is empty after pruning. Default is `'remove'`.
7236
- *
7237
- * @returns The pruned list of model messages.
7238
- */
7239
- declare function pruneMessages({ messages, reasoning, toolCalls, emptyMessages, }: {
7240
- messages: ModelMessage[];
7241
- reasoning?: 'all' | 'before-last-message' | 'none';
7242
- toolCalls?: 'all' | 'before-last-message' | `before-last-${number}-messages` | 'none' | Array<{
7243
- type: 'all' | 'before-last-message' | `before-last-${number}-messages`;
7244
- tools?: string[];
7245
- }>;
7246
- emptyMessages?: 'keep' | 'remove';
7247
- }): ModelMessage[];
7248
-
7249
- /**
7250
- * Detects the first chunk in a buffer.
7251
- *
7252
- * @param buffer - The buffer to detect the first chunk in.
7253
- *
7254
- * @returns The first detected chunk, or `undefined` if no chunk was detected.
7255
- */
7256
- type ChunkDetector = (buffer: string) => string | undefined | null;
7257
- /**
7258
- * Smooths text and reasoning streaming output.
7259
- *
7260
- * @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay. The delay is skipped while the document is hidden (e.g. browser background tabs), where timer throttling would otherwise stall the stream.
7261
- * @param chunking - Controls how the text is chunked for streaming. Use "word" to stream word by word (default), "line" to stream line by line, provide a custom RegExp pattern that does not match the empty string for custom chunking, provide an Intl.Segmenter for locale-aware word segmentation (recommended for CJK languages), or provide a custom ChunkDetector function.
7262
- *
7263
- * @returns A transform stream that smooths text streaming output.
7264
- */
7265
- declare function smoothStream<TOOLS extends ToolSet>({ delayInMs, chunking, _internal: { delay }, }?: {
7266
- delayInMs?: number | null;
7267
- chunking?: 'word' | 'line' | RegExp | ChunkDetector | Intl.Segmenter;
7268
- /**
7269
- * Internal. For test use only. May change without notice.
7270
- */
7271
- _internal?: {
7272
- delay?: (delayInMs: number | null) => Promise<void>;
7273
- };
7274
- }): (options: {
7275
- tools: TOOLS;
7276
- }) => TransformStream<TextStreamPart<TOOLS>, TextStreamPart<TOOLS>>;
7277
-
7278
- /**
7279
- * Fingerprint the server-controlled, security-relevant fields of each tool in a
7280
- * `ToolSet`: `description` (string form only), the resolved input JSON schema,
7281
- * and `title`. Returns a map of tool name to a stable digest.
7282
- *
7283
- * Capture a baseline at trust time (first connect, human-reviewed) and compare
7284
- * later fetches with {@link detectToolDrift} to catch MCP tool-definition drift
7285
- * ("rug pull"). Baseline storage and the drift response are the app's concern.
7286
- */
7287
- declare function fingerprintTools(tools: ToolSet): Promise<Record<string, string>>;
7288
- /**
7289
- * Pure diff of two fingerprint maps produced by {@link fingerprintTools}.
7290
- * `added`/`removed` are tools present in only one map; `changed` are tools whose
7291
- * pinned definition differs. Uses own-property lookups so a tool literally named
7292
- * `constructor` or `toString` diffs correctly.
7293
- */
7294
- declare function detectToolDrift(current: Record<string, string>, baseline: Record<string, string>): {
7295
- added: string[];
7296
- removed: string[];
7297
- changed: string[];
7298
- };
7299
-
7300
- /**
7301
- * The result of one underlying image model call.
7302
- */
7303
- interface GenerateImageCall {
7304
- /**
7305
- * The images generated by this call.
7306
- */
7307
- readonly images: Array<GeneratedFile>;
7308
- /**
7309
- * Provider-specific metadata for this call.
7310
- */
7311
- readonly providerMetadata?: ImageModelV4ProviderMetadata;
7312
- /**
7313
- * Response metadata from the provider.
7314
- */
7315
- readonly response: ImageModelResponseMetadata;
7316
- /**
7317
- * Warnings for this call, e.g. unsupported settings.
7318
- */
7319
- readonly warnings: Array<Warning>;
7320
- /**
7321
- * Token usage for this call, if reported by the provider.
7322
- */
7323
- readonly usage?: ImageModelUsage;
7324
- }
7325
- /**
7326
- * The result of a `generateImage` call.
7327
- * It contains the images and additional information.
7328
- */
7329
- interface GenerateImageResult {
7330
- /**
7331
- * The first image that was generated.
7332
- */
7333
- readonly image: GeneratedFile;
7334
- /**
7335
- * The images that were generated.
7336
- */
7337
- readonly images: Array<GeneratedFile>;
7338
- /**
7339
- * The results of the underlying image model calls.
7340
- */
7341
- readonly calls: Array<GenerateImageCall>;
7342
- /**
7343
- * Warnings for the call, e.g. unsupported settings.
7344
- */
7345
- readonly warnings: Array<Warning>;
7346
- /**
7347
- * Response metadata from the provider. There may be multiple responses if we made multiple calls to the model.
7348
- *
7349
- * @deprecated Use `calls` to preserve each response with its corresponding images, metadata, warnings, and usage.
7350
- */
7351
- readonly responses: Array<ImageModelResponseMetadata>;
7352
- /**
7353
- * Provider-specific metadata. They are passed through from the provider to the AI SDK and enable provider-specific
7354
- * results that can be fully encapsulated in the provider.
7355
- *
7356
- * @deprecated Use the provider metadata in `calls` or on individual `images` to preserve its scope.
7357
- */
7358
- readonly providerMetadata: ImageModelProviderMetadata;
7359
- /**
7360
- * Combined token usage across all underlying provider calls for this image generation.
7361
- */
7362
- readonly usage: ImageModelUsage;
7363
- }
7364
-
7365
7388
  type GenerateImagePrompt = string | {
7366
7389
  images: Array<DataContent>;
7367
7390
  text?: string;
@@ -7379,7 +7402,7 @@ type GenerateImagePrompt = string | {
7379
7402
  * @param seed - Seed for the image generation.
7380
7403
  * @param providerOptions - Additional provider-specific options that are passed through to the provider
7381
7404
  * as body parameters.
7382
- * @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.
7383
7406
  * @param abortSignal - An optional abort signal that can be used to cancel the call.
7384
7407
  * @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
7385
7408
  *
@@ -7430,7 +7453,9 @@ declare function generateImage({ model: modelArg, prompt: promptArg, n, maxImage
7430
7453
  */
7431
7454
  providerOptions?: ProviderOptions;
7432
7455
  /**
7433
- * 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.
7434
7459
  *
7435
7460
  * @default 2
7436
7461
  */
@@ -9717,4 +9742,4 @@ declare function uploadSkill({ api, files, displayTitle, providerOptions, }: {
9717
9742
  files: UploadSkillFile[];
9718
9743
  }): Promise<UploadSkillResult>;
9719
9744
 
9720
- 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 };