ai 5.0.0-alpha.14 → 5.0.0-alpha.15

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,27 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.0-alpha.15
4
+
5
+ ### Major Changes
6
+
7
+ - 04d5063: chore (ai): rename default provider global to AI_SDK_DEFAULT_PROVIDER
8
+ - b4b4bb2: chore (ui): rename experimental_resume to resumeStream
9
+ - d884051: feat (ai): simplify default provider setup
10
+ - 954aa73: feat (ui): extended regenerate support
11
+ - 60e2c56: feat (ai): restructure chat transports
12
+
13
+ ### Patch Changes
14
+
15
+ - b1e3abd: feat (ai): expose ui message stream headers
16
+ - 142576e: feat (ui): support message replacement in chat via messageId param on sendMessage
17
+ - 395c85e: feat (ai): add consumeSseStream option to UI message stream responses
18
+ - Updated dependencies [48d257a]
19
+ - Updated dependencies [8ba77a7]
20
+ - Updated dependencies [c145d62]
21
+ - @ai-sdk/provider@2.0.0-alpha.15
22
+ - @ai-sdk/provider-utils@3.0.0-alpha.15
23
+ - @ai-sdk/gateway@1.0.0-alpha.15
24
+
3
25
  ## 5.0.0-alpha.14
4
26
 
5
27
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -1934,8 +1934,6 @@ type Prompt = {
1934
1934
  messages?: Array<ModelMessage>;
1935
1935
  };
1936
1936
 
1937
- declare const GLOBAL_DEFAULT_PROVIDER: unique symbol;
1938
-
1939
1937
  /**
1940
1938
  * A function that attempts to repair a tool call that failed to parse.
1941
1939
  *
@@ -2482,26 +2480,45 @@ originalMessages, onFinish, generateId, }: {
2482
2480
  generateId?: IdGenerator;
2483
2481
  }): ReadableStream<InferUIMessageStreamPart<UI_MESSAGE>>;
2484
2482
 
2485
- declare function createUIMessageStreamResponse({ status, statusText, headers, stream, }: ResponseInit & {
2486
- stream: ReadableStream<UIMessageStreamPart>;
2487
- }): Response;
2483
+ type UIMessageStreamResponseInit = ResponseInit & {
2484
+ consumeSseStream?: (options: {
2485
+ stream: ReadableStream<string>;
2486
+ }) => PromiseLike<void> | void;
2487
+ };
2488
2488
 
2489
- declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, }: {
2490
- response: ServerResponse;
2489
+ declare function createUIMessageStreamResponse({ status, statusText, headers, stream, consumeSseStream, }: UIMessageStreamResponseInit & {
2491
2490
  stream: ReadableStream<UIMessageStreamPart>;
2492
- } & ResponseInit): void;
2491
+ }): Response;
2493
2492
 
2494
2493
  declare class JsonToSseTransformStream extends TransformStream<unknown, string> {
2495
2494
  constructor();
2496
2495
  }
2497
2496
 
2497
+ declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream, }: {
2498
+ response: ServerResponse;
2499
+ stream: ReadableStream<UIMessageStreamPart>;
2500
+ } & UIMessageStreamResponseInit): void;
2501
+
2502
+ declare const UI_MESSAGE_STREAM_HEADERS: {
2503
+ 'content-type': string;
2504
+ 'cache-control': string;
2505
+ connection: string;
2506
+ 'x-vercel-ai-ui-message-stream': string;
2507
+ 'x-accel-buffering': string;
2508
+ };
2509
+
2498
2510
  interface ChatTransport<UI_MESSAGE extends UIMessage> {
2499
- submitMessages: (options: {
2511
+ sendMessages: (options: {
2500
2512
  chatId: string;
2501
2513
  messages: UI_MESSAGE[];
2502
2514
  abortSignal: AbortSignal | undefined;
2503
- requestType: 'generate' | 'resume';
2515
+ } & {
2516
+ trigger: 'submit-user-message' | 'submit-tool-result' | 'regenerate-assistant-message';
2517
+ messageId: string | undefined;
2504
2518
  } & ChatRequestOptions) => Promise<ReadableStream<UIMessageStreamPart>>;
2519
+ reconnectToStream: (options: {
2520
+ chatId: string;
2521
+ } & ChatRequestOptions) => Promise<ReadableStream<UIMessageStreamPart> | null>;
2505
2522
  }
2506
2523
 
2507
2524
  type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESSAGE, 'id' | 'role'> & {
@@ -2608,32 +2625,39 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
2608
2625
  get messages(): UI_MESSAGE[];
2609
2626
  get lastMessage(): UI_MESSAGE | undefined;
2610
2627
  set messages(messages: UI_MESSAGE[]);
2611
- removeAssistantResponse: () => void;
2612
2628
  /**
2613
- * Append a user message to the chat list. This triggers the API call to fetch
2629
+ * Appends or replaces a user message to the chat list. This triggers the API call to fetch
2614
2630
  * the assistant's response.
2631
+ *
2632
+ * If a messageId is provided, the message will be replaced.
2615
2633
  */
2616
2634
  sendMessage: (message: (CreateUIMessage<UI_MESSAGE> & {
2617
2635
  text?: never;
2618
2636
  files?: never;
2637
+ messageId?: string;
2619
2638
  }) | {
2620
2639
  text: string;
2621
2640
  files?: FileList | FileUIPart[];
2622
2641
  metadata?: InferUIMessageMetadata<UI_MESSAGE>;
2623
2642
  parts?: never;
2643
+ messageId?: string;
2624
2644
  } | {
2625
2645
  files: FileList | FileUIPart[];
2626
2646
  metadata?: InferUIMessageMetadata<UI_MESSAGE>;
2627
2647
  parts?: never;
2648
+ messageId?: string;
2628
2649
  }, options?: ChatRequestOptions) => Promise<void>;
2629
2650
  /**
2630
- * Regenerate the last assistant message.
2651
+ * Regenerate the assistant message with the provided message id.
2652
+ * If no message id is provided, the last assistant message will be regenerated.
2631
2653
  */
2632
- reload: (options?: ChatRequestOptions) => Promise<void>;
2654
+ regenerate: ({ messageId, ...options }?: {
2655
+ messageId?: string;
2656
+ } & ChatRequestOptions) => Promise<void>;
2633
2657
  /**
2634
- * Resume an ongoing chat generation stream. This does not resume an aborted generation.
2658
+ * Attempt to resume an ongoing streaming response.
2635
2659
  */
2636
- experimental_resume: (options?: ChatRequestOptions) => Promise<void>;
2660
+ resumeStream: (options?: ChatRequestOptions) => Promise<void>;
2637
2661
  addToolResult: ({ toolCallId, output, }: {
2638
2662
  toolCallId: string;
2639
2663
  output: unknown;
@@ -2642,7 +2666,7 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
2642
2666
  * Abort the current request immediately, keep the generated tokens if any.
2643
2667
  */
2644
2668
  stop: () => Promise<void>;
2645
- private triggerRequest;
2669
+ private makeRequest;
2646
2670
  }
2647
2671
 
2648
2672
  declare function convertFileListToFileUIParts(files: FileList | undefined): Promise<Array<FileUIPart>>;
@@ -2659,119 +2683,99 @@ declare function convertToModelMessages<TOOLS extends ToolSet = never>(messages:
2659
2683
  */
2660
2684
  declare const convertToCoreMessages: typeof convertToModelMessages;
2661
2685
 
2662
- type PrepareRequest<UI_MESSAGE extends UIMessage> = (options: {
2686
+ type PrepareSendMessagesRequest<UI_MESSAGE extends UIMessage> = (options: {
2663
2687
  id: string;
2664
2688
  messages: UI_MESSAGE[];
2665
2689
  requestMetadata: unknown;
2666
2690
  body: Record<string, any> | undefined;
2667
2691
  credentials: RequestCredentials | undefined;
2668
2692
  headers: HeadersInit | undefined;
2693
+ api: string;
2694
+ } & {
2695
+ trigger: 'submit-user-message' | 'submit-tool-result' | 'regenerate-assistant-message';
2696
+ messageId: string | undefined;
2669
2697
  }) => {
2670
2698
  body: object;
2671
2699
  headers?: HeadersInit;
2672
2700
  credentials?: RequestCredentials;
2701
+ api?: string;
2702
+ };
2703
+ type PrepareReconnectToStreamRequest = (options: {
2704
+ id: string;
2705
+ requestMetadata: unknown;
2706
+ body: Record<string, any> | undefined;
2707
+ credentials: RequestCredentials | undefined;
2708
+ headers: HeadersInit | undefined;
2709
+ api: string;
2710
+ }) => {
2711
+ headers?: HeadersInit;
2712
+ credentials?: RequestCredentials;
2713
+ api?: string;
2673
2714
  };
2715
+ type HttpChatTransportInitOptions<UI_MESSAGE extends UIMessage> = {
2716
+ api?: string;
2717
+ /**
2718
+ * The credentials mode to be used for the fetch request.
2719
+ * Possible values are: 'omit', 'same-origin', 'include'.
2720
+ * Defaults to 'same-origin'.
2721
+ */
2722
+ credentials?: RequestCredentials;
2723
+ /**
2724
+ * HTTP headers to be sent with the API request.
2725
+ */
2726
+ headers?: Record<string, string> | Headers;
2727
+ /**
2728
+ * Extra body object to be sent with the API request.
2729
+ * @example
2730
+ * Send a `sessionId` to the API along with the messages.
2731
+ * ```js
2732
+ * useChat({
2733
+ * body: {
2734
+ * sessionId: '123',
2735
+ * }
2736
+ * })
2737
+ * ```
2738
+ */
2739
+ body?: object;
2740
+ /**
2741
+ Custom fetch implementation. You can use it as a middleware to intercept requests,
2742
+ or to provide a custom fetch implementation for e.g. testing.
2743
+ */
2744
+ fetch?: FetchFunction;
2745
+ /**
2746
+ * When a function is provided, it will be used
2747
+ * to prepare the request body for the chat API. This can be useful for
2748
+ * customizing the request body based on the messages and data in the chat.
2749
+ *
2750
+ * @param id The id of the chat.
2751
+ * @param messages The current messages in the chat.
2752
+ * @param requestBody The request body object passed in the chat request.
2753
+ */
2754
+ prepareSendMessagesRequest?: PrepareSendMessagesRequest<UI_MESSAGE>;
2755
+ prepareReconnectToStreamRequest?: PrepareReconnectToStreamRequest;
2756
+ };
2757
+ declare abstract class HttpChatTransport<UI_MESSAGE extends UIMessage> implements ChatTransport<UI_MESSAGE> {
2758
+ protected api: string;
2759
+ protected credentials?: RequestCredentials;
2760
+ protected headers?: Record<string, string> | Headers;
2761
+ protected body?: object;
2762
+ protected fetch: FetchFunction;
2763
+ protected prepareSendMessagesRequest?: PrepareSendMessagesRequest<UI_MESSAGE>;
2764
+ protected prepareReconnectToStreamRequest?: PrepareReconnectToStreamRequest;
2765
+ constructor({ api, credentials, headers, body, fetch, prepareSendMessagesRequest, prepareReconnectToStreamRequest, }: HttpChatTransportInitOptions<UI_MESSAGE>);
2766
+ sendMessages({ abortSignal, ...options }: Parameters<ChatTransport<UI_MESSAGE>['sendMessages']>[0]): Promise<ReadableStream<UIMessageStreamPart>>;
2767
+ reconnectToStream(options: Parameters<ChatTransport<UI_MESSAGE>['reconnectToStream']>[0]): Promise<ReadableStream<UIMessageStreamPart> | null>;
2768
+ protected abstract processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageStreamPart>;
2769
+ }
2674
2770
 
2675
- declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> implements ChatTransport<UI_MESSAGE> {
2676
- private api;
2677
- private credentials?;
2678
- private headers?;
2679
- private body?;
2680
- private fetch?;
2681
- private prepareRequest?;
2682
- constructor({ api, credentials, headers, body, fetch, prepareRequest, }?: {
2683
- api?: string;
2684
- /**
2685
- * The credentials mode to be used for the fetch request.
2686
- * Possible values are: 'omit', 'same-origin', 'include'.
2687
- * Defaults to 'same-origin'.
2688
- */
2689
- credentials?: RequestCredentials;
2690
- /**
2691
- * HTTP headers to be sent with the API request.
2692
- */
2693
- headers?: Record<string, string> | Headers;
2694
- /**
2695
- * Extra body object to be sent with the API request.
2696
- * @example
2697
- * Send a `sessionId` to the API along with the messages.
2698
- * ```js
2699
- * useChat({
2700
- * body: {
2701
- * sessionId: '123',
2702
- * }
2703
- * })
2704
- * ```
2705
- */
2706
- body?: object;
2707
- /**
2708
- Custom fetch implementation. You can use it as a middleware to intercept requests,
2709
- or to provide a custom fetch implementation for e.g. testing.
2710
- */
2711
- fetch?: FetchFunction;
2712
- /**
2713
- * When a function is provided, it will be used
2714
- * to prepare the request body for the chat API. This can be useful for
2715
- * customizing the request body based on the messages and data in the chat.
2716
- *
2717
- * @param id The id of the chat.
2718
- * @param messages The current messages in the chat.
2719
- * @param requestBody The request body object passed in the chat request.
2720
- */
2721
- prepareRequest?: PrepareRequest<UI_MESSAGE>;
2722
- });
2723
- submitMessages({ chatId, messages, abortSignal, metadata, headers, body, requestType, }: Parameters<ChatTransport<UI_MESSAGE>['submitMessages']>[0]): Promise<ReadableStream<UIMessageStreamPart>>;
2771
+ declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
2772
+ constructor(options?: HttpChatTransportInitOptions<UI_MESSAGE>);
2773
+ protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageStreamPart>;
2724
2774
  }
2725
2775
 
2726
- declare class TextStreamChatTransport<UI_MESSAGE extends UIMessage> implements ChatTransport<UI_MESSAGE> {
2727
- private api;
2728
- private credentials?;
2729
- private headers?;
2730
- private body?;
2731
- private fetch?;
2732
- private prepareRequest?;
2733
- constructor({ api, credentials, headers, body, fetch, prepareRequest, }: {
2734
- api: string;
2735
- /**
2736
- * The credentials mode to be used for the fetch request.
2737
- * Possible values are: 'omit', 'same-origin', 'include'.
2738
- * Defaults to 'same-origin'.
2739
- */
2740
- credentials?: RequestCredentials;
2741
- /**
2742
- * HTTP headers to be sent with the API request.
2743
- */
2744
- headers?: Record<string, string> | Headers;
2745
- /**
2746
- * Extra body object to be sent with the API request.
2747
- * @example
2748
- * Send a `sessionId` to the API along with the messages.
2749
- * ```js
2750
- * useChat({
2751
- * body: {
2752
- * sessionId: '123',
2753
- * }
2754
- * })
2755
- * ```
2756
- */
2757
- body?: object;
2758
- /**
2759
- Custom fetch implementation. You can use it as a middleware to intercept requests,
2760
- or to provide a custom fetch implementation for e.g. testing.
2761
- */
2762
- fetch?: FetchFunction;
2763
- /**
2764
- * When a function is provided, it will be used
2765
- * to prepare the request body for the chat API. This can be useful for
2766
- * customizing the request body based on the messages and data in the chat.
2767
- *
2768
- * @param id The id of the chat.
2769
- * @param messages The current messages in the chat.
2770
- * @param requestBody The request body object passed in the chat request.
2771
- */
2772
- prepareRequest?: NoInfer<PrepareRequest<UI_MESSAGE>>;
2773
- });
2774
- submitMessages({ chatId, messages, abortSignal, metadata, headers, body, requestType, }: Parameters<ChatTransport<UI_MESSAGE>['submitMessages']>[0]): Promise<ReadableStream<UIMessageStreamPart<never, never>>>;
2776
+ declare class TextStreamChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
2777
+ constructor(options?: HttpChatTransportInitOptions<UI_MESSAGE>);
2778
+ protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageStreamPart>;
2775
2779
  }
2776
2780
 
2777
2781
  type CompletionRequestOptions = {
@@ -3659,7 +3663,7 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
3659
3663
  @param options.sendUsage Whether to send the usage information to the client. Defaults to true.
3660
3664
  @param options.sendReasoning Whether to send the reasoning information to the client. Defaults to false.
3661
3665
  */
3662
- pipeUIMessageStreamToResponse<UI_MESSAGE extends UIMessage>(response: ServerResponse, options?: ResponseInit & UIMessageStreamOptions<UI_MESSAGE>): void;
3666
+ pipeUIMessageStreamToResponse<UI_MESSAGE extends UIMessage>(response: ServerResponse, options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): void;
3663
3667
  /**
3664
3668
  Writes text delta output to a Node.js response-like object.
3665
3669
  It sets a `Content-Type` header to `text/plain; charset=utf-8` and
@@ -3679,7 +3683,7 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
3679
3683
  @param options.sendReasoning Whether to send the reasoning information to the client. Defaults to false.
3680
3684
  @return A response object.
3681
3685
  */
3682
- toUIMessageStreamResponse<UI_MESSAGE extends UIMessage>(options?: ResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Response;
3686
+ toUIMessageStreamResponse<UI_MESSAGE extends UIMessage>(options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Response;
3683
3687
  /**
3684
3688
  Creates a simple text stream response.
3685
3689
  Each text delta is encoded as UTF-8 and sent as a separate chunk.
@@ -4842,4 +4846,8 @@ declare function transcribe({ model, audio, providerOptions, maxRetries: maxRetr
4842
4846
  headers?: Record<string, string>;
4843
4847
  }): Promise<TranscriptionResult>;
4844
4848
 
4845
- export { AbstractChat, AssistantContent, AssistantModelMessage, CallSettings, CallWarning, ChatInit, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataContent, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FilePart, FileUIPart, FinishReason, GLOBAL_DEFAULT_PROVIDER, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, ImagePart, InferUIDataParts, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, ModelMessage, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderOptions, ProviderRegistryProvider, ReasoningUIPart, RepairTextFunction, RetryError, SerialJobExecutor, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, SystemModelMessage, TelemetrySettings, TextPart, TextStreamChatTransport, TextStreamPart, TextUIPart, Tool, ToolCallOptions, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolModelMessage, ToolResultPart, ToolResultUnion, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessagePart, UIMessageStreamOptions, UIMessageStreamPart, UIMessageStreamWriter, UseCompletionOptions, UserContent, UserModelMessage, assistantModelMessageSchema, callCompletionApi, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, hasToolCall, isDeepEqualData, isToolUIPart, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, tool, toolModelMessageSchema, userModelMessageSchema, wrapLanguageModel };
4849
+ declare global {
4850
+ var AI_SDK_DEFAULT_PROVIDER: ProviderV2 | undefined;
4851
+ }
4852
+
4853
+ export { AbstractChat, AssistantContent, AssistantModelMessage, CallSettings, CallWarning, ChatInit, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataContent, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FilePart, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, ImagePart, InferUIDataParts, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, ModelMessage, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderOptions, ProviderRegistryProvider, ReasoningUIPart, RepairTextFunction, RetryError, SerialJobExecutor, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, SystemModelMessage, TelemetrySettings, TextPart, TextStreamChatTransport, TextStreamPart, TextUIPart, Tool, ToolCallOptions, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolModelMessage, ToolResultPart, ToolResultUnion, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessagePart, UIMessageStreamOptions, UIMessageStreamPart, UIMessageStreamWriter, UI_MESSAGE_STREAM_HEADERS, UseCompletionOptions, UserContent, UserModelMessage, assistantModelMessageSchema, callCompletionApi, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, hasToolCall, isDeepEqualData, isToolUIPart, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, tool, toolModelMessageSchema, userModelMessageSchema, wrapLanguageModel };