ai 5.1.0-beta.6 → 5.1.0-beta.8
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 +12 -0
- package/dist/index.d.mts +113 -2
- package/dist/index.d.ts +113 -2
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -10
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.1.0-beta.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7eca093: fix(ai): update `uiMessageChunkSchema` to satisfy the `UIMessageChunk` type
|
|
8
|
+
|
|
9
|
+
## 5.1.0-beta.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 5a4e732: Export `parseJsonEventStream` and `uiMessageChunkSchema` from "ai" package
|
|
14
|
+
|
|
3
15
|
## 5.1.0-beta.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { createGateway, gateway } from '@ai-sdk/gateway';
|
|
2
2
|
import { ModelMessage, Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, Schema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, InferSchema, FlexibleSchema, DataContent, Validator, StandardSchemaV1, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
export { AssistantContent, AssistantModelMessage, DataContent, FilePart, IdGenerator, ImagePart, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, tool, zodSchema } from '@ai-sdk/provider-utils';
|
|
3
|
+
export { AssistantContent, AssistantModelMessage, DataContent, FilePart, IdGenerator, ImagePart, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
|
5
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
5
6
|
import { EmbeddingModelV3, EmbeddingModelV3Embedding, ImageModelV2, ImageModelV2CallWarning, ImageModelV2ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2CallWarning, LanguageModelV2Source, LanguageModelV2Middleware, SharedV2ProviderMetadata, SpeechModelV2, SpeechModelV2CallWarning, TranscriptionModelV2, TranscriptionModelV2CallWarning, LanguageModelV2Usage, LanguageModelV2CallOptions, AISDKError, LanguageModelV2ToolCall, JSONSchema7, JSONParseError, TypeValidationError, ProviderV2, NoSuchModelError, JSONObject } from '@ai-sdk/provider';
|
|
6
7
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
|
7
8
|
import * as z3 from 'zod/v3';
|
|
@@ -1593,6 +1594,115 @@ type InferUIMessageToolCall<UI_MESSAGE extends UIMessage> = ValueOf<{
|
|
|
1593
1594
|
dynamic: true;
|
|
1594
1595
|
});
|
|
1595
1596
|
|
|
1597
|
+
declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1598
|
+
type: z.ZodLiteral<"text-start">;
|
|
1599
|
+
id: z.ZodString;
|
|
1600
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1602
|
+
type: z.ZodLiteral<"text-delta">;
|
|
1603
|
+
id: z.ZodString;
|
|
1604
|
+
delta: z.ZodString;
|
|
1605
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1606
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1607
|
+
type: z.ZodLiteral<"text-end">;
|
|
1608
|
+
id: z.ZodString;
|
|
1609
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1610
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1611
|
+
type: z.ZodLiteral<"error">;
|
|
1612
|
+
errorText: z.ZodString;
|
|
1613
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1614
|
+
type: z.ZodLiteral<"tool-input-start">;
|
|
1615
|
+
toolCallId: z.ZodString;
|
|
1616
|
+
toolName: z.ZodString;
|
|
1617
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1618
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1619
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1620
|
+
type: z.ZodLiteral<"tool-input-delta">;
|
|
1621
|
+
toolCallId: z.ZodString;
|
|
1622
|
+
inputTextDelta: z.ZodString;
|
|
1623
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1624
|
+
type: z.ZodLiteral<"tool-input-available">;
|
|
1625
|
+
toolCallId: z.ZodString;
|
|
1626
|
+
toolName: z.ZodString;
|
|
1627
|
+
input: z.ZodUnknown;
|
|
1628
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1629
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1630
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1631
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1632
|
+
type: z.ZodLiteral<"tool-input-error">;
|
|
1633
|
+
toolCallId: z.ZodString;
|
|
1634
|
+
toolName: z.ZodString;
|
|
1635
|
+
input: z.ZodUnknown;
|
|
1636
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1637
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1638
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1639
|
+
errorText: z.ZodString;
|
|
1640
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1641
|
+
type: z.ZodLiteral<"tool-output-available">;
|
|
1642
|
+
toolCallId: z.ZodString;
|
|
1643
|
+
output: z.ZodUnknown;
|
|
1644
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1645
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1646
|
+
preliminary: z.ZodOptional<z.ZodBoolean>;
|
|
1647
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1648
|
+
type: z.ZodLiteral<"tool-output-error">;
|
|
1649
|
+
toolCallId: z.ZodString;
|
|
1650
|
+
errorText: z.ZodString;
|
|
1651
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1652
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1653
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1654
|
+
type: z.ZodLiteral<"reasoning-start">;
|
|
1655
|
+
id: z.ZodString;
|
|
1656
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1657
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1658
|
+
type: z.ZodLiteral<"reasoning-delta">;
|
|
1659
|
+
id: z.ZodString;
|
|
1660
|
+
delta: z.ZodString;
|
|
1661
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1662
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1663
|
+
type: z.ZodLiteral<"reasoning-end">;
|
|
1664
|
+
id: z.ZodString;
|
|
1665
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1666
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1667
|
+
type: z.ZodLiteral<"source-url">;
|
|
1668
|
+
sourceId: z.ZodString;
|
|
1669
|
+
url: z.ZodString;
|
|
1670
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1671
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1672
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1673
|
+
type: z.ZodLiteral<"source-document">;
|
|
1674
|
+
sourceId: z.ZodString;
|
|
1675
|
+
mediaType: z.ZodString;
|
|
1676
|
+
title: z.ZodString;
|
|
1677
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1678
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1679
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1680
|
+
type: z.ZodLiteral<"file">;
|
|
1681
|
+
url: z.ZodString;
|
|
1682
|
+
mediaType: z.ZodString;
|
|
1683
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1684
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1685
|
+
type: z.ZodCustom<`data-${string}`, `data-${string}`>;
|
|
1686
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1687
|
+
data: z.ZodUnknown;
|
|
1688
|
+
transient: z.ZodOptional<z.ZodBoolean>;
|
|
1689
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1690
|
+
type: z.ZodLiteral<"start-step">;
|
|
1691
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1692
|
+
type: z.ZodLiteral<"finish-step">;
|
|
1693
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1694
|
+
type: z.ZodLiteral<"start">;
|
|
1695
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1696
|
+
messageMetadata: z.ZodOptional<z.ZodUnknown>;
|
|
1697
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1698
|
+
type: z.ZodLiteral<"finish">;
|
|
1699
|
+
messageMetadata: z.ZodOptional<z.ZodUnknown>;
|
|
1700
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1701
|
+
type: z.ZodLiteral<"abort">;
|
|
1702
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1703
|
+
type: z.ZodLiteral<"message-metadata">;
|
|
1704
|
+
messageMetadata: z.ZodUnknown;
|
|
1705
|
+
}, z.core.$strict>]>;
|
|
1596
1706
|
type DataUIMessageChunk<DATA_TYPES extends UIDataTypes> = ValueOf<{
|
|
1597
1707
|
[NAME in keyof DATA_TYPES & string]: {
|
|
1598
1708
|
type: `data-${NAME}`;
|
|
@@ -1687,6 +1797,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
1687
1797
|
type: 'file';
|
|
1688
1798
|
url: string;
|
|
1689
1799
|
mediaType: string;
|
|
1800
|
+
providerMetadata?: ProviderMetadata;
|
|
1690
1801
|
} | DataUIMessageChunk<DATA_TYPES> | {
|
|
1691
1802
|
type: 'start-step';
|
|
1692
1803
|
} | {
|
|
@@ -4510,4 +4621,4 @@ declare global {
|
|
|
4510
4621
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4511
4622
|
}
|
|
4512
4623
|
|
|
4513
|
-
export { AbstractChat, AsyncIterableStream, CallSettings, CallWarning, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, Agent as Experimental_Agent, AgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, 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, getToolOrDynamicToolName, hasToolCall, isDeepEqualData, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|
|
4624
|
+
export { AbstractChat, AsyncIterableStream, CallSettings, CallWarning, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, Agent as Experimental_Agent, AgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, 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, getToolOrDynamicToolName, hasToolCall, isDeepEqualData, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { createGateway, gateway } from '@ai-sdk/gateway';
|
|
2
2
|
import { ModelMessage, Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, Schema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, InferSchema, FlexibleSchema, DataContent, Validator, StandardSchemaV1, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
export { AssistantContent, AssistantModelMessage, DataContent, FilePart, IdGenerator, ImagePart, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, tool, zodSchema } from '@ai-sdk/provider-utils';
|
|
3
|
+
export { AssistantContent, AssistantModelMessage, DataContent, FilePart, IdGenerator, ImagePart, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
|
5
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
5
6
|
import { EmbeddingModelV3, EmbeddingModelV3Embedding, ImageModelV2, ImageModelV2CallWarning, ImageModelV2ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2CallWarning, LanguageModelV2Source, LanguageModelV2Middleware, SharedV2ProviderMetadata, SpeechModelV2, SpeechModelV2CallWarning, TranscriptionModelV2, TranscriptionModelV2CallWarning, LanguageModelV2Usage, LanguageModelV2CallOptions, AISDKError, LanguageModelV2ToolCall, JSONSchema7, JSONParseError, TypeValidationError, ProviderV2, NoSuchModelError, JSONObject } from '@ai-sdk/provider';
|
|
6
7
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
|
7
8
|
import * as z3 from 'zod/v3';
|
|
@@ -1593,6 +1594,115 @@ type InferUIMessageToolCall<UI_MESSAGE extends UIMessage> = ValueOf<{
|
|
|
1593
1594
|
dynamic: true;
|
|
1594
1595
|
});
|
|
1595
1596
|
|
|
1597
|
+
declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1598
|
+
type: z.ZodLiteral<"text-start">;
|
|
1599
|
+
id: z.ZodString;
|
|
1600
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1602
|
+
type: z.ZodLiteral<"text-delta">;
|
|
1603
|
+
id: z.ZodString;
|
|
1604
|
+
delta: z.ZodString;
|
|
1605
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1606
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1607
|
+
type: z.ZodLiteral<"text-end">;
|
|
1608
|
+
id: z.ZodString;
|
|
1609
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1610
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1611
|
+
type: z.ZodLiteral<"error">;
|
|
1612
|
+
errorText: z.ZodString;
|
|
1613
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1614
|
+
type: z.ZodLiteral<"tool-input-start">;
|
|
1615
|
+
toolCallId: z.ZodString;
|
|
1616
|
+
toolName: z.ZodString;
|
|
1617
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1618
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1619
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1620
|
+
type: z.ZodLiteral<"tool-input-delta">;
|
|
1621
|
+
toolCallId: z.ZodString;
|
|
1622
|
+
inputTextDelta: z.ZodString;
|
|
1623
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1624
|
+
type: z.ZodLiteral<"tool-input-available">;
|
|
1625
|
+
toolCallId: z.ZodString;
|
|
1626
|
+
toolName: z.ZodString;
|
|
1627
|
+
input: z.ZodUnknown;
|
|
1628
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1629
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1630
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1631
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1632
|
+
type: z.ZodLiteral<"tool-input-error">;
|
|
1633
|
+
toolCallId: z.ZodString;
|
|
1634
|
+
toolName: z.ZodString;
|
|
1635
|
+
input: z.ZodUnknown;
|
|
1636
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1637
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1638
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1639
|
+
errorText: z.ZodString;
|
|
1640
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1641
|
+
type: z.ZodLiteral<"tool-output-available">;
|
|
1642
|
+
toolCallId: z.ZodString;
|
|
1643
|
+
output: z.ZodUnknown;
|
|
1644
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1645
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1646
|
+
preliminary: z.ZodOptional<z.ZodBoolean>;
|
|
1647
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1648
|
+
type: z.ZodLiteral<"tool-output-error">;
|
|
1649
|
+
toolCallId: z.ZodString;
|
|
1650
|
+
errorText: z.ZodString;
|
|
1651
|
+
providerExecuted: z.ZodOptional<z.ZodBoolean>;
|
|
1652
|
+
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
1653
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1654
|
+
type: z.ZodLiteral<"reasoning-start">;
|
|
1655
|
+
id: z.ZodString;
|
|
1656
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1657
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1658
|
+
type: z.ZodLiteral<"reasoning-delta">;
|
|
1659
|
+
id: z.ZodString;
|
|
1660
|
+
delta: z.ZodString;
|
|
1661
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1662
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1663
|
+
type: z.ZodLiteral<"reasoning-end">;
|
|
1664
|
+
id: z.ZodString;
|
|
1665
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1666
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1667
|
+
type: z.ZodLiteral<"source-url">;
|
|
1668
|
+
sourceId: z.ZodString;
|
|
1669
|
+
url: z.ZodString;
|
|
1670
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1671
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1672
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1673
|
+
type: z.ZodLiteral<"source-document">;
|
|
1674
|
+
sourceId: z.ZodString;
|
|
1675
|
+
mediaType: z.ZodString;
|
|
1676
|
+
title: z.ZodString;
|
|
1677
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
1678
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1679
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1680
|
+
type: z.ZodLiteral<"file">;
|
|
1681
|
+
url: z.ZodString;
|
|
1682
|
+
mediaType: z.ZodString;
|
|
1683
|
+
providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
|
|
1684
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1685
|
+
type: z.ZodCustom<`data-${string}`, `data-${string}`>;
|
|
1686
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1687
|
+
data: z.ZodUnknown;
|
|
1688
|
+
transient: z.ZodOptional<z.ZodBoolean>;
|
|
1689
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1690
|
+
type: z.ZodLiteral<"start-step">;
|
|
1691
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1692
|
+
type: z.ZodLiteral<"finish-step">;
|
|
1693
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1694
|
+
type: z.ZodLiteral<"start">;
|
|
1695
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1696
|
+
messageMetadata: z.ZodOptional<z.ZodUnknown>;
|
|
1697
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1698
|
+
type: z.ZodLiteral<"finish">;
|
|
1699
|
+
messageMetadata: z.ZodOptional<z.ZodUnknown>;
|
|
1700
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1701
|
+
type: z.ZodLiteral<"abort">;
|
|
1702
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1703
|
+
type: z.ZodLiteral<"message-metadata">;
|
|
1704
|
+
messageMetadata: z.ZodUnknown;
|
|
1705
|
+
}, z.core.$strict>]>;
|
|
1596
1706
|
type DataUIMessageChunk<DATA_TYPES extends UIDataTypes> = ValueOf<{
|
|
1597
1707
|
[NAME in keyof DATA_TYPES & string]: {
|
|
1598
1708
|
type: `data-${NAME}`;
|
|
@@ -1687,6 +1797,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
1687
1797
|
type: 'file';
|
|
1688
1798
|
url: string;
|
|
1689
1799
|
mediaType: string;
|
|
1800
|
+
providerMetadata?: ProviderMetadata;
|
|
1690
1801
|
} | DataUIMessageChunk<DATA_TYPES> | {
|
|
1691
1802
|
type: 'start-step';
|
|
1692
1803
|
} | {
|
|
@@ -4510,4 +4621,4 @@ declare global {
|
|
|
4510
4621
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4511
4622
|
}
|
|
4512
4623
|
|
|
4513
|
-
export { AbstractChat, AsyncIterableStream, CallSettings, CallWarning, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, Agent as Experimental_Agent, AgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, 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, getToolOrDynamicToolName, hasToolCall, isDeepEqualData, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|
|
4624
|
+
export { AbstractChat, AsyncIterableStream, CallSettings, CallWarning, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, Agent as Experimental_Agent, AgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, 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, getToolOrDynamicToolName, hasToolCall, isDeepEqualData, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|
package/dist/index.js
CHANGED
|
@@ -103,6 +103,7 @@ __export(src_exports, {
|
|
|
103
103
|
jsonSchema: () => import_provider_utils35.jsonSchema,
|
|
104
104
|
lastAssistantMessageIsCompleteWithToolCalls: () => lastAssistantMessageIsCompleteWithToolCalls,
|
|
105
105
|
modelMessageSchema: () => modelMessageSchema,
|
|
106
|
+
parseJsonEventStream: () => import_provider_utils35.parseJsonEventStream,
|
|
106
107
|
parsePartialJson: () => parsePartialJson,
|
|
107
108
|
pipeTextStreamToResponse: () => pipeTextStreamToResponse,
|
|
108
109
|
pipeUIMessageStreamToResponse: () => pipeUIMessageStreamToResponse,
|
|
@@ -117,6 +118,7 @@ __export(src_exports, {
|
|
|
117
118
|
systemModelMessageSchema: () => systemModelMessageSchema,
|
|
118
119
|
tool: () => import_provider_utils35.tool,
|
|
119
120
|
toolModelMessageSchema: () => toolModelMessageSchema,
|
|
121
|
+
uiMessageChunkSchema: () => uiMessageChunkSchema,
|
|
120
122
|
userModelMessageSchema: () => userModelMessageSchema,
|
|
121
123
|
validateUIMessages: () => validateUIMessages,
|
|
122
124
|
wrapLanguageModel: () => wrapLanguageModel,
|
|
@@ -766,7 +768,7 @@ function detectMediaType({
|
|
|
766
768
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
767
769
|
|
|
768
770
|
// src/version.ts
|
|
769
|
-
var VERSION = true ? "5.1.0-beta.
|
|
771
|
+
var VERSION = true ? "5.1.0-beta.8" : "0.0.0-test";
|
|
770
772
|
|
|
771
773
|
// src/util/download/download.ts
|
|
772
774
|
var download = async ({ url }) => {
|
|
@@ -2988,11 +2990,6 @@ var uiMessageChunkSchema = import_v47.z.union([
|
|
|
2988
2990
|
providerExecuted: import_v47.z.boolean().optional(),
|
|
2989
2991
|
dynamic: import_v47.z.boolean().optional()
|
|
2990
2992
|
}),
|
|
2991
|
-
import_v47.z.strictObject({
|
|
2992
|
-
type: import_v47.z.literal("reasoning"),
|
|
2993
|
-
text: import_v47.z.string(),
|
|
2994
|
-
providerMetadata: providerMetadataSchema.optional()
|
|
2995
|
-
}),
|
|
2996
2993
|
import_v47.z.strictObject({
|
|
2997
2994
|
type: import_v47.z.literal("reasoning-start"),
|
|
2998
2995
|
id: import_v47.z.string(),
|
|
@@ -3009,9 +3006,6 @@ var uiMessageChunkSchema = import_v47.z.union([
|
|
|
3009
3006
|
id: import_v47.z.string(),
|
|
3010
3007
|
providerMetadata: providerMetadataSchema.optional()
|
|
3011
3008
|
}),
|
|
3012
|
-
import_v47.z.strictObject({
|
|
3013
|
-
type: import_v47.z.literal("reasoning-part-finish")
|
|
3014
|
-
}),
|
|
3015
3009
|
import_v47.z.strictObject({
|
|
3016
3010
|
type: import_v47.z.literal("source-url"),
|
|
3017
3011
|
sourceId: import_v47.z.string(),
|
|
@@ -3034,7 +3028,10 @@ var uiMessageChunkSchema = import_v47.z.union([
|
|
|
3034
3028
|
providerMetadata: providerMetadataSchema.optional()
|
|
3035
3029
|
}),
|
|
3036
3030
|
import_v47.z.strictObject({
|
|
3037
|
-
type: import_v47.z.
|
|
3031
|
+
type: import_v47.z.custom(
|
|
3032
|
+
(value) => typeof value === "string" && value.startsWith("data-"),
|
|
3033
|
+
{ message: 'Type must start with "data-"' }
|
|
3034
|
+
),
|
|
3038
3035
|
id: import_v47.z.string().optional(),
|
|
3039
3036
|
data: import_v47.z.unknown(),
|
|
3040
3037
|
transient: import_v47.z.boolean().optional()
|
|
@@ -10470,6 +10467,7 @@ function readUIMessageStream({
|
|
|
10470
10467
|
jsonSchema,
|
|
10471
10468
|
lastAssistantMessageIsCompleteWithToolCalls,
|
|
10472
10469
|
modelMessageSchema,
|
|
10470
|
+
parseJsonEventStream,
|
|
10473
10471
|
parsePartialJson,
|
|
10474
10472
|
pipeTextStreamToResponse,
|
|
10475
10473
|
pipeUIMessageStreamToResponse,
|
|
@@ -10484,6 +10482,7 @@ function readUIMessageStream({
|
|
|
10484
10482
|
systemModelMessageSchema,
|
|
10485
10483
|
tool,
|
|
10486
10484
|
toolModelMessageSchema,
|
|
10485
|
+
uiMessageChunkSchema,
|
|
10487
10486
|
userModelMessageSchema,
|
|
10488
10487
|
validateUIMessages,
|
|
10489
10488
|
wrapLanguageModel,
|