ai 7.0.79 → 7.0.83

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 (59) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/index.d.ts +139 -53
  3. package/dist/index.js +872 -496
  4. package/dist/index.js.map +1 -1
  5. package/dist/internal/index.d.ts +9 -1
  6. package/dist/internal/index.js +4 -2
  7. package/dist/internal/index.js.map +1 -1
  8. package/dist/test/index.d.ts +4 -1
  9. package/dist/test/index.js +4 -0
  10. package/dist/test/index.js.map +1 -1
  11. package/docs/03-agents/06-policy-tool-approvals.mdx +1 -1
  12. package/docs/03-agents/06-tool-approvals.mdx +6 -0
  13. package/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +6 -4
  14. package/docs/03-ai-sdk-core/50-error-handling.mdx +17 -2
  15. package/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +6 -0
  16. package/docs/04-ai-sdk-ui/50-stream-protocol.mdx +2 -2
  17. package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +1 -1
  18. package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +8 -7
  19. package/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +6 -2
  20. package/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +1 -1
  21. package/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +2 -2
  22. package/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +35 -6
  23. package/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +157 -0
  24. package/docs/07-reference/04-ai-sdk-workflow/index.mdx +6 -0
  25. package/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +52 -0
  26. package/docs/07-reference/05-ai-sdk-errors/index.mdx +1 -0
  27. package/package.json +14 -3
  28. package/src/agent/create-agent-ui-stream.ts +2 -2
  29. package/src/embed/embed-many.ts +78 -8
  30. package/src/error/index.ts +1 -0
  31. package/src/error/stream-provider-error.ts +78 -0
  32. package/src/generate-text/execute-tools-from-stream.ts +3 -0
  33. package/src/generate-text/generate-text-result.ts +2 -1
  34. package/src/generate-text/generate-text.ts +6 -3
  35. package/src/generate-text/stream-language-model-call.ts +8 -0
  36. package/src/generate-text/to-response-messages.ts +1 -0
  37. package/src/generate-text/tool-approval-configuration.ts +5 -1
  38. package/src/generate-text/tool-approval-request-output.ts +5 -0
  39. package/src/middleware/wrap-embedding-model.ts +11 -2
  40. package/src/model/get-embedding-model-max-input-bytes-per-call.ts +15 -0
  41. package/src/prompt/content-part.ts +1 -0
  42. package/src/prompt/normalize-stream-provider-error.ts +131 -0
  43. package/src/test/mock-embedding-model-v4.ts +9 -0
  44. package/src/ui/convert-to-model-messages.ts +3 -0
  45. package/src/ui/direct-chat-transport.ts +2 -2
  46. package/src/ui/last-assistant-message-is-complete-with-approval-responses.ts +1 -0
  47. package/src/ui/process-ui-message-stream.ts +6 -0
  48. package/src/ui/ui-messages.ts +10 -0
  49. package/src/ui/validate-ui-messages.ts +146 -55
  50. package/src/ui-message-stream/create-ui-message-stream.ts +47 -17
  51. package/src/ui-message-stream/handle-ui-message-stream-finish.ts +51 -14
  52. package/src/ui-message-stream/index.ts +5 -1
  53. package/src/ui-message-stream/to-ui-message-chunk.ts +1 -0
  54. package/src/ui-message-stream/to-ui-message-stream.ts +108 -26
  55. package/src/ui-message-stream/ui-message-chunks.ts +2 -0
  56. package/src/ui-message-stream/ui-message-stream-on-end-callback.ts +7 -0
  57. package/src/ui-message-stream/ui-message-stream-outcome.ts +12 -0
  58. package/src/ui-message-stream/ui-message-stream-writer.ts +15 -0
  59. package/src/util/create-stitchable-stream.ts +31 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.83
4
+
5
+ ### Patch Changes
6
+
7
+ - 8dd86a9: Validate persisted typed tool calls against current input and output schemas.
8
+ Schema-incompatible empty or error inputs and terminal history from unavailable
9
+ tools remain loadable as dynamic tool parts instead of exposing unvalidated
10
+ values under current static tool types.
11
+ - fda13b3: Allow chats to continue automatically after tool approval denials reach the `output-denied` state.
12
+ - 957146c: add operation-level outcomes to UI message stream end callbacks
13
+ - ce6849a: fix(ai): handle stitchable stream cancellation before an inner stream is registered
14
+
15
+ ## 7.0.82
16
+
17
+ ### Patch Changes
18
+
19
+ - 3e125ba: Allow manual tool approval statuses to include a reason and preserve it across
20
+ core, model, and UI approval requests. OPA `requires-approval` decisions now
21
+ surface their reason to human approvers. UI request chunks serialize the
22
+ optional `reason`, while UI messages retain it as `approval.requestReason`
23
+ separately from an approver's response `reason`.
24
+ - Updated dependencies [0e7994c]
25
+ - Updated dependencies [3e125ba]
26
+ - @ai-sdk/gateway@4.0.67
27
+ - @ai-sdk/provider-utils@5.0.32
28
+
29
+ ## 7.0.81
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [81bebaf]
34
+ - @ai-sdk/gateway@4.0.66
35
+
36
+ ## 7.0.80
37
+
38
+ ### Patch Changes
39
+
40
+ - 35841f5: feat: normalize mid-stream provider error events across supported providers into public StreamProviderError instances and preserve provider-owned type, code, status, retry, and raw payload metadata
41
+ - d2f3353: Split OpenAI and Azure OpenAI embedding requests by a conservative UTF-8 byte budget derived from their aggregate token limit, in addition to input count limits.
42
+ - eed7950: Expose structured output parsing diagnostics from `generateText` when generation stops because of the output token limit.
43
+ - Updated dependencies [80227cf]
44
+ - Updated dependencies [a9782e1]
45
+ - Updated dependencies [5533946]
46
+ - Updated dependencies [35841f5]
47
+ - Updated dependencies [d2f3353]
48
+ - @ai-sdk/gateway@4.0.65
49
+ - @ai-sdk/provider-utils@5.0.31
50
+
3
51
  ## 7.0.79
4
52
 
5
53
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1179,6 +1179,10 @@ type ToolApprovalRequestOutput<TOOLS extends ToolSet> = {
1179
1179
  * Tool call that the approval request is for.
1180
1180
  */
1181
1181
  toolCall: TypedToolCall<TOOLS>;
1182
+ /**
1183
+ * Reason why the tool call requires approval.
1184
+ */
1185
+ reason?: string;
1182
1186
  /**
1183
1187
  * Flag indicating whether the tool was automatically approved or denied.
1184
1188
  *
@@ -2032,6 +2036,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
2032
2036
  approval: {
2033
2037
  id: string;
2034
2038
  approved?: never;
2039
+ requestReason?: string;
2035
2040
  reason?: never;
2036
2041
  isAutomatic?: boolean;
2037
2042
  signature?: string;
@@ -2045,6 +2050,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
2045
2050
  approval: {
2046
2051
  id: string;
2047
2052
  approved: boolean;
2053
+ requestReason?: string;
2048
2054
  reason?: string;
2049
2055
  isAutomatic?: boolean;
2050
2056
  signature?: string;
@@ -2060,6 +2066,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
2060
2066
  approval?: {
2061
2067
  id: string;
2062
2068
  approved: true;
2069
+ requestReason?: string;
2063
2070
  reason?: string;
2064
2071
  isAutomatic?: boolean;
2065
2072
  signature?: string;
@@ -2075,6 +2082,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
2075
2082
  approval?: {
2076
2083
  id: string;
2077
2084
  approved: true;
2085
+ requestReason?: string;
2078
2086
  reason?: string;
2079
2087
  isAutomatic?: boolean;
2080
2088
  signature?: string;
@@ -2088,6 +2096,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
2088
2096
  approval: {
2089
2097
  id: string;
2090
2098
  approved: false;
2099
+ requestReason?: string;
2091
2100
  reason?: string;
2092
2101
  isAutomatic?: boolean;
2093
2102
  signature?: string;
@@ -2137,6 +2146,7 @@ type DynamicToolUIPart = {
2137
2146
  approval: {
2138
2147
  id: string;
2139
2148
  approved?: never;
2149
+ requestReason?: string;
2140
2150
  reason?: never;
2141
2151
  isAutomatic?: boolean;
2142
2152
  signature?: string;
@@ -2150,6 +2160,7 @@ type DynamicToolUIPart = {
2150
2160
  approval: {
2151
2161
  id: string;
2152
2162
  approved: boolean;
2163
+ requestReason?: string;
2153
2164
  reason?: string;
2154
2165
  isAutomatic?: boolean;
2155
2166
  signature?: string;
@@ -2165,6 +2176,7 @@ type DynamicToolUIPart = {
2165
2176
  approval?: {
2166
2177
  id: string;
2167
2178
  approved: true;
2179
+ requestReason?: string;
2168
2180
  reason?: string;
2169
2181
  isAutomatic?: boolean;
2170
2182
  signature?: string;
@@ -2179,6 +2191,7 @@ type DynamicToolUIPart = {
2179
2191
  approval?: {
2180
2192
  id: string;
2181
2193
  approved: true;
2194
+ requestReason?: string;
2182
2195
  reason?: string;
2183
2196
  isAutomatic?: boolean;
2184
2197
  signature?: string;
@@ -2192,6 +2205,7 @@ type DynamicToolUIPart = {
2192
2205
  approval: {
2193
2206
  id: string;
2194
2207
  approved: false;
2208
+ requestReason?: string;
2195
2209
  reason?: string;
2196
2210
  isAutomatic?: boolean;
2197
2211
  signature?: string;
@@ -2334,6 +2348,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
2334
2348
  type: 'tool-approval-request';
2335
2349
  approvalId: string;
2336
2350
  toolCallId: string;
2351
+ reason?: string;
2337
2352
  isAutomatic?: boolean;
2338
2353
  signature?: string;
2339
2354
  } | {
@@ -2425,6 +2440,24 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
2425
2440
  };
2426
2441
  type InferUIMessageChunk<T extends UIMessage> = UIMessageChunk<InferUIMessageMetadata<T>, InferUIMessageData<T>>;
2427
2442
 
2443
+ /**
2444
+ * The operation-level outcome of a UI message stream.
2445
+ *
2446
+ * This is separate from model finish reasons and individual stream chunks.
2447
+ * Fatal stream-processing failures override outcomes declared by the stream
2448
+ * owner.
2449
+ */
2450
+ type UIMessageStreamOutcome = {
2451
+ status: 'completed';
2452
+ } | {
2453
+ status: 'failed';
2454
+ error?: unknown;
2455
+ } | {
2456
+ status: 'aborted';
2457
+ } | {
2458
+ status: 'unknown';
2459
+ };
2460
+
2428
2461
  type UIMessageStreamOnEndCallback<UI_MESSAGE extends UIMessage> = (event: {
2429
2462
  /**
2430
2463
  * The updated list of UI messages.
@@ -2439,6 +2472,11 @@ type UIMessageStreamOnEndCallback<UI_MESSAGE extends UIMessage> = (event: {
2439
2472
  * Indicates whether the stream was aborted.
2440
2473
  */
2441
2474
  isAborted: boolean;
2475
+ /**
2476
+ * The operation-level outcome of the stream. Fatal stream-processing
2477
+ * failures override outcomes declared by the stream owner.
2478
+ */
2479
+ outcome: UIMessageStreamOutcome;
2442
2480
  /**
2443
2481
  * The message that was sent to the client as a response
2444
2482
  * (including the original message if it was extended).
@@ -2956,6 +2994,8 @@ type TextStreamPart<TOOLS extends ToolSet> = TextStreamTextStartPart | TextStrea
2956
2994
  * - 'user-approval': The tool requires user approval.
2957
2995
  *
2958
2996
  * In addition to the string statuses, you can also use object statuses with a reason property.
2997
+ * For approved and denied statuses, the reason is emitted on the approval response.
2998
+ * For user-approval statuses, the reason is emitted on the approval request so it can be shown to the approver.
2959
2999
  *
2960
3000
  * `undefined` is treated as the `not-applicable` status.
2961
3001
  */
@@ -2970,7 +3010,7 @@ type ToolApprovalStatus = undefined | 'not-applicable' | 'approved' | 'denied' |
2970
3010
  reason?: string;
2971
3011
  } | {
2972
3012
  type: 'user-approval';
2973
- reason?: never;
3013
+ reason?: string;
2974
3014
  };
2975
3015
  /**
2976
3016
  * Function that is called to determine if the tool needs approval before it can be executed.
@@ -3025,6 +3065,8 @@ type GenericToolApprovalFunction<TOOLS extends ToolSet, TOOLS_CONTEXT extends In
3025
3065
  * - 'user-approval': The tool requires user approval.
3026
3066
  *
3027
3067
  * In addition to the string statuses, you can also use object statuses with a reason property.
3068
+ * For approved and denied statuses, the reason is emitted on the approval response.
3069
+ * For user-approval statuses, the reason is emitted on the approval request so it can be shown to the approver.
3028
3070
  */
3029
3071
  type ToolApprovalConfiguration<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context | unknown | never> = GenericToolApprovalFunction<TOOLS, InferToolSetContext<TOOLS>, RUNTIME_CONTEXT> | {
3030
3072
  [key in keyof TOOLS]?: ToolApprovalStatus | SingleToolApprovalFunction<InferToolInput<TOOLS[key]>, InferToolContext<TOOLS[key]>, RUNTIME_CONTEXT>;
@@ -3037,9 +3079,9 @@ type Experimental_ToolCallers<TOOLS extends ToolSet> = {
3037
3079
  [NAME in keyof TOOLS]?: ReadonlyArray<'AI_SDK_DIRECT_TOOL_CALL' | ToolCallerName<TOOLS>>;
3038
3080
  };
3039
3081
 
3040
- declare const symbol$l: unique symbol;
3082
+ declare const symbol$m: unique symbol;
3041
3083
  declare class InvalidToolInputError extends AISDKError {
3042
- private readonly [symbol$l];
3084
+ private readonly [symbol$m];
3043
3085
  readonly toolName: string;
3044
3086
  readonly toolInput: string;
3045
3087
  constructor({ toolInput, toolName, cause, message, }: {
@@ -3051,9 +3093,9 @@ declare class InvalidToolInputError extends AISDKError {
3051
3093
  static isInstance(error: unknown): error is InvalidToolInputError;
3052
3094
  }
3053
3095
 
3054
- declare const symbol$k: unique symbol;
3096
+ declare const symbol$l: unique symbol;
3055
3097
  declare class NoSuchToolError extends AISDKError {
3056
- private readonly [symbol$k];
3098
+ private readonly [symbol$l];
3057
3099
  readonly toolName: string;
3058
3100
  readonly availableTools: string[] | undefined;
3059
3101
  constructor({ toolName, availableTools, message, }: {
@@ -4477,7 +4519,8 @@ interface GenerateTextResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Cont
4477
4519
  * The generated output according to the `output` specification.
4478
4520
  *
4479
4521
  * @throws {NoOutputGeneratedError} When no output is available, for example
4480
- * when the final step does not finish with a `stop` reason.
4522
+ * when the final step finishes with a `tool-calls` reason, or when it
4523
+ * contains no text and does not finish with a `stop` reason.
4481
4524
  */
4482
4525
  readonly output: InferCompleteOutput<OUTPUT>;
4483
4526
  }
@@ -5849,12 +5892,7 @@ type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
5849
5892
  success: false;
5850
5893
  error: Error;
5851
5894
  };
5852
- /**
5853
- * Validates a list of UI messages like `validateUIMessages`,
5854
- * but instead of throwing it returns `{ success: true, data }`
5855
- * or `{ success: false, error }`.
5856
- */
5857
- declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
5895
+ type ValidateUIMessagesOptions<UI_MESSAGE extends UIMessage> = {
5858
5896
  messages: unknown;
5859
5897
  metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
5860
5898
  dataSchemas?: {
@@ -5863,7 +5901,13 @@ declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages
5863
5901
  tools?: {
5864
5902
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
5865
5903
  };
5866
- }): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
5904
+ };
5905
+ /**
5906
+ * Validates a list of UI messages like `validateUIMessages`,
5907
+ * but instead of throwing it returns `{ success: true, data }`
5908
+ * or `{ success: false, error }`.
5909
+ */
5910
+ declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
5867
5911
  /**
5868
5912
  * Validates a list of UI messages.
5869
5913
  *
@@ -5871,16 +5915,7 @@ declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages
5871
5915
  * the corresponding schemas are provided. Otherwise, they are assumed to be
5872
5916
  * valid.
5873
5917
  */
5874
- declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
5875
- messages: unknown;
5876
- metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
5877
- dataSchemas?: {
5878
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
5879
- };
5880
- tools?: {
5881
- [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
5882
- };
5883
- }): Promise<Array<UI_MESSAGE>>;
5918
+ declare function validateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<Array<UI_MESSAGE>>;
5884
5919
 
5885
5920
  interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UIMessage> {
5886
5921
  /**
@@ -5898,6 +5933,17 @@ interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UIMessage> {
5898
5933
  */
5899
5934
  onError: ErrorHandler | undefined;
5900
5935
  }
5936
+ interface UIMessageStreamWriterWithOutcome<UI_MESSAGE extends UIMessage = UIMessage> extends UIMessageStreamWriter<UI_MESSAGE> {
5937
+ /**
5938
+ * Declares the operation-level outcome of the composed stream.
5939
+ *
5940
+ * The first outcome declared through this method is retained. Fatal
5941
+ * execution, merge, error-handling, or downstream processing failures
5942
+ * override declared outcomes. Declaring an outcome does not write a chunk or
5943
+ * close the stream.
5944
+ */
5945
+ setOutcome(outcome: UIMessageStreamOutcome): void;
5946
+ }
5901
5947
 
5902
5948
  /**
5903
5949
  * Creates a UI message stream that can be used to send messages to the client.
@@ -5917,7 +5963,7 @@ interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UIMessage> {
5917
5963
  declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ execute, onError, // prevent leaking server error details to the client by default
5918
5964
  originalMessages, onStepEnd, onStepFinish, onEnd, onFinish, generateId, }: {
5919
5965
  execute: (options: {
5920
- writer: UIMessageStreamWriter<UI_MESSAGE>;
5966
+ writer: UIMessageStreamWriterWithOutcome<UI_MESSAGE>;
5921
5967
  }) => Promise<void> | void;
5922
5968
  onError?: (error: unknown) => string;
5923
5969
  /**
@@ -6405,8 +6451,9 @@ interface EmbedManyResult {
6405
6451
  * Embed several values using an embedding model. The type of the value is defined
6406
6452
  * by the embedding model.
6407
6453
  *
6408
- * `embedMany` automatically splits large requests into smaller chunks if the model
6409
- * has a limit on how many embeddings can be generated in a single call.
6454
+ * `embedMany` automatically splits large requests into smaller chunks when the
6455
+ * model has a limit on either the number of embeddings or the UTF-8 input bytes
6456
+ * that can be processed in a single call.
6410
6457
  *
6411
6458
  * @param model - The embedding model to use.
6412
6459
  * @param values - The values that should be embedded.
@@ -6503,9 +6550,9 @@ declare function embedMany({ model: modelArg, values, maxParallelCalls, maxRetri
6503
6550
  };
6504
6551
  }): Promise<EmbedManyResult>;
6505
6552
 
6506
- declare const symbol$j: unique symbol;
6553
+ declare const symbol$k: unique symbol;
6507
6554
  declare class InvalidArgumentError extends AISDKError {
6508
- private readonly [symbol$j];
6555
+ private readonly [symbol$k];
6509
6556
  readonly parameter: string;
6510
6557
  readonly value: unknown;
6511
6558
  constructor({ parameter, value, message, }: {
@@ -6650,9 +6697,9 @@ declare function streamLanguageModelCall<TOOLS extends ToolSet, OUTPUT extends O
6650
6697
  };
6651
6698
  }>;
6652
6699
 
6653
- declare const symbol$i: unique symbol;
6700
+ declare const symbol$j: unique symbol;
6654
6701
  declare class InvalidStreamPartError extends AISDKError {
6655
- private readonly [symbol$i];
6702
+ private readonly [symbol$j];
6656
6703
  readonly chunk: LanguageModelStreamPart<any>;
6657
6704
  constructor({ chunk, message, }: {
6658
6705
  chunk: LanguageModelStreamPart<any>;
@@ -6661,9 +6708,9 @@ declare class InvalidStreamPartError extends AISDKError {
6661
6708
  static isInstance(error: unknown): error is InvalidStreamPartError;
6662
6709
  }
6663
6710
 
6664
- declare const symbol$h: unique symbol;
6711
+ declare const symbol$i: unique symbol;
6665
6712
  declare class InvalidToolApprovalError extends AISDKError {
6666
- private readonly [symbol$h];
6713
+ private readonly [symbol$i];
6667
6714
  readonly approvalId: string;
6668
6715
  constructor({ approvalId }: {
6669
6716
  approvalId: string;
@@ -6671,9 +6718,9 @@ declare class InvalidToolApprovalError extends AISDKError {
6671
6718
  static isInstance(error: unknown): error is InvalidToolApprovalError;
6672
6719
  }
6673
6720
 
6674
- declare const symbol$g: unique symbol;
6721
+ declare const symbol$h: unique symbol;
6675
6722
  declare class InvalidToolApprovalSignatureError extends AISDKError {
6676
- private readonly [symbol$g];
6723
+ private readonly [symbol$h];
6677
6724
  readonly approvalId: string;
6678
6725
  readonly toolCallId: string;
6679
6726
  constructor({ approvalId, toolCallId, reason, }: {
@@ -6684,9 +6731,9 @@ declare class InvalidToolApprovalSignatureError extends AISDKError {
6684
6731
  static isInstance(error: unknown): error is InvalidToolApprovalSignatureError;
6685
6732
  }
6686
6733
 
6687
- declare const symbol$f: unique symbol;
6734
+ declare const symbol$g: unique symbol;
6688
6735
  declare class ToolCallNotFoundForApprovalError extends AISDKError {
6689
- private readonly [symbol$f];
6736
+ private readonly [symbol$g];
6690
6737
  readonly toolCallId: string;
6691
6738
  readonly approvalId: string;
6692
6739
  constructor({ toolCallId, approvalId, }: {
@@ -6696,9 +6743,9 @@ declare class ToolCallNotFoundForApprovalError extends AISDKError {
6696
6743
  static isInstance(error: unknown): error is ToolCallNotFoundForApprovalError;
6697
6744
  }
6698
6745
 
6699
- declare const symbol$e: unique symbol;
6746
+ declare const symbol$f: unique symbol;
6700
6747
  declare class MissingToolResultsError extends AISDKError {
6701
- private readonly [symbol$e];
6748
+ private readonly [symbol$f];
6702
6749
  readonly toolCallIds: string[];
6703
6750
  constructor({ toolCallIds }: {
6704
6751
  toolCallIds: string[];
@@ -6706,7 +6753,7 @@ declare class MissingToolResultsError extends AISDKError {
6706
6753
  static isInstance(error: unknown): error is MissingToolResultsError;
6707
6754
  }
6708
6755
 
6709
- declare const symbol$d: unique symbol;
6756
+ declare const symbol$e: unique symbol;
6710
6757
  /**
6711
6758
  * Thrown when no image could be generated. This can have multiple causes:
6712
6759
  *
@@ -6714,7 +6761,7 @@ declare const symbol$d: unique symbol;
6714
6761
  * - The model generated a response that could not be parsed.
6715
6762
  */
6716
6763
  declare class NoImageGeneratedError extends AISDKError {
6717
- private readonly [symbol$d];
6764
+ private readonly [symbol$e];
6718
6765
  /**
6719
6766
  * The response metadata for each call.
6720
6767
  */
@@ -6727,7 +6774,7 @@ declare class NoImageGeneratedError extends AISDKError {
6727
6774
  static isInstance(error: unknown): error is NoImageGeneratedError;
6728
6775
  }
6729
6776
 
6730
- declare const symbol$c: unique symbol;
6777
+ declare const symbol$d: unique symbol;
6731
6778
  /**
6732
6779
  * Thrown when no object could be generated. This can have several causes:
6733
6780
  *
@@ -6740,7 +6787,7 @@ declare const symbol$c: unique symbol;
6740
6787
  * - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
6741
6788
  */
6742
6789
  declare class NoObjectGeneratedError extends AISDKError {
6743
- private readonly [symbol$c];
6790
+ private readonly [symbol$d];
6744
6791
  /**
6745
6792
  * The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
6746
6793
  */
@@ -6768,12 +6815,12 @@ declare class NoObjectGeneratedError extends AISDKError {
6768
6815
  static isInstance(error: unknown): error is NoObjectGeneratedError;
6769
6816
  }
6770
6817
 
6771
- declare const symbol$b: unique symbol;
6818
+ declare const symbol$c: unique symbol;
6772
6819
  /**
6773
6820
  * Thrown when no LLM output was generated, e.g. because of errors.
6774
6821
  */
6775
6822
  declare class NoOutputGeneratedError extends AISDKError {
6776
- private readonly [symbol$b];
6823
+ private readonly [symbol$c];
6777
6824
  constructor({ message, cause, }?: {
6778
6825
  message?: string;
6779
6826
  cause?: Error;
@@ -6781,12 +6828,12 @@ declare class NoOutputGeneratedError extends AISDKError {
6781
6828
  static isInstance(error: unknown): error is NoOutputGeneratedError;
6782
6829
  }
6783
6830
 
6784
- declare const symbol$a: unique symbol;
6831
+ declare const symbol$b: unique symbol;
6785
6832
  /**
6786
6833
  * Error that is thrown when no speech audio was generated.
6787
6834
  */
6788
6835
  declare class NoSpeechGeneratedError extends AISDKError {
6789
- private readonly [symbol$a];
6836
+ private readonly [symbol$b];
6790
6837
  readonly responses: Array<SpeechModelResponseMetadata>;
6791
6838
  constructor(options: {
6792
6839
  responses: Array<SpeechModelResponseMetadata>;
@@ -6794,12 +6841,12 @@ declare class NoSpeechGeneratedError extends AISDKError {
6794
6841
  static isInstance(error: unknown): error is NoSpeechGeneratedError;
6795
6842
  }
6796
6843
 
6797
- declare const symbol$9: unique symbol;
6844
+ declare const symbol$a: unique symbol;
6798
6845
  /**
6799
6846
  * Error that is thrown when no transcript was generated.
6800
6847
  */
6801
6848
  declare class NoTranscriptGeneratedError extends AISDKError {
6802
- private readonly [symbol$9];
6849
+ private readonly [symbol$a];
6803
6850
  readonly responses: Array<TranscriptionModelResponseMetadata>;
6804
6851
  constructor(options: {
6805
6852
  responses: Array<TranscriptionModelResponseMetadata>;
@@ -6828,12 +6875,12 @@ type SpeechTranslationModelResponseMetadata = {
6828
6875
  headers?: Record<string, string>;
6829
6876
  };
6830
6877
 
6831
- declare const symbol$8: unique symbol;
6878
+ declare const symbol$9: unique symbol;
6832
6879
  /**
6833
6880
  * Error that is thrown when no translation was generated.
6834
6881
  */
6835
6882
  declare class NoTranslationGeneratedError extends AISDKError {
6836
- private readonly [symbol$8];
6883
+ private readonly [symbol$9];
6837
6884
  readonly response: SpeechTranslationModelResponseMetadata;
6838
6885
  constructor(options: {
6839
6886
  response: SpeechTranslationModelResponseMetadata;
@@ -6865,9 +6912,9 @@ type VideoModelResponseMetadata = {
6865
6912
  providerMetadata?: SharedV4ProviderMetadata;
6866
6913
  };
6867
6914
 
6868
- declare const symbol$7: unique symbol;
6915
+ declare const symbol$8: unique symbol;
6869
6916
  declare class NoVideoGeneratedError extends AISDKError {
6870
- private readonly [symbol$7];
6917
+ private readonly [symbol$8];
6871
6918
  readonly responses: Array<VideoModelResponseMetadata>;
6872
6919
  constructor({ message, cause, responses, }: {
6873
6920
  message?: string;
@@ -6891,6 +6938,45 @@ declare class NoVideoGeneratedError extends AISDKError {
6891
6938
  };
6892
6939
  }
6893
6940
 
6941
+ declare const symbol$7: unique symbol;
6942
+ /**
6943
+ * Error reported by a provider after a model response stream has started.
6944
+ */
6945
+ declare class StreamProviderError extends AISDKError {
6946
+ private readonly [symbol$7];
6947
+ /**
6948
+ * Provider-defined error type, when supplied by the provider.
6949
+ */
6950
+ readonly type?: string;
6951
+ /**
6952
+ * Provider-defined error code, when supplied by the provider.
6953
+ */
6954
+ readonly code?: string | number;
6955
+ /**
6956
+ * HTTP-equivalent status code, when supplied by or inferable from the
6957
+ * provider error metadata.
6958
+ */
6959
+ readonly statusCode?: number;
6960
+ /**
6961
+ * Whether retrying the model call may succeed.
6962
+ */
6963
+ readonly isRetryable: boolean;
6964
+ /**
6965
+ * Original provider error payload.
6966
+ */
6967
+ readonly data?: unknown;
6968
+ constructor({ message, type, code, statusCode, isRetryable, data, cause, }: {
6969
+ message: string;
6970
+ type?: string;
6971
+ code?: string | number;
6972
+ statusCode?: number;
6973
+ isRetryable?: boolean;
6974
+ data?: unknown;
6975
+ cause?: unknown;
6976
+ });
6977
+ static isInstance(error: unknown): error is StreamProviderError;
6978
+ }
6979
+
6894
6980
  declare const symbol$6: unique symbol;
6895
6981
  declare class ToolCallRepairError extends AISDKError {
6896
6982
  private readonly [symbol$6];
@@ -9445,4 +9531,4 @@ declare function uploadSkill({ api, files, displayTitle, providerOptions, }: {
9445
9531
  files: UploadSkillFile[];
9446
9532
  }): Promise<UploadSkillResult>;
9447
9533
 
9448
- export { AI_SDK_TELEMETRY_TRACING_CHANNEL, AbstractChat, ActiveTools, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, CustomContentUIPart, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedEndEvent, EmbedManyResult, EmbedResult, EmbedStartEvent, Embedding, EmbeddingModel, EmbeddingModelCallEndEvent, EmbeddingModelCallStartEvent, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, BatchError as Experimental_BatchError, BatchLanguageModel as Experimental_BatchLanguageModel, BatchOperationOptions as Experimental_BatchOperationOptions, BatchReference as Experimental_BatchReference, BatchStatus as Experimental_BatchStatus, DownloadFunction as Experimental_DownloadFunction, Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LanguageModelStreamPart as Experimental_LanguageModelStreamPart, LogWarningsFunction as Experimental_LogWarningsFunction, RealtimeClientEvent as Experimental_RealtimeClientEvent, RealtimeFactory as Experimental_RealtimeFactory, RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, RealtimeModel as Experimental_RealtimeModel, RealtimeServerEvent as Experimental_RealtimeServerEvent, RealtimeSessionConfig as Experimental_RealtimeSessionConfig, RealtimeSessionOptions as Experimental_RealtimeSessionOptions, RealtimeSetupResponse as Experimental_RealtimeSetupResponse, RealtimeState as Experimental_RealtimeState, RealtimeStatus as Experimental_RealtimeStatus, RealtimeToolDefinition as Experimental_RealtimeToolDefinition, Experimental_SpeechResult, StartTextBatchOptions as Experimental_StartTextBatchOptions, StartTextBatchResult as Experimental_StartTextBatchResult, StreamTranslationResult as Experimental_StreamTranslationResult, TextBatch as Experimental_TextBatch, TextBatchGenerationResult as Experimental_TextBatchGenerationResult, TextBatchItemResult as Experimental_TextBatchItemResult, TextBatchReference as Experimental_TextBatchReference, TextBatchRequest as Experimental_TextBatchRequest, Experimental_ToolCallers, Experimental_TranscriptionResult, TranslationStreamPart as Experimental_TranslationStreamPart, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectEndEvent, GenerateObjectResult, GenerateObjectStartEvent, GenerateObjectStepEndEvent, GenerateObjectStepStartEvent, GenerateTextAbortEvent, GenerateTextEndEvent, GenerateTextInclude, GenerateTextOnAbortCallback, GenerateTextOnEndCallback, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepEndCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextResult, GenerateTextStartEvent, GenerateTextStepEndEvent, GenerateTextStepStartEvent, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, GenericToolApprovalFunction, GetVideoStatusResult, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferTelemetryEvent, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelCallEndEvent, LanguageModelCallOptions, LanguageModelCallStartEvent, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, ModelInfo, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnLanguageModelCallEndCallback, OnLanguageModelCallStartCallback, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, OnToolExecutionEndCallback, OnToolExecutionStartCallback, output as Output, OutputChunkTimingStats, Output as OutputInterface, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderReference, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RequestOptions, RerankEndEvent, RerankResult, RerankStartEvent, RerankingModel, RerankingModelCallEndEvent, RerankingModelCallStartEvent, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SingleToolApprovalFunction, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechResult, StartVideoResult, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepResultPerformance, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextInclude, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextResult, StreamTextTransform, StreamTranscriptionResult, Telemetry, TelemetryOptions, TelemetryTracingChannelMessage, TelemetryTracingEventType, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToUIMessageChunkOptions, ToolApprovalConfiguration, ToolApprovalRequestOutput, ToolApprovalResponseOutput, ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolExecutionEndEvent, ToolExecutionStartEvent, ToolInputRefinement, ToolLoopAgent, ToolLoopAgentSettings, ToolOrder, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionResult, TranscriptionStreamPart, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnEndCallback, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepEndCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UploadFileResult, UploadSkillResult, UseCompletionOptions, 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 };
9534
+ export { AI_SDK_TELEMETRY_TRACING_CHANNEL, AbstractChat, ActiveTools, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, CustomContentUIPart, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedEndEvent, EmbedManyResult, EmbedResult, EmbedStartEvent, Embedding, EmbeddingModel, EmbeddingModelCallEndEvent, EmbeddingModelCallStartEvent, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, BatchError as Experimental_BatchError, BatchLanguageModel as Experimental_BatchLanguageModel, BatchOperationOptions as Experimental_BatchOperationOptions, BatchReference as Experimental_BatchReference, BatchStatus as Experimental_BatchStatus, DownloadFunction as Experimental_DownloadFunction, Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LanguageModelStreamPart as Experimental_LanguageModelStreamPart, LogWarningsFunction as Experimental_LogWarningsFunction, RealtimeClientEvent as Experimental_RealtimeClientEvent, RealtimeFactory as Experimental_RealtimeFactory, RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, RealtimeModel as Experimental_RealtimeModel, RealtimeServerEvent as Experimental_RealtimeServerEvent, RealtimeSessionConfig as Experimental_RealtimeSessionConfig, RealtimeSessionOptions as Experimental_RealtimeSessionOptions, RealtimeSetupResponse as Experimental_RealtimeSetupResponse, RealtimeState as Experimental_RealtimeState, RealtimeStatus as Experimental_RealtimeStatus, RealtimeToolDefinition as Experimental_RealtimeToolDefinition, Experimental_SpeechResult, StartTextBatchOptions as Experimental_StartTextBatchOptions, StartTextBatchResult as Experimental_StartTextBatchResult, StreamTranslationResult as Experimental_StreamTranslationResult, TextBatch as Experimental_TextBatch, TextBatchGenerationResult as Experimental_TextBatchGenerationResult, TextBatchItemResult as Experimental_TextBatchItemResult, TextBatchReference as Experimental_TextBatchReference, TextBatchRequest as Experimental_TextBatchRequest, Experimental_ToolCallers, Experimental_TranscriptionResult, TranslationStreamPart as Experimental_TranslationStreamPart, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectEndEvent, GenerateObjectResult, GenerateObjectStartEvent, GenerateObjectStepEndEvent, GenerateObjectStepStartEvent, GenerateTextAbortEvent, GenerateTextEndEvent, GenerateTextInclude, GenerateTextOnAbortCallback, GenerateTextOnEndCallback, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepEndCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextResult, GenerateTextStartEvent, GenerateTextStepEndEvent, GenerateTextStepStartEvent, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, GenericToolApprovalFunction, GetVideoStatusResult, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferTelemetryEvent, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelCallEndEvent, LanguageModelCallOptions, LanguageModelCallStartEvent, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, ModelInfo, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnLanguageModelCallEndCallback, OnLanguageModelCallStartCallback, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, OnToolExecutionEndCallback, OnToolExecutionStartCallback, output as Output, OutputChunkTimingStats, Output as OutputInterface, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderReference, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RequestOptions, RerankEndEvent, RerankResult, RerankStartEvent, RerankingModel, RerankingModelCallEndEvent, RerankingModelCallStartEvent, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SingleToolApprovalFunction, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechResult, StartVideoResult, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepResultPerformance, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamProviderError, StreamTextInclude, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextResult, StreamTextTransform, StreamTranscriptionResult, Telemetry, TelemetryOptions, TelemetryTracingChannelMessage, TelemetryTracingEventType, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToUIMessageChunkOptions, ToolApprovalConfiguration, ToolApprovalRequestOutput, ToolApprovalResponseOutput, ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolExecutionEndEvent, ToolExecutionStartEvent, ToolInputRefinement, ToolLoopAgent, ToolLoopAgentSettings, ToolOrder, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionResult, TranscriptionStreamPart, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnEndCallback, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepEndCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamOutcome, UIMessageStreamWriter, UIMessageStreamWriterWithOutcome, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UploadFileResult, UploadSkillResult, UseCompletionOptions, 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 };