ai 5.1.0-beta.1 → 5.1.0-beta.11
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 +86 -0
- package/dist/index.d.mts +147 -28
- package/dist/index.d.ts +147 -28
- package/dist/index.js +26 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -23
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -7
- package/dist/internal/index.mjs.map +1 -1
- package/dist/test/index.d.mts +32 -32
- package/dist/test/index.d.ts +32 -32
- package/dist/test/index.js +14 -14
- package/dist/test/index.js.map +1 -1
- package/dist/test/index.mjs +11 -11
- package/dist/test/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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
|
|
5
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
6
|
+
import { EmbeddingModelV3, EmbeddingModelV3Embedding, ImageModelV3, ImageModelV3CallWarning, ImageModelV3ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2CallWarning, LanguageModelV2Source, LanguageModelV2Middleware, SharedV2ProviderMetadata, SpeechModelV2, SpeechModelV2CallWarning, TranscriptionModelV2, TranscriptionModelV2CallWarning, LanguageModelV2Usage, LanguageModelV2CallOptions, AISDKError, LanguageModelV2ToolCall, JSONSchema7, JSONParseError, TypeValidationError, ProviderV3, 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';
|
|
8
9
|
import * as z4 from 'zod/v4';
|
|
@@ -157,25 +158,25 @@ type TelemetrySettings = {
|
|
|
157
158
|
/**
|
|
158
159
|
Embedding model that is used by the AI SDK Core functions.
|
|
159
160
|
*/
|
|
160
|
-
type EmbeddingModel<VALUE = string> = string |
|
|
161
|
+
type EmbeddingModel<VALUE = string> = string | EmbeddingModelV3<VALUE>;
|
|
161
162
|
/**
|
|
162
163
|
Embedding.
|
|
163
164
|
*/
|
|
164
|
-
type Embedding =
|
|
165
|
+
type Embedding = EmbeddingModelV3Embedding;
|
|
165
166
|
|
|
166
167
|
/**
|
|
167
168
|
Image model that is used by the AI SDK Core functions.
|
|
168
169
|
*/
|
|
169
|
-
type ImageModel =
|
|
170
|
+
type ImageModel = ImageModelV3;
|
|
170
171
|
/**
|
|
171
172
|
Warning from the model provider for this call. The call will proceed, but e.g.
|
|
172
173
|
some settings might not be supported, which can lead to suboptimal results.
|
|
173
174
|
*/
|
|
174
|
-
type ImageGenerationWarning =
|
|
175
|
+
type ImageGenerationWarning = ImageModelV3CallWarning;
|
|
175
176
|
/**
|
|
176
177
|
Metadata from the model provider for this call
|
|
177
178
|
*/
|
|
178
|
-
type ImageModelProviderMetadata =
|
|
179
|
+
type ImageModelProviderMetadata = ImageModelV3ProviderMetadata;
|
|
179
180
|
|
|
180
181
|
type ImageModelResponseMetadata = {
|
|
181
182
|
/**
|
|
@@ -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
|
} | {
|
|
@@ -2723,7 +2834,7 @@ declare function generateImage({ model, prompt, n, maxImagesPerCall, size, aspec
|
|
|
2723
2834
|
/**
|
|
2724
2835
|
The image model to use.
|
|
2725
2836
|
*/
|
|
2726
|
-
model:
|
|
2837
|
+
model: ImageModelV3;
|
|
2727
2838
|
/**
|
|
2728
2839
|
The prompt that should be used to generate the image.
|
|
2729
2840
|
*/
|
|
@@ -3445,7 +3556,7 @@ declare function generateSpeech({ model, text, voice, outputFormat, instructions
|
|
|
3445
3556
|
headers?: Record<string, string>;
|
|
3446
3557
|
}): Promise<SpeechResult>;
|
|
3447
3558
|
|
|
3448
|
-
type Warning = LanguageModelV2CallWarning |
|
|
3559
|
+
type Warning = LanguageModelV2CallWarning | ImageModelV3CallWarning | SpeechModelV2CallWarning | TranscriptionModelV2CallWarning;
|
|
3449
3560
|
type LogWarningsFunction = (warnings: Warning[]) => void;
|
|
3450
3561
|
|
|
3451
3562
|
/**
|
|
@@ -3508,20 +3619,20 @@ declare const wrapLanguageModel: ({ model, middleware: middlewareArg, modelId, p
|
|
|
3508
3619
|
}) => LanguageModelV2;
|
|
3509
3620
|
|
|
3510
3621
|
/**
|
|
3511
|
-
* Wraps a
|
|
3622
|
+
* Wraps a ProviderV3 instance with middleware functionality.
|
|
3512
3623
|
* This function allows you to apply middleware to all language models
|
|
3513
3624
|
* from the provider, enabling you to transform parameters, wrap generate
|
|
3514
3625
|
* operations, and wrap stream operations for every language model.
|
|
3515
3626
|
*
|
|
3516
3627
|
* @param options - Configuration options for wrapping the provider.
|
|
3517
|
-
* @param options.provider - The original
|
|
3628
|
+
* @param options.provider - The original ProviderV3 instance to be wrapped.
|
|
3518
3629
|
* @param options.languageModelMiddleware - The middleware to be applied to all language models from the provider. When multiple middlewares are provided, the first middleware will transform the input first, and the last middleware will be wrapped directly around the model.
|
|
3519
|
-
* @returns A new
|
|
3630
|
+
* @returns A new ProviderV3 instance with middleware applied to all language models.
|
|
3520
3631
|
*/
|
|
3521
3632
|
declare function wrapProvider({ provider, languageModelMiddleware, }: {
|
|
3522
|
-
provider:
|
|
3633
|
+
provider: ProviderV3;
|
|
3523
3634
|
languageModelMiddleware: LanguageModelMiddleware | LanguageModelMiddleware[];
|
|
3524
|
-
}):
|
|
3635
|
+
}): ProviderV3;
|
|
3525
3636
|
|
|
3526
3637
|
/**
|
|
3527
3638
|
* Creates a custom provider with specified language models, text embedding models, image models, transcription models, speech models, and an optional fallback provider.
|
|
@@ -3537,17 +3648,17 @@ declare function wrapProvider({ provider, languageModelMiddleware, }: {
|
|
|
3537
3648
|
*
|
|
3538
3649
|
* @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
|
|
3539
3650
|
*/
|
|
3540
|
-
declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV2>, EMBEDDING_MODELS extends Record<string,
|
|
3651
|
+
declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV2>, EMBEDDING_MODELS extends Record<string, EmbeddingModelV3<string>>, IMAGE_MODELS extends Record<string, ImageModelV3>, TRANSCRIPTION_MODELS extends Record<string, TranscriptionModelV2>, SPEECH_MODELS extends Record<string, SpeechModelV2>>({ languageModels, textEmbeddingModels, imageModels, transcriptionModels, speechModels, fallbackProvider, }: {
|
|
3541
3652
|
languageModels?: LANGUAGE_MODELS;
|
|
3542
3653
|
textEmbeddingModels?: EMBEDDING_MODELS;
|
|
3543
3654
|
imageModels?: IMAGE_MODELS;
|
|
3544
3655
|
transcriptionModels?: TRANSCRIPTION_MODELS;
|
|
3545
3656
|
speechModels?: SPEECH_MODELS;
|
|
3546
|
-
fallbackProvider?:
|
|
3547
|
-
}):
|
|
3657
|
+
fallbackProvider?: ProviderV3;
|
|
3658
|
+
}): ProviderV3 & {
|
|
3548
3659
|
languageModel(modelId: ExtractModelId<LANGUAGE_MODELS>): LanguageModelV2;
|
|
3549
|
-
textEmbeddingModel(modelId: ExtractModelId<EMBEDDING_MODELS>):
|
|
3550
|
-
imageModel(modelId: ExtractModelId<IMAGE_MODELS>):
|
|
3660
|
+
textEmbeddingModel(modelId: ExtractModelId<EMBEDDING_MODELS>): EmbeddingModelV3<string>;
|
|
3661
|
+
imageModel(modelId: ExtractModelId<IMAGE_MODELS>): ImageModelV3;
|
|
3551
3662
|
transcriptionModel(modelId: ExtractModelId<TRANSCRIPTION_MODELS>): TranscriptionModelV2;
|
|
3552
3663
|
speechModel(modelId: ExtractModelId<SPEECH_MODELS>): SpeechModelV2;
|
|
3553
3664
|
};
|
|
@@ -3573,13 +3684,13 @@ declare class NoSuchProviderError extends NoSuchModelError {
|
|
|
3573
3684
|
}
|
|
3574
3685
|
|
|
3575
3686
|
type ExtractLiteralUnion<T> = T extends string ? string extends T ? never : T : never;
|
|
3576
|
-
interface ProviderRegistryProvider<PROVIDERS extends Record<string,
|
|
3687
|
+
interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV3> = Record<string, ProviderV3>, SEPARATOR extends string = ':'> {
|
|
3577
3688
|
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['languageModel']>>[0]>}` : never): LanguageModelV2;
|
|
3578
3689
|
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): LanguageModelV2;
|
|
3579
|
-
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['textEmbeddingModel']>>[0]>}` : never):
|
|
3580
|
-
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never):
|
|
3581
|
-
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['imageModel']>>[0]>}` : never):
|
|
3582
|
-
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never):
|
|
3690
|
+
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['textEmbeddingModel']>>[0]>}` : never): EmbeddingModelV3<string>;
|
|
3691
|
+
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): EmbeddingModelV3<string>;
|
|
3692
|
+
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['imageModel']>>[0]>}` : never): ImageModelV3;
|
|
3693
|
+
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): ImageModelV3;
|
|
3583
3694
|
transcriptionModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['transcriptionModel']>>[0]>}` : never): TranscriptionModelV2;
|
|
3584
3695
|
transcriptionModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): TranscriptionModelV2;
|
|
3585
3696
|
speechModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['speechModel']>>[0]>}` : never): SpeechModelV2;
|
|
@@ -3597,7 +3708,7 @@ interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV2>
|
|
|
3597
3708
|
* @param options.languageModelMiddleware - Optional middleware to be applied to all language models from the registry. When multiple middlewares are provided, the first middleware will transform the input first, and the last middleware will be wrapped directly around the model.
|
|
3598
3709
|
* @returns A new ProviderRegistryProvider instance that provides access to all registered providers with optional middleware applied to language models.
|
|
3599
3710
|
*/
|
|
3600
|
-
declare function createProviderRegistry<PROVIDERS extends Record<string,
|
|
3711
|
+
declare function createProviderRegistry<PROVIDERS extends Record<string, ProviderV3>, SEPARATOR extends string = ':'>(providers: PROVIDERS, { separator, languageModelMiddleware, }?: {
|
|
3601
3712
|
separator?: SEPARATOR;
|
|
3602
3713
|
languageModelMiddleware?: LanguageModelMiddleware | LanguageModelMiddleware[];
|
|
3603
3714
|
}): ProviderRegistryProvider<PROVIDERS, SEPARATOR>;
|
|
@@ -4216,10 +4327,18 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
4216
4327
|
* Clear the error state and set the status to ready if the chat is in an error state.
|
|
4217
4328
|
*/
|
|
4218
4329
|
clearError: () => void;
|
|
4219
|
-
addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ tool, toolCallId, output, }: {
|
|
4330
|
+
addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
|
|
4331
|
+
state?: "output-available";
|
|
4220
4332
|
tool: TOOL;
|
|
4221
4333
|
toolCallId: string;
|
|
4222
4334
|
output: InferUIMessageTools<UI_MESSAGE>[TOOL]["output"];
|
|
4335
|
+
errorText?: never;
|
|
4336
|
+
} | {
|
|
4337
|
+
state: "output-error";
|
|
4338
|
+
tool: TOOL;
|
|
4339
|
+
toolCallId: string;
|
|
4340
|
+
output?: never;
|
|
4341
|
+
errorText: string;
|
|
4223
4342
|
}) => Promise<void>;
|
|
4224
4343
|
/**
|
|
4225
4344
|
* Abort the current request immediately, keep the generated tokens if any.
|
|
@@ -4499,7 +4618,7 @@ declare global {
|
|
|
4499
4618
|
*
|
|
4500
4619
|
* @see https://ai-sdk.dev/docs/ai-sdk-core/provider-management#global-provider-configuration
|
|
4501
4620
|
*/
|
|
4502
|
-
var AI_SDK_DEFAULT_PROVIDER:
|
|
4621
|
+
var AI_SDK_DEFAULT_PROVIDER: ProviderV3 | undefined;
|
|
4503
4622
|
/**
|
|
4504
4623
|
* The warning logger to use for the AI SDK.
|
|
4505
4624
|
*
|
|
@@ -4510,4 +4629,4 @@ declare global {
|
|
|
4510
4629
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4511
4630
|
}
|
|
4512
4631
|
|
|
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 };
|
|
4632
|
+
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,
|
|
@@ -556,7 +558,7 @@ function resolveLanguageModel(model) {
|
|
|
556
558
|
}
|
|
557
559
|
function resolveEmbeddingModel(model) {
|
|
558
560
|
if (typeof model !== "string") {
|
|
559
|
-
if (model.specificationVersion !== "
|
|
561
|
+
if (model.specificationVersion !== "v3") {
|
|
560
562
|
throw new UnsupportedModelVersionError({
|
|
561
563
|
version: model.specificationVersion,
|
|
562
564
|
provider: model.provider,
|
|
@@ -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.11" : "0.0.0-test";
|
|
770
772
|
|
|
771
773
|
// src/util/download/download.ts
|
|
772
774
|
var download = async ({ url }) => {
|
|
@@ -1056,12 +1058,12 @@ async function downloadAssets(messages, download2, supportedUrls) {
|
|
|
1056
1058
|
}));
|
|
1057
1059
|
const downloadedFiles = await download2(plannedDownloads);
|
|
1058
1060
|
return Object.fromEntries(
|
|
1059
|
-
downloadedFiles.
|
|
1060
|
-
(
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1061
|
+
downloadedFiles.map(
|
|
1062
|
+
(file, index) => file == null ? null : [
|
|
1063
|
+
plannedDownloads[index].url.toString(),
|
|
1064
|
+
{ data: file.data, mediaType: file.mediaType }
|
|
1065
|
+
]
|
|
1066
|
+
).filter((file) => file != null)
|
|
1065
1067
|
);
|
|
1066
1068
|
}
|
|
1067
1069
|
function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
@@ -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()
|
|
@@ -6384,7 +6381,7 @@ async function generateImage({
|
|
|
6384
6381
|
headers
|
|
6385
6382
|
}) {
|
|
6386
6383
|
var _a17, _b;
|
|
6387
|
-
if (model.specificationVersion !== "
|
|
6384
|
+
if (model.specificationVersion !== "v3") {
|
|
6388
6385
|
throw new UnsupportedModelVersionError({
|
|
6389
6386
|
version: model.specificationVersion,
|
|
6390
6387
|
provider: model.provider,
|
|
@@ -9724,9 +9721,11 @@ var AbstractChat = class {
|
|
|
9724
9721
|
}
|
|
9725
9722
|
};
|
|
9726
9723
|
this.addToolResult = async ({
|
|
9724
|
+
state = "output-available",
|
|
9727
9725
|
tool: tool3,
|
|
9728
9726
|
toolCallId,
|
|
9729
|
-
output
|
|
9727
|
+
output,
|
|
9728
|
+
errorText
|
|
9730
9729
|
}) => this.jobExecutor.run(async () => {
|
|
9731
9730
|
var _a17, _b;
|
|
9732
9731
|
const messages = this.state.messages;
|
|
@@ -9734,16 +9733,16 @@ var AbstractChat = class {
|
|
|
9734
9733
|
this.state.replaceMessage(messages.length - 1, {
|
|
9735
9734
|
...lastMessage,
|
|
9736
9735
|
parts: lastMessage.parts.map(
|
|
9737
|
-
(part) => isToolOrDynamicToolUIPart(part) && part.toolCallId === toolCallId ? { ...part, state
|
|
9736
|
+
(part) => isToolOrDynamicToolUIPart(part) && part.toolCallId === toolCallId ? { ...part, state, output, errorText } : part
|
|
9738
9737
|
)
|
|
9739
9738
|
});
|
|
9740
9739
|
if (this.activeResponse) {
|
|
9741
9740
|
this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(
|
|
9742
9741
|
(part) => isToolOrDynamicToolUIPart(part) && part.toolCallId === toolCallId ? {
|
|
9743
9742
|
...part,
|
|
9744
|
-
state
|
|
9743
|
+
state,
|
|
9745
9744
|
output,
|
|
9746
|
-
errorText
|
|
9745
|
+
errorText
|
|
9747
9746
|
} : part
|
|
9748
9747
|
);
|
|
9749
9748
|
}
|
|
@@ -9952,7 +9951,9 @@ function lastAssistantMessageIsCompleteWithToolCalls({
|
|
|
9952
9951
|
return part.type === "step-start" ? index : lastIndex;
|
|
9953
9952
|
}, -1);
|
|
9954
9953
|
const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter(isToolOrDynamicToolUIPart);
|
|
9955
|
-
return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every(
|
|
9954
|
+
return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every(
|
|
9955
|
+
(part) => part.state === "output-available" || part.state === "output-error"
|
|
9956
|
+
);
|
|
9956
9957
|
}
|
|
9957
9958
|
|
|
9958
9959
|
// src/ui/transform-text-to-ui-message-stream.ts
|
|
@@ -10470,6 +10471,7 @@ function readUIMessageStream({
|
|
|
10470
10471
|
jsonSchema,
|
|
10471
10472
|
lastAssistantMessageIsCompleteWithToolCalls,
|
|
10472
10473
|
modelMessageSchema,
|
|
10474
|
+
parseJsonEventStream,
|
|
10473
10475
|
parsePartialJson,
|
|
10474
10476
|
pipeTextStreamToResponse,
|
|
10475
10477
|
pipeUIMessageStreamToResponse,
|
|
@@ -10484,6 +10486,7 @@ function readUIMessageStream({
|
|
|
10484
10486
|
systemModelMessageSchema,
|
|
10485
10487
|
tool,
|
|
10486
10488
|
toolModelMessageSchema,
|
|
10489
|
+
uiMessageChunkSchema,
|
|
10487
10490
|
userModelMessageSchema,
|
|
10488
10491
|
validateUIMessages,
|
|
10489
10492
|
wrapLanguageModel,
|