ai 5.1.0-beta.2 → 5.1.0-beta.20
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 +152 -0
- package/README.md +128 -44
- package/dist/index.d.mts +229 -119
- package/dist/index.d.ts +229 -119
- package/dist/index.js +188 -124
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +144 -83
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +4 -4
- package/dist/internal/index.d.ts +4 -4
- package/dist/internal/index.js +10 -10
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -10
- package/dist/internal/index.mjs.map +1 -1
- package/dist/test/index.d.mts +46 -46
- package/dist/test/index.d.ts +46 -46
- package/dist/test/index.js +19 -19
- package/dist/test/index.js.map +1 -1
- package/dist/test/index.mjs +15 -15
- package/dist/test/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
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, EmbeddingModelV2, EmbeddingModelV3Embedding, ImageModelV3, ImageModelV3CallWarning, ImageModelV3ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV3, LanguageModelV2, LanguageModelV3FinishReason, LanguageModelV3CallWarning, LanguageModelV3Source, LanguageModelV3Middleware, SharedV3ProviderMetadata, SpeechModelV2, SpeechModelV2CallWarning, TranscriptionModelV2, TranscriptionModelV2CallWarning, LanguageModelV3Usage, LanguageModelV3CallOptions, AISDKError, LanguageModelV3ToolCall, 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 | EmbeddingModelV2<VALUE>;
|
|
161
|
+
type EmbeddingModel<VALUE = string> = string | EmbeddingModelV3<VALUE> | EmbeddingModelV2<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
|
/**
|
|
@@ -197,7 +198,7 @@ type JSONValue = JSONValue$1;
|
|
|
197
198
|
/**
|
|
198
199
|
Language model that is used by the AI SDK Core functions.
|
|
199
200
|
*/
|
|
200
|
-
type LanguageModel = string | LanguageModelV2;
|
|
201
|
+
type LanguageModel = string | LanguageModelV3 | LanguageModelV2;
|
|
201
202
|
/**
|
|
202
203
|
Reason why a language model finished generating a response.
|
|
203
204
|
|
|
@@ -209,16 +210,16 @@ Can be one of the following:
|
|
|
209
210
|
- `error`: model stopped because of an error
|
|
210
211
|
- `other`: model stopped for other reasons
|
|
211
212
|
*/
|
|
212
|
-
type FinishReason =
|
|
213
|
+
type FinishReason = LanguageModelV3FinishReason;
|
|
213
214
|
/**
|
|
214
215
|
Warning from the model provider for this call. The call will proceed, but e.g.
|
|
215
216
|
some settings might not be supported, which can lead to suboptimal results.
|
|
216
217
|
*/
|
|
217
|
-
type CallWarning =
|
|
218
|
+
type CallWarning = LanguageModelV3CallWarning;
|
|
218
219
|
/**
|
|
219
220
|
A source that has been used as input to generate the response.
|
|
220
221
|
*/
|
|
221
|
-
type Source =
|
|
222
|
+
type Source = LanguageModelV3Source;
|
|
222
223
|
/**
|
|
223
224
|
Tool choice for the generation. It supports the following settings:
|
|
224
225
|
|
|
@@ -232,7 +233,7 @@ type ToolChoice<TOOLS extends Record<string, unknown>> = 'auto' | 'none' | 'requ
|
|
|
232
233
|
toolName: Extract<keyof TOOLS, string>;
|
|
233
234
|
};
|
|
234
235
|
|
|
235
|
-
type LanguageModelMiddleware =
|
|
236
|
+
type LanguageModelMiddleware = LanguageModelV3Middleware;
|
|
236
237
|
|
|
237
238
|
type LanguageModelRequestMetadata = {
|
|
238
239
|
/**
|
|
@@ -303,7 +304,7 @@ Additional provider-specific metadata that is returned from the provider.
|
|
|
303
304
|
This is needed to enable provider-specific functionality that can be
|
|
304
305
|
fully encapsulated in the provider.
|
|
305
306
|
*/
|
|
306
|
-
type ProviderMetadata =
|
|
307
|
+
type ProviderMetadata = SharedV3ProviderMetadata;
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
Speech model that is used by the AI SDK Core functions.
|
|
@@ -362,7 +363,7 @@ type TranscriptionModelResponseMetadata = {
|
|
|
362
363
|
/**
|
|
363
364
|
Represents the number of tokens used in a prompt and completion.
|
|
364
365
|
*/
|
|
365
|
-
type LanguageModelUsage =
|
|
366
|
+
type LanguageModelUsage = LanguageModelV3Usage;
|
|
366
367
|
/**
|
|
367
368
|
Represents the number of tokens used in an embedding.
|
|
368
369
|
*/
|
|
@@ -810,7 +811,7 @@ type PartialObject<ObjectType extends object> = {
|
|
|
810
811
|
|
|
811
812
|
interface Output<OUTPUT, PARTIAL> {
|
|
812
813
|
readonly type: 'object' | 'text';
|
|
813
|
-
responseFormat:
|
|
814
|
+
responseFormat: LanguageModelV3CallOptions['responseFormat'];
|
|
814
815
|
parsePartial(options: {
|
|
815
816
|
text: string;
|
|
816
817
|
}): Promise<{
|
|
@@ -960,13 +961,13 @@ declare const coreMessageSchema: z.ZodType<CoreMessage>;
|
|
|
960
961
|
type ToolCallRepairFunction<TOOLS extends ToolSet> = (options: {
|
|
961
962
|
system: string | undefined;
|
|
962
963
|
messages: ModelMessage[];
|
|
963
|
-
toolCall:
|
|
964
|
+
toolCall: LanguageModelV3ToolCall;
|
|
964
965
|
tools: TOOLS;
|
|
965
966
|
inputSchema: (options: {
|
|
966
967
|
toolName: string;
|
|
967
968
|
}) => JSONSchema7;
|
|
968
969
|
error: NoSuchToolError | InvalidToolInputError;
|
|
969
|
-
}) => Promise<
|
|
970
|
+
}) => Promise<LanguageModelV3ToolCall | null>;
|
|
970
971
|
|
|
971
972
|
/**
|
|
972
973
|
Callback that is set using the `onStepFinish` option.
|
|
@@ -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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV3ProviderMetadata, 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
|
} | {
|
|
@@ -1961,47 +2072,28 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
|
|
|
1961
2072
|
*/
|
|
1962
2073
|
consumeStream(options?: ConsumeStreamOptions): Promise<void>;
|
|
1963
2074
|
/**
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
@param options.getErrorMessage an optional function that converts an error to an error message.
|
|
1967
|
-
@param options.sendUsage whether to send the usage information to the client. Defaults to true.
|
|
1968
|
-
@param options.sendReasoning whether to send the reasoning information to the client. Defaults to false.
|
|
1969
|
-
@param options.sendSources whether to send the sources information to the client. Defaults to false.
|
|
1970
|
-
@param options.experimental_sendFinish whether to send the finish information to the client. Defaults to true.
|
|
1971
|
-
@param options.experimental_sendStart whether to send the start information to the client. Defaults to true.
|
|
2075
|
+
Converts the result to a UI message stream.
|
|
1972
2076
|
|
|
1973
|
-
|
|
2077
|
+
@return A UI message stream.
|
|
1974
2078
|
*/
|
|
1975
2079
|
toUIMessageStream<UI_MESSAGE extends UIMessage>(options?: UIMessageStreamOptions<UI_MESSAGE>): AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>;
|
|
1976
2080
|
/**
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
@param options.status The status code.
|
|
1980
|
-
@param options.statusText The status text.
|
|
1981
|
-
@param options.headers The headers.
|
|
1982
|
-
@param options.getErrorMessage An optional function that converts an error to an error message.
|
|
1983
|
-
@param options.sendUsage Whether to send the usage information to the client. Defaults to true.
|
|
1984
|
-
@param options.sendReasoning Whether to send the reasoning information to the client. Defaults to false.
|
|
1985
|
-
*/
|
|
2081
|
+
*Writes UI message stream output to a Node.js response-like object.
|
|
2082
|
+
*/
|
|
1986
2083
|
pipeUIMessageStreamToResponse<UI_MESSAGE extends UIMessage>(response: ServerResponse, options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): void;
|
|
1987
2084
|
/**
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
2085
|
+
Writes text delta output to a Node.js response-like object.
|
|
2086
|
+
It sets a `Content-Type` header to `text/plain; charset=utf-8` and
|
|
2087
|
+
writes each text delta as a separate chunk.
|
|
2088
|
+
|
|
2089
|
+
@param response A Node.js response-like object (ServerResponse).
|
|
2090
|
+
@param init Optional headers, status code, and status text.
|
|
1993
2091
|
*/
|
|
1994
2092
|
pipeTextStreamToResponse(response: ServerResponse, init?: ResponseInit): void;
|
|
1995
2093
|
/**
|
|
1996
|
-
|
|
2094
|
+
Converts the result to a streamed response object with a stream data part stream.
|
|
1997
2095
|
|
|
1998
|
-
|
|
1999
|
-
@param options.statusText The status text.
|
|
2000
|
-
@param options.headers The headers.
|
|
2001
|
-
@param options.getErrorMessage An optional function that converts an error to an error message.
|
|
2002
|
-
@param options.sendUsage Whether to send the usage information to the client. Defaults to true.
|
|
2003
|
-
@param options.sendReasoning Whether to send the reasoning information to the client. Defaults to false.
|
|
2004
|
-
@return A response object.
|
|
2096
|
+
@return A response object.
|
|
2005
2097
|
*/
|
|
2006
2098
|
toUIMessageStreamResponse<UI_MESSAGE extends UIMessage>(options?: UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Response;
|
|
2007
2099
|
/**
|
|
@@ -2092,6 +2184,10 @@ type TextStreamPart<TOOLS extends ToolSet> = {
|
|
|
2092
2184
|
};
|
|
2093
2185
|
|
|
2094
2186
|
type AgentSettings<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never> = CallSettings & {
|
|
2187
|
+
/**
|
|
2188
|
+
* The name of the agent.
|
|
2189
|
+
*/
|
|
2190
|
+
name?: string;
|
|
2095
2191
|
/**
|
|
2096
2192
|
* The system prompt to use.
|
|
2097
2193
|
*/
|
|
@@ -2112,7 +2208,7 @@ type AgentSettings<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never
|
|
|
2112
2208
|
Condition for stopping the generation when there are tool results in the last step.
|
|
2113
2209
|
When the condition is an array, any of the conditions can be met to stop the generation.
|
|
2114
2210
|
|
|
2115
|
-
@default stepCountIs(
|
|
2211
|
+
@default stepCountIs(20)
|
|
2116
2212
|
*/
|
|
2117
2213
|
stopWhen?: StopCondition<NoInfer<TOOLS>> | Array<StopCondition<NoInfer<TOOLS>>>;
|
|
2118
2214
|
/**
|
|
@@ -2145,6 +2241,12 @@ type AgentSettings<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never
|
|
|
2145
2241
|
*/
|
|
2146
2242
|
onStepFinish?: GenerateTextOnStepFinishCallback<NoInfer<TOOLS>>;
|
|
2147
2243
|
/**
|
|
2244
|
+
Additional provider-specific options. They are passed through
|
|
2245
|
+
to the provider from the AI SDK and enable provider-specific
|
|
2246
|
+
functionality that can be fully encapsulated in the provider.
|
|
2247
|
+
*/
|
|
2248
|
+
providerOptions?: ProviderOptions;
|
|
2249
|
+
/**
|
|
2148
2250
|
* Context that is passed into tool calls.
|
|
2149
2251
|
*
|
|
2150
2252
|
* Experimental (can break in patch releases).
|
|
@@ -2160,38 +2262,28 @@ type AgentSettings<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never
|
|
|
2160
2262
|
currentDate?: () => Date;
|
|
2161
2263
|
};
|
|
2162
2264
|
};
|
|
2265
|
+
/**
|
|
2266
|
+
* The Agent class provides a structured way to encapsulate LLM configuration, tools,
|
|
2267
|
+
* and behavior into reusable components.
|
|
2268
|
+
*
|
|
2269
|
+
* It handles the agent loop for you, allowing the LLM to call tools multiple times in
|
|
2270
|
+
* sequence to accomplish complex tasks.
|
|
2271
|
+
*
|
|
2272
|
+
* Define agents once and use them across your application.
|
|
2273
|
+
*/
|
|
2163
2274
|
declare class Agent<TOOLS extends ToolSet, OUTPUT = never, OUTPUT_PARTIAL = never> {
|
|
2164
2275
|
private readonly settings;
|
|
2165
2276
|
constructor(settings: AgentSettings<TOOLS, OUTPUT, OUTPUT_PARTIAL>);
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
/**
|
|
2169
|
-
Additional provider-specific metadata. They are passed through
|
|
2170
|
-
from the provider to the AI SDK and enable provider-specific
|
|
2171
|
-
results that can be fully encapsulated in the provider.
|
|
2277
|
+
/**
|
|
2278
|
+
* The name of the agent.
|
|
2172
2279
|
*/
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
to the provider from the AI SDK and enable provider-specific
|
|
2177
|
-
functionality that can be fully encapsulated in the provider.
|
|
2178
|
-
*/
|
|
2179
|
-
providerOptions?: ProviderOptions;
|
|
2180
|
-
}): Promise<GenerateTextResult<TOOLS, OUTPUT>>;
|
|
2181
|
-
stream(options: Prompt & {
|
|
2182
|
-
/**
|
|
2183
|
-
Additional provider-specific metadata. They are passed through
|
|
2184
|
-
from the provider to the AI SDK and enable provider-specific
|
|
2185
|
-
results that can be fully encapsulated in the provider.
|
|
2280
|
+
get name(): string | undefined;
|
|
2281
|
+
/**
|
|
2282
|
+
* The tools that the agent can use.
|
|
2186
2283
|
*/
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
to the provider from the AI SDK and enable provider-specific
|
|
2191
|
-
functionality that can be fully encapsulated in the provider.
|
|
2192
|
-
*/
|
|
2193
|
-
providerOptions?: ProviderOptions;
|
|
2194
|
-
}): StreamTextResult<TOOLS, OUTPUT_PARTIAL>;
|
|
2284
|
+
get tools(): TOOLS;
|
|
2285
|
+
generate(options: Prompt): Promise<GenerateTextResult<TOOLS, OUTPUT>>;
|
|
2286
|
+
stream(options: Prompt): StreamTextResult<TOOLS, OUTPUT_PARTIAL>;
|
|
2195
2287
|
/**
|
|
2196
2288
|
* Creates a response object that streams UI messages to the client.
|
|
2197
2289
|
*/
|
|
@@ -2452,7 +2544,7 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
|
|
2452
2544
|
file: GeneratedFile;
|
|
2453
2545
|
} | {
|
|
2454
2546
|
type: 'stream-start';
|
|
2455
|
-
warnings:
|
|
2547
|
+
warnings: LanguageModelV3CallWarning[];
|
|
2456
2548
|
} | {
|
|
2457
2549
|
type: 'response-metadata';
|
|
2458
2550
|
id?: string;
|
|
@@ -2583,6 +2675,16 @@ declare class NoOutputSpecifiedError extends AISDKError {
|
|
|
2583
2675
|
static isInstance(error: unknown): error is NoOutputSpecifiedError;
|
|
2584
2676
|
}
|
|
2585
2677
|
|
|
2678
|
+
/**
|
|
2679
|
+
Error that is thrown when no speech audio was generated.
|
|
2680
|
+
*/
|
|
2681
|
+
declare class NoSpeechGeneratedError extends AISDKError {
|
|
2682
|
+
readonly responses: Array<SpeechModelResponseMetadata>;
|
|
2683
|
+
constructor(options: {
|
|
2684
|
+
responses: Array<SpeechModelResponseMetadata>;
|
|
2685
|
+
});
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2586
2688
|
declare const symbol$6: unique symbol;
|
|
2587
2689
|
declare class ToolCallRepairError extends AISDKError {
|
|
2588
2690
|
private readonly [symbol$6];
|
|
@@ -2723,7 +2825,7 @@ declare function generateImage({ model, prompt, n, maxImagesPerCall, size, aspec
|
|
|
2723
2825
|
/**
|
|
2724
2826
|
The image model to use.
|
|
2725
2827
|
*/
|
|
2726
|
-
model:
|
|
2828
|
+
model: ImageModelV3;
|
|
2727
2829
|
/**
|
|
2728
2830
|
The prompt that should be used to generate the image.
|
|
2729
2831
|
*/
|
|
@@ -3445,7 +3547,7 @@ declare function generateSpeech({ model, text, voice, outputFormat, instructions
|
|
|
3445
3547
|
headers?: Record<string, string>;
|
|
3446
3548
|
}): Promise<SpeechResult>;
|
|
3447
3549
|
|
|
3448
|
-
type Warning =
|
|
3550
|
+
type Warning = LanguageModelV3CallWarning | ImageModelV3CallWarning | SpeechModelV2CallWarning | TranscriptionModelV2CallWarning;
|
|
3449
3551
|
type LogWarningsFunction = (warnings: Warning[]) => void;
|
|
3450
3552
|
|
|
3451
3553
|
/**
|
|
@@ -3453,19 +3555,19 @@ type LogWarningsFunction = (warnings: Warning[]) => void;
|
|
|
3453
3555
|
*/
|
|
3454
3556
|
declare function defaultSettingsMiddleware({ settings, }: {
|
|
3455
3557
|
settings: Partial<{
|
|
3456
|
-
maxOutputTokens?:
|
|
3457
|
-
temperature?:
|
|
3458
|
-
stopSequences?:
|
|
3459
|
-
topP?:
|
|
3460
|
-
topK?:
|
|
3461
|
-
presencePenalty?:
|
|
3462
|
-
frequencyPenalty?:
|
|
3463
|
-
responseFormat?:
|
|
3464
|
-
seed?:
|
|
3465
|
-
tools?:
|
|
3466
|
-
toolChoice?:
|
|
3467
|
-
headers?:
|
|
3468
|
-
providerOptions?:
|
|
3558
|
+
maxOutputTokens?: LanguageModelV3CallOptions['maxOutputTokens'];
|
|
3559
|
+
temperature?: LanguageModelV3CallOptions['temperature'];
|
|
3560
|
+
stopSequences?: LanguageModelV3CallOptions['stopSequences'];
|
|
3561
|
+
topP?: LanguageModelV3CallOptions['topP'];
|
|
3562
|
+
topK?: LanguageModelV3CallOptions['topK'];
|
|
3563
|
+
presencePenalty?: LanguageModelV3CallOptions['presencePenalty'];
|
|
3564
|
+
frequencyPenalty?: LanguageModelV3CallOptions['frequencyPenalty'];
|
|
3565
|
+
responseFormat?: LanguageModelV3CallOptions['responseFormat'];
|
|
3566
|
+
seed?: LanguageModelV3CallOptions['seed'];
|
|
3567
|
+
tools?: LanguageModelV3CallOptions['tools'];
|
|
3568
|
+
toolChoice?: LanguageModelV3CallOptions['toolChoice'];
|
|
3569
|
+
headers?: LanguageModelV3CallOptions['headers'];
|
|
3570
|
+
providerOptions?: LanguageModelV3CallOptions['providerOptions'];
|
|
3469
3571
|
}>;
|
|
3470
3572
|
}): LanguageModelMiddleware;
|
|
3471
3573
|
|
|
@@ -3489,39 +3591,39 @@ declare function extractReasoningMiddleware({ tagName, separator, startWithReaso
|
|
|
3489
3591
|
declare function simulateStreamingMiddleware(): LanguageModelMiddleware;
|
|
3490
3592
|
|
|
3491
3593
|
/**
|
|
3492
|
-
* Wraps a
|
|
3594
|
+
* Wraps a LanguageModelV3 instance with middleware functionality.
|
|
3493
3595
|
* This function allows you to apply middleware to transform parameters,
|
|
3494
3596
|
* wrap generate operations, and wrap stream operations of a language model.
|
|
3495
3597
|
*
|
|
3496
3598
|
* @param options - Configuration options for wrapping the language model.
|
|
3497
|
-
* @param options.model - The original
|
|
3599
|
+
* @param options.model - The original LanguageModelV3 instance to be wrapped.
|
|
3498
3600
|
* @param options.middleware - The middleware to be applied to the language model. When multiple middlewares are provided, the first middleware will transform the input first, and the last middleware will be wrapped directly around the model.
|
|
3499
3601
|
* @param options.modelId - Optional custom model ID to override the original model's ID.
|
|
3500
3602
|
* @param options.providerId - Optional custom provider ID to override the original model's provider ID.
|
|
3501
|
-
* @returns A new
|
|
3603
|
+
* @returns A new LanguageModelV3 instance with middleware applied.
|
|
3502
3604
|
*/
|
|
3503
3605
|
declare const wrapLanguageModel: ({ model, middleware: middlewareArg, modelId, providerId, }: {
|
|
3504
|
-
model:
|
|
3606
|
+
model: LanguageModelV3;
|
|
3505
3607
|
middleware: LanguageModelMiddleware | LanguageModelMiddleware[];
|
|
3506
3608
|
modelId?: string;
|
|
3507
3609
|
providerId?: string;
|
|
3508
|
-
}) =>
|
|
3610
|
+
}) => LanguageModelV3;
|
|
3509
3611
|
|
|
3510
3612
|
/**
|
|
3511
|
-
* Wraps a
|
|
3613
|
+
* Wraps a ProviderV3 instance with middleware functionality.
|
|
3512
3614
|
* This function allows you to apply middleware to all language models
|
|
3513
3615
|
* from the provider, enabling you to transform parameters, wrap generate
|
|
3514
3616
|
* operations, and wrap stream operations for every language model.
|
|
3515
3617
|
*
|
|
3516
3618
|
* @param options - Configuration options for wrapping the provider.
|
|
3517
|
-
* @param options.provider - The original
|
|
3619
|
+
* @param options.provider - The original ProviderV3 instance to be wrapped.
|
|
3518
3620
|
* @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
|
|
3621
|
+
* @returns A new ProviderV3 instance with middleware applied to all language models.
|
|
3520
3622
|
*/
|
|
3521
3623
|
declare function wrapProvider({ provider, languageModelMiddleware, }: {
|
|
3522
|
-
provider:
|
|
3624
|
+
provider: ProviderV3;
|
|
3523
3625
|
languageModelMiddleware: LanguageModelMiddleware | LanguageModelMiddleware[];
|
|
3524
|
-
}):
|
|
3626
|
+
}): ProviderV3;
|
|
3525
3627
|
|
|
3526
3628
|
/**
|
|
3527
3629
|
* Creates a custom provider with specified language models, text embedding models, image models, transcription models, speech models, and an optional fallback provider.
|
|
@@ -3537,17 +3639,17 @@ declare function wrapProvider({ provider, languageModelMiddleware, }: {
|
|
|
3537
3639
|
*
|
|
3538
3640
|
* @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
|
|
3539
3641
|
*/
|
|
3540
|
-
declare function customProvider<LANGUAGE_MODELS extends Record<string,
|
|
3642
|
+
declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV3>, 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
3643
|
languageModels?: LANGUAGE_MODELS;
|
|
3542
3644
|
textEmbeddingModels?: EMBEDDING_MODELS;
|
|
3543
3645
|
imageModels?: IMAGE_MODELS;
|
|
3544
3646
|
transcriptionModels?: TRANSCRIPTION_MODELS;
|
|
3545
3647
|
speechModels?: SPEECH_MODELS;
|
|
3546
|
-
fallbackProvider?:
|
|
3547
|
-
}):
|
|
3548
|
-
languageModel(modelId: ExtractModelId<LANGUAGE_MODELS>):
|
|
3549
|
-
textEmbeddingModel(modelId: ExtractModelId<EMBEDDING_MODELS>):
|
|
3550
|
-
imageModel(modelId: ExtractModelId<IMAGE_MODELS>):
|
|
3648
|
+
fallbackProvider?: ProviderV3;
|
|
3649
|
+
}): ProviderV3 & {
|
|
3650
|
+
languageModel(modelId: ExtractModelId<LANGUAGE_MODELS>): LanguageModelV3;
|
|
3651
|
+
textEmbeddingModel(modelId: ExtractModelId<EMBEDDING_MODELS>): EmbeddingModelV3<string>;
|
|
3652
|
+
imageModel(modelId: ExtractModelId<IMAGE_MODELS>): ImageModelV3;
|
|
3551
3653
|
transcriptionModel(modelId: ExtractModelId<TRANSCRIPTION_MODELS>): TranscriptionModelV2;
|
|
3552
3654
|
speechModel(modelId: ExtractModelId<SPEECH_MODELS>): SpeechModelV2;
|
|
3553
3655
|
};
|
|
@@ -3573,13 +3675,13 @@ declare class NoSuchProviderError extends NoSuchModelError {
|
|
|
3573
3675
|
}
|
|
3574
3676
|
|
|
3575
3677
|
type ExtractLiteralUnion<T> = T extends string ? string extends T ? never : T : never;
|
|
3576
|
-
interface ProviderRegistryProvider<PROVIDERS extends Record<string,
|
|
3577
|
-
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['languageModel']>>[0]>}` : never):
|
|
3578
|
-
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never):
|
|
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):
|
|
3678
|
+
interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV3> = Record<string, ProviderV3>, SEPARATOR extends string = ':'> {
|
|
3679
|
+
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['languageModel']>>[0]>}` : never): LanguageModelV3;
|
|
3680
|
+
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): LanguageModelV3;
|
|
3681
|
+
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['textEmbeddingModel']>>[0]>}` : never): EmbeddingModelV3<string>;
|
|
3682
|
+
textEmbeddingModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): EmbeddingModelV3<string>;
|
|
3683
|
+
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['imageModel']>>[0]>}` : never): ImageModelV3;
|
|
3684
|
+
imageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): ImageModelV3;
|
|
3583
3685
|
transcriptionModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['transcriptionModel']>>[0]>}` : never): TranscriptionModelV2;
|
|
3584
3686
|
transcriptionModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${string}` : never): TranscriptionModelV2;
|
|
3585
3687
|
speechModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['speechModel']>>[0]>}` : never): SpeechModelV2;
|
|
@@ -3597,7 +3699,7 @@ interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV2>
|
|
|
3597
3699
|
* @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
3700
|
* @returns A new ProviderRegistryProvider instance that provides access to all registered providers with optional middleware applied to language models.
|
|
3599
3701
|
*/
|
|
3600
|
-
declare function createProviderRegistry<PROVIDERS extends Record<string,
|
|
3702
|
+
declare function createProviderRegistry<PROVIDERS extends Record<string, ProviderV3>, SEPARATOR extends string = ':'>(providers: PROVIDERS, { separator, languageModelMiddleware, }?: {
|
|
3601
3703
|
separator?: SEPARATOR;
|
|
3602
3704
|
languageModelMiddleware?: LanguageModelMiddleware | LanguageModelMiddleware[];
|
|
3603
3705
|
}): ProviderRegistryProvider<PROVIDERS, SEPARATOR>;
|
|
@@ -4216,10 +4318,18 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
4216
4318
|
* Clear the error state and set the status to ready if the chat is in an error state.
|
|
4217
4319
|
*/
|
|
4218
4320
|
clearError: () => void;
|
|
4219
|
-
addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ tool, toolCallId, output, }: {
|
|
4321
|
+
addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
|
|
4322
|
+
state?: "output-available";
|
|
4220
4323
|
tool: TOOL;
|
|
4221
4324
|
toolCallId: string;
|
|
4222
4325
|
output: InferUIMessageTools<UI_MESSAGE>[TOOL]["output"];
|
|
4326
|
+
errorText?: never;
|
|
4327
|
+
} | {
|
|
4328
|
+
state: "output-error";
|
|
4329
|
+
tool: TOOL;
|
|
4330
|
+
toolCallId: string;
|
|
4331
|
+
output?: never;
|
|
4332
|
+
errorText: string;
|
|
4223
4333
|
}) => Promise<void>;
|
|
4224
4334
|
/**
|
|
4225
4335
|
* Abort the current request immediately, keep the generated tokens if any.
|
|
@@ -4499,7 +4609,7 @@ declare global {
|
|
|
4499
4609
|
*
|
|
4500
4610
|
* @see https://ai-sdk.dev/docs/ai-sdk-core/provider-management#global-provider-configuration
|
|
4501
4611
|
*/
|
|
4502
|
-
var AI_SDK_DEFAULT_PROVIDER:
|
|
4612
|
+
var AI_SDK_DEFAULT_PROVIDER: ProviderV3 | undefined;
|
|
4503
4613
|
/**
|
|
4504
4614
|
* The warning logger to use for the AI SDK.
|
|
4505
4615
|
*
|
|
@@ -4510,4 +4620,4 @@ declare global {
|
|
|
4510
4620
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4511
4621
|
}
|
|
4512
4622
|
|
|
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 };
|
|
4623
|
+
export { AbstractChat, Agent, AgentSettings, 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, InferAgentUIMessage, 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, NoSpeechGeneratedError, 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 };
|