ai 7.0.87 → 7.0.89

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.89
4
+
5
+ ### Patch Changes
6
+
7
+ - 5190b67: feat(provider): extend the FilesV4 interface with optional `getFileMetadata`, `downloadFile` (streaming), and `deleteFile` operations, plus `abortSignal`/`headers` call options and a `{ type: 'stream' }` upload data variant; upload results now expose `byteSize`, `createdAt`, and `expiresAt` (also surfaced by the core `uploadFile()` helper, which now forwards `abortSignal`/`headers`); add `postMultipartStreamToApi` (streaming multipart uploads with deterministic part ordering and failure-path stream teardown), `deleteFromApi`, and `createBinaryStreamResponseHandler` to provider-utils
8
+ - Updated dependencies [5190b67]
9
+ - @ai-sdk/provider@4.0.10
10
+ - @ai-sdk/provider-utils@5.0.35
11
+ - @ai-sdk/gateway@4.0.71
12
+
13
+ ## 7.0.88
14
+
15
+ ### Patch Changes
16
+
17
+ - 8b6b756: fix(ai): prevent generateText from accepting responses that violate required tool choices
18
+ - e07b577: feat: add tool calling support to batch
19
+
3
20
  ## 7.0.87
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, 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_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';
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';
@@ -3096,9 +3096,9 @@ type Experimental_ToolCallers<TOOLS extends ToolSet> = {
3096
3096
  [NAME in keyof TOOLS]?: ReadonlyArray<'AI_SDK_DIRECT_TOOL_CALL' | ToolCallerName<TOOLS>>;
3097
3097
  };
3098
3098
 
3099
- declare const symbol$m: unique symbol;
3099
+ declare const symbol$n: unique symbol;
3100
3100
  declare class InvalidToolInputError extends AISDKError {
3101
- private readonly [symbol$m];
3101
+ private readonly [symbol$n];
3102
3102
  readonly toolName: string;
3103
3103
  readonly toolInput: string;
3104
3104
  constructor({ toolInput, toolName, cause, message, }: {
@@ -3110,9 +3110,9 @@ declare class InvalidToolInputError extends AISDKError {
3110
3110
  static isInstance(error: unknown): error is InvalidToolInputError;
3111
3111
  }
3112
3112
 
3113
- declare const symbol$l: unique symbol;
3113
+ declare const symbol$m: unique symbol;
3114
3114
  declare class NoSuchToolError extends AISDKError {
3115
- private readonly [symbol$l];
3115
+ private readonly [symbol$m];
3116
3116
  readonly toolName: string;
3117
3117
  readonly availableTools: string[] | undefined;
3118
3118
  constructor({ toolName, availableTools, message, }: {
@@ -6229,9 +6229,29 @@ type BatchRequestOptions = {
6229
6229
  /**
6230
6230
  * Options for starting a text batch.
6231
6231
  */
6232
- type StartTextBatchOptions = {
6232
+ type StartTextBatchOptions<TOOLS extends ToolSet = ToolSet> = {
6233
6233
  model: BatchLanguageModel;
6234
6234
  requests: ReadonlyArray<TextBatchRequest>;
6235
+ /**
6236
+ * Tools that the model can call for every request in the batch.
6237
+ *
6238
+ * Tool definitions are sent to the provider, but their `execute` functions
6239
+ * are never invoked by batch processing.
6240
+ */
6241
+ tools?: TOOLS;
6242
+ /**
6243
+ * The tool choice strategy. Default: 'auto'.
6244
+ */
6245
+ toolChoice?: ToolChoice<NoInfer<TOOLS>>;
6246
+ /**
6247
+ * Controls the order in which tools are sent to the provider. Tools not
6248
+ * listed are appended alphabetically.
6249
+ */
6250
+ toolOrder?: ToolOrder<TOOLS>;
6251
+ /**
6252
+ * Context used when resolving dynamic tool descriptions.
6253
+ */
6254
+ toolsContext?: InferToolSetContext<TOOLS>;
6235
6255
  providerOptions?: ProviderOptions;
6236
6256
  /**
6237
6257
  * URL that the provider should notify when the batch reaches a terminal
@@ -6249,18 +6269,25 @@ type StartTextBatchResult = TextBatch & {
6249
6269
  /**
6250
6270
  * Options shared by batch status and result retrieval operations.
6251
6271
  */
6252
- type BatchOperationOptions = {
6272
+ type BatchOperationOptions<TOOLS extends ToolSet = ToolSet> = {
6253
6273
  model: BatchLanguageModel;
6254
6274
  batch: BatchReference;
6275
+ /**
6276
+ * Definitions for client tools that were provided to `startTextBatch`.
6277
+ *
6278
+ * The definitions are used only to validate and normalize returned tool
6279
+ * calls. Their `execute` functions are never invoked.
6280
+ */
6281
+ tools?: TOOLS;
6255
6282
  providerOptions?: ProviderOptions;
6256
6283
  maxRetries?: number;
6257
6284
  } & BatchRequestOptions;
6258
6285
  /**
6259
6286
  * A normalized result for a successful text batch item.
6260
6287
  */
6261
- type TextBatchGenerationResult = {
6288
+ type TextBatchGenerationResult<TOOLS extends ToolSet = ToolSet> = {
6262
6289
  /** Ordered normalized content, including citations, sources, and tool data. */
6263
- readonly content: Array<ContentPart<ToolSet>>;
6290
+ readonly content: Array<ContentPart<TOOLS>>;
6264
6291
  readonly text: string;
6265
6292
  readonly finishReason: FinishReason;
6266
6293
  readonly rawFinishReason?: string;
@@ -6275,7 +6302,7 @@ type TextBatchGenerationResult = {
6275
6302
  /**
6276
6303
  * A complete terminal result for one request in a text batch.
6277
6304
  */
6278
- type TextBatchItemResult = (TextBatchGenerationResult & {
6305
+ type TextBatchItemResult<TOOLS extends ToolSet = ToolSet> = (TextBatchGenerationResult<TOOLS> & {
6279
6306
  readonly id: string;
6280
6307
  readonly status: 'succeeded';
6281
6308
  }) | {
@@ -6293,15 +6320,15 @@ type TextBatchItemResult = (TextBatchGenerationResult & {
6293
6320
  /**
6294
6321
  * Starts a durable text-generation batch.
6295
6322
  */
6296
- declare function startTextBatch({ model: modelArg, requests, providerOptions, webhookUrl, abortSignal, headers, timeout, }: StartTextBatchOptions): Promise<StartTextBatchResult>;
6323
+ declare function startTextBatch<TOOLS extends ToolSet>({ model: modelArg, requests, tools, toolChoice, toolOrder, toolsContext, providerOptions, webhookUrl, abortSignal, headers, timeout, }: StartTextBatchOptions<TOOLS>): Promise<StartTextBatchResult>;
6297
6324
  /**
6298
6325
  * Retrieves the latest normalized status for a durable batch.
6299
6326
  */
6300
- declare function getBatchStatus({ model: modelArg, batch, providerOptions, maxRetries, abortSignal, headers, timeout, }: BatchOperationOptions): Promise<BatchStatus>;
6327
+ declare function getBatchStatus({ model: modelArg, batch, providerOptions, maxRetries, abortSignal, headers, timeout, }: Omit<BatchOperationOptions, 'tools'>): Promise<BatchStatus>;
6301
6328
  /**
6302
6329
  * Streams complete terminal results for the requests in a durable batch.
6303
6330
  */
6304
- declare function getBatchResults({ model: modelArg, batch, providerOptions, maxRetries, abortSignal, headers, timeout, }: BatchOperationOptions): AsyncIterableStream<TextBatchItemResult>;
6331
+ declare function getBatchResults<TOOLS extends ToolSet>({ model: modelArg, batch, tools, providerOptions, maxRetries, abortSignal, headers, timeout, }: BatchOperationOptions<TOOLS>): AsyncIterableStream<TextBatchItemResult<TOOLS>>;
6305
6332
 
6306
6333
  /**
6307
6334
  * The result of an `embed` call.
@@ -6576,9 +6603,9 @@ declare function embedMany({ model: modelArg, values, maxParallelCalls, maxRetri
6576
6603
  };
6577
6604
  }): Promise<EmbedManyResult>;
6578
6605
 
6579
- declare const symbol$k: unique symbol;
6606
+ declare const symbol$l: unique symbol;
6580
6607
  declare class InvalidArgumentError extends AISDKError {
6581
- private readonly [symbol$k];
6608
+ private readonly [symbol$l];
6582
6609
  readonly parameter: string;
6583
6610
  readonly value: unknown;
6584
6611
  constructor({ parameter, value, message, }: {
@@ -6723,9 +6750,9 @@ declare function streamLanguageModelCall<TOOLS extends ToolSet, OUTPUT extends O
6723
6750
  };
6724
6751
  }>;
6725
6752
 
6726
- declare const symbol$j: unique symbol;
6753
+ declare const symbol$k: unique symbol;
6727
6754
  declare class InvalidStreamPartError extends AISDKError {
6728
- private readonly [symbol$j];
6755
+ private readonly [symbol$k];
6729
6756
  readonly chunk: LanguageModelStreamPart<any>;
6730
6757
  constructor({ chunk, message, }: {
6731
6758
  chunk: LanguageModelStreamPart<any>;
@@ -6734,9 +6761,9 @@ declare class InvalidStreamPartError extends AISDKError {
6734
6761
  static isInstance(error: unknown): error is InvalidStreamPartError;
6735
6762
  }
6736
6763
 
6737
- declare const symbol$i: unique symbol;
6764
+ declare const symbol$j: unique symbol;
6738
6765
  declare class InvalidToolApprovalError extends AISDKError {
6739
- private readonly [symbol$i];
6766
+ private readonly [symbol$j];
6740
6767
  readonly approvalId: string;
6741
6768
  constructor({ approvalId }: {
6742
6769
  approvalId: string;
@@ -6744,9 +6771,9 @@ declare class InvalidToolApprovalError extends AISDKError {
6744
6771
  static isInstance(error: unknown): error is InvalidToolApprovalError;
6745
6772
  }
6746
6773
 
6747
- declare const symbol$h: unique symbol;
6774
+ declare const symbol$i: unique symbol;
6748
6775
  declare class InvalidToolApprovalSignatureError extends AISDKError {
6749
- private readonly [symbol$h];
6776
+ private readonly [symbol$i];
6750
6777
  readonly approvalId: string;
6751
6778
  readonly toolCallId: string;
6752
6779
  constructor({ approvalId, toolCallId, reason, }: {
@@ -6757,9 +6784,9 @@ declare class InvalidToolApprovalSignatureError extends AISDKError {
6757
6784
  static isInstance(error: unknown): error is InvalidToolApprovalSignatureError;
6758
6785
  }
6759
6786
 
6760
- declare const symbol$g: unique symbol;
6787
+ declare const symbol$h: unique symbol;
6761
6788
  declare class ToolCallNotFoundForApprovalError extends AISDKError {
6762
- private readonly [symbol$g];
6789
+ private readonly [symbol$h];
6763
6790
  readonly toolCallId: string;
6764
6791
  readonly approvalId: string;
6765
6792
  constructor({ toolCallId, approvalId, }: {
@@ -6769,9 +6796,9 @@ declare class ToolCallNotFoundForApprovalError extends AISDKError {
6769
6796
  static isInstance(error: unknown): error is ToolCallNotFoundForApprovalError;
6770
6797
  }
6771
6798
 
6772
- declare const symbol$f: unique symbol;
6799
+ declare const symbol$g: unique symbol;
6773
6800
  declare class MissingToolResultsError extends AISDKError {
6774
- private readonly [symbol$f];
6801
+ private readonly [symbol$g];
6775
6802
  readonly toolCallIds: string[];
6776
6803
  constructor({ toolCallIds }: {
6777
6804
  toolCallIds: string[];
@@ -6779,7 +6806,7 @@ declare class MissingToolResultsError extends AISDKError {
6779
6806
  static isInstance(error: unknown): error is MissingToolResultsError;
6780
6807
  }
6781
6808
 
6782
- declare const symbol$e: unique symbol;
6809
+ declare const symbol$f: unique symbol;
6783
6810
  /**
6784
6811
  * Thrown when no image could be generated. This can have multiple causes:
6785
6812
  *
@@ -6787,7 +6814,7 @@ declare const symbol$e: unique symbol;
6787
6814
  * - The model generated a response that could not be parsed.
6788
6815
  */
6789
6816
  declare class NoImageGeneratedError extends AISDKError {
6790
- private readonly [symbol$e];
6817
+ private readonly [symbol$f];
6791
6818
  /**
6792
6819
  * The response metadata for each call.
6793
6820
  */
@@ -6800,7 +6827,7 @@ declare class NoImageGeneratedError extends AISDKError {
6800
6827
  static isInstance(error: unknown): error is NoImageGeneratedError;
6801
6828
  }
6802
6829
 
6803
- declare const symbol$d: unique symbol;
6830
+ declare const symbol$e: unique symbol;
6804
6831
  /**
6805
6832
  * Thrown when no object could be generated. This can have several causes:
6806
6833
  *
@@ -6813,7 +6840,7 @@ declare const symbol$d: unique symbol;
6813
6840
  * - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
6814
6841
  */
6815
6842
  declare class NoObjectGeneratedError extends AISDKError {
6816
- private readonly [symbol$d];
6843
+ private readonly [symbol$e];
6817
6844
  /**
6818
6845
  * The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
6819
6846
  */
@@ -6841,12 +6868,12 @@ declare class NoObjectGeneratedError extends AISDKError {
6841
6868
  static isInstance(error: unknown): error is NoObjectGeneratedError;
6842
6869
  }
6843
6870
 
6844
- declare const symbol$c: unique symbol;
6871
+ declare const symbol$d: unique symbol;
6845
6872
  /**
6846
6873
  * Thrown when no LLM output was generated, e.g. because of errors.
6847
6874
  */
6848
6875
  declare class NoOutputGeneratedError extends AISDKError {
6849
- private readonly [symbol$c];
6876
+ private readonly [symbol$d];
6850
6877
  constructor({ message, cause, }?: {
6851
6878
  message?: string;
6852
6879
  cause?: Error;
@@ -6854,12 +6881,12 @@ declare class NoOutputGeneratedError extends AISDKError {
6854
6881
  static isInstance(error: unknown): error is NoOutputGeneratedError;
6855
6882
  }
6856
6883
 
6857
- declare const symbol$b: unique symbol;
6884
+ declare const symbol$c: unique symbol;
6858
6885
  /**
6859
6886
  * Error that is thrown when no speech audio was generated.
6860
6887
  */
6861
6888
  declare class NoSpeechGeneratedError extends AISDKError {
6862
- private readonly [symbol$b];
6889
+ private readonly [symbol$c];
6863
6890
  readonly responses: Array<SpeechModelResponseMetadata>;
6864
6891
  constructor(options: {
6865
6892
  responses: Array<SpeechModelResponseMetadata>;
@@ -6867,12 +6894,12 @@ declare class NoSpeechGeneratedError extends AISDKError {
6867
6894
  static isInstance(error: unknown): error is NoSpeechGeneratedError;
6868
6895
  }
6869
6896
 
6870
- declare const symbol$a: unique symbol;
6897
+ declare const symbol$b: unique symbol;
6871
6898
  /**
6872
6899
  * Error that is thrown when no transcript was generated.
6873
6900
  */
6874
6901
  declare class NoTranscriptGeneratedError extends AISDKError {
6875
- private readonly [symbol$a];
6902
+ private readonly [symbol$b];
6876
6903
  readonly responses: Array<TranscriptionModelResponseMetadata>;
6877
6904
  constructor(options: {
6878
6905
  responses: Array<TranscriptionModelResponseMetadata>;
@@ -6901,12 +6928,12 @@ type SpeechTranslationModelResponseMetadata = {
6901
6928
  headers?: Record<string, string>;
6902
6929
  };
6903
6930
 
6904
- declare const symbol$9: unique symbol;
6931
+ declare const symbol$a: unique symbol;
6905
6932
  /**
6906
6933
  * Error that is thrown when no translation was generated.
6907
6934
  */
6908
6935
  declare class NoTranslationGeneratedError extends AISDKError {
6909
- private readonly [symbol$9];
6936
+ private readonly [symbol$a];
6910
6937
  readonly response: SpeechTranslationModelResponseMetadata;
6911
6938
  constructor(options: {
6912
6939
  response: SpeechTranslationModelResponseMetadata;
@@ -6938,9 +6965,9 @@ type VideoModelResponseMetadata = {
6938
6965
  providerMetadata?: SharedV4ProviderMetadata;
6939
6966
  };
6940
6967
 
6941
- declare const symbol$8: unique symbol;
6968
+ declare const symbol$9: unique symbol;
6942
6969
  declare class NoVideoGeneratedError extends AISDKError {
6943
- private readonly [symbol$8];
6970
+ private readonly [symbol$9];
6944
6971
  readonly responses: Array<VideoModelResponseMetadata>;
6945
6972
  constructor({ message, cause, responses, }: {
6946
6973
  message?: string;
@@ -6964,12 +6991,12 @@ declare class NoVideoGeneratedError extends AISDKError {
6964
6991
  };
6965
6992
  }
6966
6993
 
6967
- declare const symbol$7: unique symbol;
6994
+ declare const symbol$8: unique symbol;
6968
6995
  /**
6969
6996
  * Error reported by a provider after a model response stream has started.
6970
6997
  */
6971
6998
  declare class StreamProviderError extends AISDKError {
6972
- private readonly [symbol$7];
6999
+ private readonly [symbol$8];
6973
7000
  /**
6974
7001
  * Provider-defined error type, when supplied by the provider.
6975
7002
  */
@@ -7003,9 +7030,9 @@ declare class StreamProviderError extends AISDKError {
7003
7030
  static isInstance(error: unknown): error is StreamProviderError;
7004
7031
  }
7005
7032
 
7006
- declare const symbol$6: unique symbol;
7033
+ declare const symbol$7: unique symbol;
7007
7034
  declare class ToolCallRepairError extends AISDKError {
7008
- private readonly [symbol$6];
7035
+ private readonly [symbol$7];
7009
7036
  readonly originalError: NoSuchToolError | InvalidToolInputError;
7010
7037
  constructor({ cause, originalError, message, }: {
7011
7038
  message?: string;
@@ -7015,6 +7042,51 @@ declare class ToolCallRepairError extends AISDKError {
7015
7042
  static isInstance(error: unknown): error is ToolCallRepairError;
7016
7043
  }
7017
7044
 
7045
+ declare const symbol$6: unique symbol;
7046
+ type EnforcedToolChoice = Extract<LanguageModelV4ToolChoice, {
7047
+ type: 'required';
7048
+ } | {
7049
+ type: 'tool';
7050
+ }>;
7051
+ /**
7052
+ * Thrown when a model response does not satisfy an enforced tool choice.
7053
+ */
7054
+ declare class ToolChoiceViolationError extends AISDKError {
7055
+ private readonly [symbol$6];
7056
+ /**
7057
+ * The tool choice that the model response did not satisfy.
7058
+ */
7059
+ readonly toolChoice: EnforcedToolChoice;
7060
+ /**
7061
+ * Reason why the model finished generating the response.
7062
+ */
7063
+ readonly finishReason: FinishReason;
7064
+ /**
7065
+ * The provider that returned the response.
7066
+ */
7067
+ readonly provider: string;
7068
+ /**
7069
+ * The model that returned the response.
7070
+ */
7071
+ readonly modelId: string;
7072
+ /**
7073
+ * The normalized content returned by the model.
7074
+ *
7075
+ * This can be inspected to recover a tool call that the provider returned as
7076
+ * text or reasoning instead of a structured tool call.
7077
+ */
7078
+ readonly content: Array<LanguageModelV4Content>;
7079
+ constructor({ toolChoice, finishReason, provider, modelId, content, message, }: {
7080
+ toolChoice: EnforcedToolChoice;
7081
+ finishReason: FinishReason;
7082
+ provider: string;
7083
+ modelId: string;
7084
+ content: Array<LanguageModelV4Content>;
7085
+ message?: string;
7086
+ });
7087
+ static isInstance(error: unknown): error is ToolChoiceViolationError;
7088
+ }
7089
+
7018
7090
  /**
7019
7091
  * Error that is thrown when a model with an unsupported version is used.
7020
7092
  */
@@ -9537,6 +9609,18 @@ interface UploadFileResult {
9537
9609
  readonly providerReference: ProviderReference;
9538
9610
  readonly mediaType?: string;
9539
9611
  readonly filename?: string;
9612
+ /**
9613
+ * The size of the uploaded file in bytes, if reported by the provider.
9614
+ */
9615
+ readonly byteSize?: number;
9616
+ /**
9617
+ * When the file was created, if reported by the provider.
9618
+ */
9619
+ readonly createdAt?: Date;
9620
+ /**
9621
+ * When the provider will delete the file (retention expiry), if reported.
9622
+ */
9623
+ readonly expiresAt?: Date;
9540
9624
  readonly providerMetadata?: ProviderMetadata;
9541
9625
  readonly warnings: Array<Warning>;
9542
9626
  }
@@ -9545,15 +9629,25 @@ interface UploadFileResult {
9545
9629
  * Uploads a file using a files API interface.
9546
9630
  *
9547
9631
  * @param api - The Files API interface to use for uploading.
9548
- * @param data - The file data to upload (tagged `{ type: 'data' | 'text' }`).
9632
+ * @param data - The file data to upload (tagged `{ type: 'data' | 'text' | 'stream' }`).
9633
+ * Stream data is sent without buffering by providers that support streaming
9634
+ * uploads (others reject with `UnsupportedFunctionalityError`); the provider
9635
+ * consumes the stream — any failed upload, including validation failures
9636
+ * before a request is made, cancels it. Do not reuse it.
9549
9637
  * @param mediaType - Optional IANA media type. Auto-detected from file bytes
9550
- * when omitted (falls back to `text/plain` for the `text` variant).
9551
- * @param filename - Optional filename for the uploaded file.
9638
+ * when omitted (falls back to `text/plain` for the `text` variant and
9639
+ * `application/octet-stream` for the `stream` variant, which cannot be sniffed).
9640
+ * @param filename - Optional filename for the uploaded file. Multipart-based
9641
+ * providers default it to `"blob"` when omitted.
9642
+ * @param abortSignal - Optional signal to cancel the upload.
9643
+ * @param headers - Optional additional HTTP headers for the request.
9552
9644
  * @param providerOptions - Additional provider-specific options.
9553
9645
  *
9554
- * @returns A result object containing the provider reference and optional metadata.
9646
+ * @returns A result object containing the provider reference, optional
9647
+ * metadata, and — when reported by the provider — `byteSize`, `createdAt`,
9648
+ * and `expiresAt` (the provider-applied retention expiry).
9555
9649
  */
9556
- declare function uploadFile({ api, data: dataArg, mediaType: mediaTypeArg, filename, providerOptions, }: {
9650
+ declare function uploadFile({ api, data: dataArg, mediaType: mediaTypeArg, filename, abortSignal, headers, providerOptions, }: {
9557
9651
  /**
9558
9652
  * The files API interface to use for uploading.
9559
9653
  * Can be a `FilesV4` instance or a `ProviderV4` instance with a `files()` method.
@@ -9590,4 +9684,4 @@ declare function uploadSkill({ api, files, displayTitle, providerOptions, }: {
9590
9684
  files: UploadSkillFile[];
9591
9685
  }): Promise<UploadSkillResult>;
9592
9686
 
9593
- 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 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, 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 };
9687
+ 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 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 };