ai 7.0.0-beta.17 → 7.0.0-beta.19

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 (39) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.d.mts +67 -7
  3. package/dist/index.d.ts +67 -7
  4. package/dist/index.js +131 -24
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +130 -24
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/internal/index.js +19 -1
  9. package/dist/internal/index.js.map +1 -1
  10. package/dist/internal/index.mjs +19 -1
  11. package/dist/internal/index.mjs.map +1 -1
  12. package/docs/03-ai-sdk-core/65-event-listeners.mdx +2 -2
  13. package/docs/04-ai-sdk-ui/02-chatbot.mdx +7 -0
  14. package/docs/04-ai-sdk-ui/50-stream-protocol.mdx +13 -0
  15. package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +68 -5
  16. package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +45 -3
  17. package/docs/08-migration-guides/23-migration-guide-7-0.mdx +66 -0
  18. package/package.json +4 -4
  19. package/src/generate-text/content-part.ts +3 -2
  20. package/src/generate-text/generate-text-result.ts +2 -2
  21. package/src/generate-text/generate-text.ts +5 -3
  22. package/src/generate-text/index.ts +1 -1
  23. package/src/generate-text/reasoning-output.ts +79 -0
  24. package/src/generate-text/reasoning.ts +5 -3
  25. package/src/generate-text/run-tools-transformation.ts +9 -3
  26. package/src/generate-text/step-result.ts +16 -7
  27. package/src/generate-text/stream-text-result.ts +8 -3
  28. package/src/generate-text/stream-text.ts +20 -13
  29. package/src/generate-text/to-response-messages.ts +8 -0
  30. package/src/prompt/content-part.ts +11 -0
  31. package/src/prompt/convert-to-language-model-prompt.ts +13 -0
  32. package/src/prompt/message.ts +2 -0
  33. package/src/telemetry/open-telemetry-integration.ts +8 -2
  34. package/src/ui/convert-to-model-messages.ts +11 -0
  35. package/src/ui/index.ts +2 -0
  36. package/src/ui/process-ui-message-stream.ts +3 -2
  37. package/src/ui/ui-messages.ts +35 -0
  38. package/src/ui/validate-ui-messages.ts +6 -0
  39. package/src/ui-message-stream/ui-message-chunks.ts +12 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.0-beta.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f7d4f01]
8
+ - @ai-sdk/provider-utils@5.0.0-beta.3
9
+ - @ai-sdk/provider@4.0.0-beta.2
10
+ - @ai-sdk/gateway@4.0.0-beta.12
11
+
12
+ ## 7.0.0-beta.18
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [5c2a5a2]
17
+ - @ai-sdk/provider@4.0.0-beta.1
18
+ - @ai-sdk/gateway@4.0.0-beta.11
19
+ - @ai-sdk/provider-utils@5.0.0-beta.2
20
+
3
21
  ## 7.0.0-beta.17
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { GatewayModelId } from '@ai-sdk/gateway';
2
2
  export { GatewayModelId, createGateway, gateway } from '@ai-sdk/gateway';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
- import { Tool, InferToolInput, InferToolOutput, FlexibleSchema, InferSchema, SystemModelMessage, ModelMessage, AssistantModelMessage, ToolModelMessage, ReasoningPart, ProviderOptions, UserModelMessage, IdGenerator, ToolCall, MaybePromiseLike, TextPart, FilePart, Resolvable, FetchFunction, DataContent } from '@ai-sdk/provider-utils';
4
+ import { Tool, InferToolInput, InferToolOutput, FlexibleSchema, InferSchema, SystemModelMessage, ModelMessage, AssistantModelMessage, ToolModelMessage, ReasoningPart, ReasoningFilePart, ProviderOptions, UserModelMessage, IdGenerator, ToolCall, MaybePromiseLike, TextPart, FilePart, Resolvable, FetchFunction, DataContent } from '@ai-sdk/provider-utils';
5
5
  export { AssistantContent, AssistantModelMessage, DataContent, DownloadError, FilePart, FlexibleSchema, IdGenerator, ImagePart, InferSchema, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolExecutionOptions, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
6
6
  import * as _ai_sdk_provider from '@ai-sdk/provider';
7
7
  import { EmbeddingModelV4, EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV4Embedding, EmbeddingModelV4Middleware, ImageModelV4, ImageModelV3, ImageModelV2, ImageModelV4ProviderMetadata, ImageModelV2ProviderMetadata, ImageModelV4Middleware, JSONValue as JSONValue$1, LanguageModelV4, LanguageModelV3, LanguageModelV2, SharedV4Warning, LanguageModelV4Source, LanguageModelV4Middleware, RerankingModelV4, RerankingModelV3, SharedV4ProviderMetadata, SpeechModelV4, SpeechModelV3, SpeechModelV2, TranscriptionModelV4, TranscriptionModelV3, TranscriptionModelV2, JSONObject, ImageModelV4Usage, AISDKError, LanguageModelV4ToolCall, JSONSchema7, LanguageModelV4ToolChoice, LanguageModelV4CallOptions, JSONParseError, TypeValidationError, Experimental_VideoModelV4, Experimental_VideoModelV3, EmbeddingModelV4CallOptions, ProviderV4, ProviderV3, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
@@ -511,6 +511,23 @@ interface ReasoningOutput {
511
511
  */
512
512
  providerMetadata?: ProviderMetadata;
513
513
  }
514
+ /**
515
+ * Reasoning file output of a text generation.
516
+ * It contains a file generated as part of reasoning.
517
+ */
518
+ interface ReasoningFileOutput {
519
+ type: 'reasoning-file';
520
+ /**
521
+ * The generated file.
522
+ */
523
+ file: GeneratedFile;
524
+ /**
525
+ * Additional provider-specific metadata. They are passed through
526
+ * to the provider from the AI SDK and enable provider-specific
527
+ * functionality that can be fully encapsulated in the provider.
528
+ */
529
+ providerMetadata?: ProviderMetadata;
530
+ }
514
531
 
515
532
  type StaticToolError<TOOLS extends ToolSet> = ValueOf<{
516
533
  [NAME in keyof TOOLS]: {
@@ -570,7 +587,7 @@ type ContentPart<TOOLS extends ToolSet> = {
570
587
  type: 'text';
571
588
  text: string;
572
589
  providerMetadata?: ProviderMetadata;
573
- } | ReasoningOutput | ({
590
+ } | ReasoningOutput | ReasoningFileOutput | ({
574
591
  type: 'source';
575
592
  } & Source) | {
576
593
  type: 'file';
@@ -786,7 +803,7 @@ type StepResult<TOOLS extends ToolSet> = {
786
803
  /**
787
804
  * The reasoning that was generated during the generation.
788
805
  */
789
- readonly reasoning: Array<ReasoningPart>;
806
+ readonly reasoning: Array<ReasoningPart | ReasoningFilePart>;
790
807
  /**
791
808
  * The reasoning text that was generated during the generation.
792
809
  */
@@ -1413,7 +1430,7 @@ interface UIMessage<METADATA = unknown, DATA_PARTS extends UIDataTypes = UIDataT
1413
1430
  */
1414
1431
  parts: Array<UIMessagePart<DATA_PARTS, TOOLS>>;
1415
1432
  }
1416
- type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
1433
+ type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | ReasoningFileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
1417
1434
  /**
1418
1435
  * A text part of a message.
1419
1436
  */
@@ -1496,6 +1513,27 @@ type FileUIPart = {
1496
1513
  */
1497
1514
  providerMetadata?: ProviderMetadata;
1498
1515
  };
1516
+ /**
1517
+ * A reasoning file part of a message.
1518
+ */
1519
+ type ReasoningFileUIPart = {
1520
+ type: 'reasoning-file';
1521
+ /**
1522
+ * IANA media type of the file.
1523
+ *
1524
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1525
+ */
1526
+ mediaType: string;
1527
+ /**
1528
+ * The URL of the file.
1529
+ * It can either be a URL to a hosted file or a [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs).
1530
+ */
1531
+ url: string;
1532
+ /**
1533
+ * The provider metadata.
1534
+ */
1535
+ providerMetadata?: ProviderMetadata;
1536
+ };
1499
1537
  /**
1500
1538
  * A step boundary part of a message.
1501
1539
  */
@@ -1704,6 +1742,10 @@ declare function isTextUIPart(part: UIMessagePart<UIDataTypes, UITools>): part i
1704
1742
  * Type guard to check if a message part is a file part.
1705
1743
  */
1706
1744
  declare function isFileUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is FileUIPart;
1745
+ /**
1746
+ * Type guard to check if a message part is a reasoning file part.
1747
+ */
1748
+ declare function isReasoningFileUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is ReasoningFileUIPart;
1707
1749
  /**
1708
1750
  * Type guard to check if a message part is a reasoning part.
1709
1751
  */
@@ -1856,6 +1898,11 @@ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1856
1898
  url: string;
1857
1899
  mediaType: string;
1858
1900
  providerMetadata?: _ai_sdk_provider.SharedV4ProviderMetadata | undefined;
1901
+ } | {
1902
+ type: "reasoning-file";
1903
+ url: string;
1904
+ mediaType: string;
1905
+ providerMetadata?: _ai_sdk_provider.SharedV4ProviderMetadata | undefined;
1859
1906
  } | {
1860
1907
  type: `data-${string}`;
1861
1908
  data: unknown;
@@ -1988,6 +2035,11 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
1988
2035
  url: string;
1989
2036
  mediaType: string;
1990
2037
  providerMetadata?: ProviderMetadata;
2038
+ } | {
2039
+ type: 'reasoning-file';
2040
+ url: string;
2041
+ mediaType: string;
2042
+ providerMetadata?: ProviderMetadata;
1991
2043
  } | DataUIMessageChunk<DATA_TYPES> | {
1992
2044
  type: 'start-step';
1993
2045
  } | {
@@ -2134,7 +2186,7 @@ interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
2134
2186
  *
2135
2187
  * Automatically consumes the stream.
2136
2188
  */
2137
- readonly reasoning: PromiseLike<Array<ReasoningOutput>>;
2189
+ readonly reasoning: PromiseLike<Array<ReasoningOutput | ReasoningFileOutput>>;
2138
2190
  /**
2139
2191
  * The reasoning that has been generated by the last step.
2140
2192
  *
@@ -2379,6 +2431,10 @@ type TextStreamPart<TOOLS extends ToolSet> = {
2379
2431
  type: 'file';
2380
2432
  file: GeneratedFile;
2381
2433
  providerMetadata?: ProviderMetadata;
2434
+ } | {
2435
+ type: 'reasoning-file';
2436
+ file: GeneratedFile;
2437
+ providerMetadata?: ProviderMetadata;
2382
2438
  } | ({
2383
2439
  type: 'tool-call';
2384
2440
  } & TypedToolCall<TOOLS>) | ({
@@ -3265,7 +3321,7 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
3265
3321
  /**
3266
3322
  * The full reasoning that the model has generated in the last step.
3267
3323
  */
3268
- readonly reasoning: Array<ReasoningOutput>;
3324
+ readonly reasoning: Array<ReasoningOutput | ReasoningFileOutput>;
3269
3325
  /**
3270
3326
  * The reasoning text that the model has generated in the last step. Can be undefined if the model
3271
3327
  * has only generated text.
@@ -4746,6 +4802,10 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
4746
4802
  type: 'file';
4747
4803
  file: GeneratedFile;
4748
4804
  providerMetadata?: ProviderMetadata;
4805
+ } | {
4806
+ type: 'reasoning-file';
4807
+ file: GeneratedFile;
4808
+ providerMetadata?: ProviderMetadata;
4749
4809
  } | ({
4750
4810
  type: 'tool-call';
4751
4811
  } & TypedToolCall<TOOLS>) | ({
@@ -6574,4 +6634,4 @@ declare global {
6574
6634
  var AI_SDK_TELEMETRY_INTEGRATIONS: TelemetryIntegration[] | undefined;
6575
6635
  }
6576
6636
 
6577
- export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStartCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentOnStepStartCallback, ToolLoopAgentOnToolCallFinishCallback, ToolLoopAgentOnToolCallStartCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
6637
+ export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStartCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentOnStepStartCallback, ToolLoopAgentOnToolCallFinishCallback, ToolLoopAgentOnToolCallStartCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { GatewayModelId } from '@ai-sdk/gateway';
2
2
  export { GatewayModelId, createGateway, gateway } from '@ai-sdk/gateway';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
- import { Tool, InferToolInput, InferToolOutput, FlexibleSchema, InferSchema, SystemModelMessage, ModelMessage, AssistantModelMessage, ToolModelMessage, ReasoningPart, ProviderOptions, UserModelMessage, IdGenerator, ToolCall, MaybePromiseLike, TextPart, FilePart, Resolvable, FetchFunction, DataContent } from '@ai-sdk/provider-utils';
4
+ import { Tool, InferToolInput, InferToolOutput, FlexibleSchema, InferSchema, SystemModelMessage, ModelMessage, AssistantModelMessage, ToolModelMessage, ReasoningPart, ReasoningFilePart, ProviderOptions, UserModelMessage, IdGenerator, ToolCall, MaybePromiseLike, TextPart, FilePart, Resolvable, FetchFunction, DataContent } from '@ai-sdk/provider-utils';
5
5
  export { AssistantContent, AssistantModelMessage, DataContent, DownloadError, FilePart, FlexibleSchema, IdGenerator, ImagePart, InferSchema, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolExecutionOptions, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
6
6
  import * as _ai_sdk_provider from '@ai-sdk/provider';
7
7
  import { EmbeddingModelV4, EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV4Embedding, EmbeddingModelV4Middleware, ImageModelV4, ImageModelV3, ImageModelV2, ImageModelV4ProviderMetadata, ImageModelV2ProviderMetadata, ImageModelV4Middleware, JSONValue as JSONValue$1, LanguageModelV4, LanguageModelV3, LanguageModelV2, SharedV4Warning, LanguageModelV4Source, LanguageModelV4Middleware, RerankingModelV4, RerankingModelV3, SharedV4ProviderMetadata, SpeechModelV4, SpeechModelV3, SpeechModelV2, TranscriptionModelV4, TranscriptionModelV3, TranscriptionModelV2, JSONObject, ImageModelV4Usage, AISDKError, LanguageModelV4ToolCall, JSONSchema7, LanguageModelV4ToolChoice, LanguageModelV4CallOptions, JSONParseError, TypeValidationError, Experimental_VideoModelV4, Experimental_VideoModelV3, EmbeddingModelV4CallOptions, ProviderV4, ProviderV3, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
@@ -511,6 +511,23 @@ interface ReasoningOutput {
511
511
  */
512
512
  providerMetadata?: ProviderMetadata;
513
513
  }
514
+ /**
515
+ * Reasoning file output of a text generation.
516
+ * It contains a file generated as part of reasoning.
517
+ */
518
+ interface ReasoningFileOutput {
519
+ type: 'reasoning-file';
520
+ /**
521
+ * The generated file.
522
+ */
523
+ file: GeneratedFile;
524
+ /**
525
+ * Additional provider-specific metadata. They are passed through
526
+ * to the provider from the AI SDK and enable provider-specific
527
+ * functionality that can be fully encapsulated in the provider.
528
+ */
529
+ providerMetadata?: ProviderMetadata;
530
+ }
514
531
 
515
532
  type StaticToolError<TOOLS extends ToolSet> = ValueOf<{
516
533
  [NAME in keyof TOOLS]: {
@@ -570,7 +587,7 @@ type ContentPart<TOOLS extends ToolSet> = {
570
587
  type: 'text';
571
588
  text: string;
572
589
  providerMetadata?: ProviderMetadata;
573
- } | ReasoningOutput | ({
590
+ } | ReasoningOutput | ReasoningFileOutput | ({
574
591
  type: 'source';
575
592
  } & Source) | {
576
593
  type: 'file';
@@ -786,7 +803,7 @@ type StepResult<TOOLS extends ToolSet> = {
786
803
  /**
787
804
  * The reasoning that was generated during the generation.
788
805
  */
789
- readonly reasoning: Array<ReasoningPart>;
806
+ readonly reasoning: Array<ReasoningPart | ReasoningFilePart>;
790
807
  /**
791
808
  * The reasoning text that was generated during the generation.
792
809
  */
@@ -1413,7 +1430,7 @@ interface UIMessage<METADATA = unknown, DATA_PARTS extends UIDataTypes = UIDataT
1413
1430
  */
1414
1431
  parts: Array<UIMessagePart<DATA_PARTS, TOOLS>>;
1415
1432
  }
1416
- type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
1433
+ type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | ReasoningFileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
1417
1434
  /**
1418
1435
  * A text part of a message.
1419
1436
  */
@@ -1496,6 +1513,27 @@ type FileUIPart = {
1496
1513
  */
1497
1514
  providerMetadata?: ProviderMetadata;
1498
1515
  };
1516
+ /**
1517
+ * A reasoning file part of a message.
1518
+ */
1519
+ type ReasoningFileUIPart = {
1520
+ type: 'reasoning-file';
1521
+ /**
1522
+ * IANA media type of the file.
1523
+ *
1524
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1525
+ */
1526
+ mediaType: string;
1527
+ /**
1528
+ * The URL of the file.
1529
+ * It can either be a URL to a hosted file or a [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs).
1530
+ */
1531
+ url: string;
1532
+ /**
1533
+ * The provider metadata.
1534
+ */
1535
+ providerMetadata?: ProviderMetadata;
1536
+ };
1499
1537
  /**
1500
1538
  * A step boundary part of a message.
1501
1539
  */
@@ -1704,6 +1742,10 @@ declare function isTextUIPart(part: UIMessagePart<UIDataTypes, UITools>): part i
1704
1742
  * Type guard to check if a message part is a file part.
1705
1743
  */
1706
1744
  declare function isFileUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is FileUIPart;
1745
+ /**
1746
+ * Type guard to check if a message part is a reasoning file part.
1747
+ */
1748
+ declare function isReasoningFileUIPart(part: UIMessagePart<UIDataTypes, UITools>): part is ReasoningFileUIPart;
1707
1749
  /**
1708
1750
  * Type guard to check if a message part is a reasoning part.
1709
1751
  */
@@ -1856,6 +1898,11 @@ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1856
1898
  url: string;
1857
1899
  mediaType: string;
1858
1900
  providerMetadata?: _ai_sdk_provider.SharedV4ProviderMetadata | undefined;
1901
+ } | {
1902
+ type: "reasoning-file";
1903
+ url: string;
1904
+ mediaType: string;
1905
+ providerMetadata?: _ai_sdk_provider.SharedV4ProviderMetadata | undefined;
1859
1906
  } | {
1860
1907
  type: `data-${string}`;
1861
1908
  data: unknown;
@@ -1988,6 +2035,11 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
1988
2035
  url: string;
1989
2036
  mediaType: string;
1990
2037
  providerMetadata?: ProviderMetadata;
2038
+ } | {
2039
+ type: 'reasoning-file';
2040
+ url: string;
2041
+ mediaType: string;
2042
+ providerMetadata?: ProviderMetadata;
1991
2043
  } | DataUIMessageChunk<DATA_TYPES> | {
1992
2044
  type: 'start-step';
1993
2045
  } | {
@@ -2134,7 +2186,7 @@ interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
2134
2186
  *
2135
2187
  * Automatically consumes the stream.
2136
2188
  */
2137
- readonly reasoning: PromiseLike<Array<ReasoningOutput>>;
2189
+ readonly reasoning: PromiseLike<Array<ReasoningOutput | ReasoningFileOutput>>;
2138
2190
  /**
2139
2191
  * The reasoning that has been generated by the last step.
2140
2192
  *
@@ -2379,6 +2431,10 @@ type TextStreamPart<TOOLS extends ToolSet> = {
2379
2431
  type: 'file';
2380
2432
  file: GeneratedFile;
2381
2433
  providerMetadata?: ProviderMetadata;
2434
+ } | {
2435
+ type: 'reasoning-file';
2436
+ file: GeneratedFile;
2437
+ providerMetadata?: ProviderMetadata;
2382
2438
  } | ({
2383
2439
  type: 'tool-call';
2384
2440
  } & TypedToolCall<TOOLS>) | ({
@@ -3265,7 +3321,7 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
3265
3321
  /**
3266
3322
  * The full reasoning that the model has generated in the last step.
3267
3323
  */
3268
- readonly reasoning: Array<ReasoningOutput>;
3324
+ readonly reasoning: Array<ReasoningOutput | ReasoningFileOutput>;
3269
3325
  /**
3270
3326
  * The reasoning text that the model has generated in the last step. Can be undefined if the model
3271
3327
  * has only generated text.
@@ -4746,6 +4802,10 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
4746
4802
  type: 'file';
4747
4803
  file: GeneratedFile;
4748
4804
  providerMetadata?: ProviderMetadata;
4805
+ } | {
4806
+ type: 'reasoning-file';
4807
+ file: GeneratedFile;
4808
+ providerMetadata?: ProviderMetadata;
4749
4809
  } | ({
4750
4810
  type: 'tool-call';
4751
4811
  } & TypedToolCall<TOOLS>) | ({
@@ -6574,4 +6634,4 @@ declare global {
6574
6634
  var AI_SDK_TELEMETRY_INTEGRATIONS: TelemetryIntegration[] | undefined;
6575
6635
  }
6576
6636
 
6577
- export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStartCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentOnStepStartCallback, ToolLoopAgentOnToolCallFinishCallback, ToolLoopAgentOnToolCallStartCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
6637
+ export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStartCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentOnStepStartCallback, ToolLoopAgentOnToolCallFinishCallback, ToolLoopAgentOnToolCallStartCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };