ai 5.0.78 → 5.0.79
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 +20 -0
- package/dist/index.d.mts +10 -192
- package/dist/index.d.ts +10 -192
- package/dist/index.js +540 -1146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +456 -1068
- 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 -8
- package/dist/mcp-stdio/index.d.mts +0 -89
- package/dist/mcp-stdio/index.d.ts +0 -89
- package/dist/mcp-stdio/index.js +0 -353
- package/dist/mcp-stdio/index.js.map +0 -1
- package/dist/mcp-stdio/index.mjs +0 -326
- package/dist/mcp-stdio/index.mjs.map +0 -1
- package/mcp-stdio.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.0.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 22ab538: feat(ai): add OAuth for MCP clients + refactor to new package
|
|
8
|
+
|
|
9
|
+
This change replaces
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { experimental_createMCPClient } from 'ai';
|
|
13
|
+
import { Experimental_StdioMCPTransport } from 'ai/mcp-stdio';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
with
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { experimental_createMCPClient } from '@ai-sdk/mcp';
|
|
20
|
+
import { Experimental_StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio';
|
|
21
|
+
```
|
|
22
|
+
|
|
3
23
|
## 5.0.78
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { ModelMessage, Tool, InferToolInput, InferToolOutput, AssistantModelMess
|
|
|
4
4
|
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';
|
|
5
5
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
|
6
6
|
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
7
|
-
import { EmbeddingModelV2, EmbeddingModelV2Embedding, 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
|
|
7
|
+
import { EmbeddingModelV2, EmbeddingModelV2Embedding, 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 } from '@ai-sdk/provider';
|
|
8
8
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
|
9
9
|
import * as z3 from 'zod/v3';
|
|
10
10
|
import * as z4 from 'zod/v4';
|
|
@@ -873,9 +873,9 @@ type StopCondition<TOOLS extends ToolSet> = (options: {
|
|
|
873
873
|
declare function stepCountIs(stepCount: number): StopCondition<any>;
|
|
874
874
|
declare function hasToolCall(toolName: string): StopCondition<any>;
|
|
875
875
|
|
|
876
|
-
declare const symbol$
|
|
876
|
+
declare const symbol$e: unique symbol;
|
|
877
877
|
declare class InvalidToolInputError extends AISDKError {
|
|
878
|
-
private readonly [symbol$
|
|
878
|
+
private readonly [symbol$e];
|
|
879
879
|
readonly toolName: string;
|
|
880
880
|
readonly toolInput: string;
|
|
881
881
|
constructor({ toolInput, toolName, cause, message, }: {
|
|
@@ -887,9 +887,9 @@ declare class InvalidToolInputError extends AISDKError {
|
|
|
887
887
|
static isInstance(error: unknown): error is InvalidToolInputError;
|
|
888
888
|
}
|
|
889
889
|
|
|
890
|
-
declare const symbol$
|
|
890
|
+
declare const symbol$d: unique symbol;
|
|
891
891
|
declare class NoSuchToolError extends AISDKError {
|
|
892
|
-
private readonly [symbol$
|
|
892
|
+
private readonly [symbol$d];
|
|
893
893
|
readonly toolName: string;
|
|
894
894
|
readonly availableTools: string[] | undefined;
|
|
895
895
|
constructor({ toolName, availableTools, message, }: {
|
|
@@ -2512,9 +2512,9 @@ declare function embedMany<VALUE = string>({ model: modelArg, values, maxParalle
|
|
|
2512
2512
|
maxParallelCalls?: number;
|
|
2513
2513
|
}): Promise<EmbedManyResult<VALUE>>;
|
|
2514
2514
|
|
|
2515
|
-
declare const symbol$
|
|
2515
|
+
declare const symbol$c: unique symbol;
|
|
2516
2516
|
declare class InvalidArgumentError extends AISDKError {
|
|
2517
|
-
private readonly [symbol$
|
|
2517
|
+
private readonly [symbol$c];
|
|
2518
2518
|
readonly parameter: string;
|
|
2519
2519
|
readonly value: unknown;
|
|
2520
2520
|
constructor({ parameter, value, message, }: {
|
|
@@ -2600,9 +2600,9 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
|
|
2600
2600
|
rawValue: unknown;
|
|
2601
2601
|
};
|
|
2602
2602
|
|
|
2603
|
-
declare const symbol$
|
|
2603
|
+
declare const symbol$b: unique symbol;
|
|
2604
2604
|
declare class InvalidStreamPartError extends AISDKError {
|
|
2605
|
-
private readonly [symbol$
|
|
2605
|
+
private readonly [symbol$b];
|
|
2606
2606
|
readonly chunk: SingleRequestTextStreamPart<any>;
|
|
2607
2607
|
constructor({ chunk, message, }: {
|
|
2608
2608
|
chunk: SingleRequestTextStreamPart<any>;
|
|
@@ -2611,24 +2611,6 @@ declare class InvalidStreamPartError extends AISDKError {
|
|
|
2611
2611
|
static isInstance(error: unknown): error is InvalidStreamPartError;
|
|
2612
2612
|
}
|
|
2613
2613
|
|
|
2614
|
-
declare const symbol$b: unique symbol;
|
|
2615
|
-
/**
|
|
2616
|
-
* An error occurred with the MCP client.
|
|
2617
|
-
*/
|
|
2618
|
-
declare class MCPClientError extends AISDKError {
|
|
2619
|
-
private readonly [symbol$b];
|
|
2620
|
-
readonly data?: unknown;
|
|
2621
|
-
readonly code?: number;
|
|
2622
|
-
constructor({ name, message, cause, data, code, }: {
|
|
2623
|
-
name?: string;
|
|
2624
|
-
message: string;
|
|
2625
|
-
cause?: unknown;
|
|
2626
|
-
data?: unknown;
|
|
2627
|
-
code?: number;
|
|
2628
|
-
});
|
|
2629
|
-
static isInstance(error: unknown): error is MCPClientError;
|
|
2630
|
-
}
|
|
2631
|
-
|
|
2632
2614
|
declare const symbol$a: unique symbol;
|
|
2633
2615
|
/**
|
|
2634
2616
|
Thrown when no image could be generated. This can have multiple causes:
|
|
@@ -3758,170 +3740,6 @@ declare function pipeTextStreamToResponse({ response, status, statusText, header
|
|
|
3758
3740
|
textStream: ReadableStream<string>;
|
|
3759
3741
|
} & ResponseInit): void;
|
|
3760
3742
|
|
|
3761
|
-
declare const JSONRPCRequestSchema: z.ZodObject<{
|
|
3762
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3763
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3764
|
-
method: z.ZodString;
|
|
3765
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3766
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3767
|
-
}, z.core.$loose>>;
|
|
3768
|
-
}, z.core.$strict>;
|
|
3769
|
-
type JSONRPCRequest = z.infer<typeof JSONRPCRequestSchema>;
|
|
3770
|
-
declare const JSONRPCResponseSchema: z.ZodObject<{
|
|
3771
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3772
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3773
|
-
result: z.ZodObject<{
|
|
3774
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3775
|
-
}, z.core.$loose>;
|
|
3776
|
-
}, z.core.$strict>;
|
|
3777
|
-
type JSONRPCResponse = z.infer<typeof JSONRPCResponseSchema>;
|
|
3778
|
-
declare const JSONRPCErrorSchema: z.ZodObject<{
|
|
3779
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3780
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3781
|
-
error: z.ZodObject<{
|
|
3782
|
-
code: z.ZodNumber;
|
|
3783
|
-
message: z.ZodString;
|
|
3784
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
3785
|
-
}, z.core.$strip>;
|
|
3786
|
-
}, z.core.$strict>;
|
|
3787
|
-
type JSONRPCError = z.infer<typeof JSONRPCErrorSchema>;
|
|
3788
|
-
declare const JSONRPCNotificationSchema: z.ZodObject<{
|
|
3789
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3790
|
-
method: z.ZodString;
|
|
3791
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3792
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3793
|
-
}, z.core.$loose>>;
|
|
3794
|
-
}, z.core.$strict>;
|
|
3795
|
-
type JSONRPCNotification = z.infer<typeof JSONRPCNotificationSchema>;
|
|
3796
|
-
declare const JSONRPCMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3797
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3798
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3799
|
-
method: z.ZodString;
|
|
3800
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3801
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3802
|
-
}, z.core.$loose>>;
|
|
3803
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3804
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3805
|
-
method: z.ZodString;
|
|
3806
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3807
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3808
|
-
}, z.core.$loose>>;
|
|
3809
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3810
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3811
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3812
|
-
result: z.ZodObject<{
|
|
3813
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3814
|
-
}, z.core.$loose>;
|
|
3815
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3816
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3817
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3818
|
-
error: z.ZodObject<{
|
|
3819
|
-
code: z.ZodNumber;
|
|
3820
|
-
message: z.ZodString;
|
|
3821
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
3822
|
-
}, z.core.$strip>;
|
|
3823
|
-
}, z.core.$strict>]>;
|
|
3824
|
-
type JSONRPCMessage = z.infer<typeof JSONRPCMessageSchema>;
|
|
3825
|
-
|
|
3826
|
-
/**
|
|
3827
|
-
* Transport interface for MCP (Model Context Protocol) communication.
|
|
3828
|
-
* Maps to the `Transport` interface in the MCP spec.
|
|
3829
|
-
*/
|
|
3830
|
-
interface MCPTransport {
|
|
3831
|
-
/**
|
|
3832
|
-
* Initialize and start the transport
|
|
3833
|
-
*/
|
|
3834
|
-
start(): Promise<void>;
|
|
3835
|
-
/**
|
|
3836
|
-
* Send a JSON-RPC message through the transport
|
|
3837
|
-
* @param message The JSON-RPC message to send
|
|
3838
|
-
*/
|
|
3839
|
-
send(message: JSONRPCMessage): Promise<void>;
|
|
3840
|
-
/**
|
|
3841
|
-
* Clean up and close the transport
|
|
3842
|
-
*/
|
|
3843
|
-
close(): Promise<void>;
|
|
3844
|
-
/**
|
|
3845
|
-
* Event handler for transport closure
|
|
3846
|
-
*/
|
|
3847
|
-
onclose?: () => void;
|
|
3848
|
-
/**
|
|
3849
|
-
* Event handler for transport errors
|
|
3850
|
-
*/
|
|
3851
|
-
onerror?: (error: Error) => void;
|
|
3852
|
-
/**
|
|
3853
|
-
* Event handler for received messages
|
|
3854
|
-
*/
|
|
3855
|
-
onmessage?: (message: JSONRPCMessage) => void;
|
|
3856
|
-
}
|
|
3857
|
-
type MCPTransportConfig = {
|
|
3858
|
-
type: 'sse';
|
|
3859
|
-
/**
|
|
3860
|
-
* The URL of the MCP server.
|
|
3861
|
-
*/
|
|
3862
|
-
url: string;
|
|
3863
|
-
/**
|
|
3864
|
-
* Additional HTTP headers to be sent with requests.
|
|
3865
|
-
*/
|
|
3866
|
-
headers?: Record<string, string>;
|
|
3867
|
-
};
|
|
3868
|
-
|
|
3869
|
-
type ToolSchemas = Record<string, {
|
|
3870
|
-
inputSchema: FlexibleSchema<JSONObject | unknown>;
|
|
3871
|
-
}> | 'automatic' | undefined;
|
|
3872
|
-
type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
|
|
3873
|
-
inputSchema: FlexibleSchema<any>;
|
|
3874
|
-
}> ? {
|
|
3875
|
-
[K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
|
|
3876
|
-
inputSchema: FlexibleSchema<infer INPUT>;
|
|
3877
|
-
} ? Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> : never;
|
|
3878
|
-
} : McpToolSet<Record<string, {
|
|
3879
|
-
inputSchema: FlexibleSchema<unknown>;
|
|
3880
|
-
}>>;
|
|
3881
|
-
declare const CallToolResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
3882
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3883
|
-
content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
3884
|
-
type: z.ZodLiteral<"text">;
|
|
3885
|
-
text: z.ZodString;
|
|
3886
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3887
|
-
type: z.ZodLiteral<"image">;
|
|
3888
|
-
data: z.ZodBase64;
|
|
3889
|
-
mimeType: z.ZodString;
|
|
3890
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3891
|
-
type: z.ZodLiteral<"resource">;
|
|
3892
|
-
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
3893
|
-
uri: z.ZodString;
|
|
3894
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
3895
|
-
text: z.ZodString;
|
|
3896
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3897
|
-
uri: z.ZodString;
|
|
3898
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
3899
|
-
blob: z.ZodBase64;
|
|
3900
|
-
}, z.core.$loose>]>;
|
|
3901
|
-
}, z.core.$loose>]>>;
|
|
3902
|
-
isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
3903
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3904
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3905
|
-
toolResult: z.ZodUnknown;
|
|
3906
|
-
}, z.core.$loose>]>;
|
|
3907
|
-
type CallToolResult = z.infer<typeof CallToolResultSchema>;
|
|
3908
|
-
|
|
3909
|
-
interface MCPClientConfig {
|
|
3910
|
-
/** Transport configuration for connecting to the MCP server */
|
|
3911
|
-
transport: MCPTransportConfig | MCPTransport;
|
|
3912
|
-
/** Optional callback for uncaught errors */
|
|
3913
|
-
onUncaughtError?: (error: unknown) => void;
|
|
3914
|
-
/** Optional client name, defaults to 'ai-sdk-mcp-client' */
|
|
3915
|
-
name?: string;
|
|
3916
|
-
}
|
|
3917
|
-
declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
|
|
3918
|
-
interface MCPClient {
|
|
3919
|
-
tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(options?: {
|
|
3920
|
-
schemas?: TOOL_SCHEMAS;
|
|
3921
|
-
}): Promise<McpToolSet<TOOL_SCHEMAS>>;
|
|
3922
|
-
close: () => Promise<void>;
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
3743
|
/**
|
|
3926
3744
|
The result of a `transcribe` call.
|
|
3927
3745
|
It contains the transcript and additional information.
|
|
@@ -4665,4 +4483,4 @@ declare global {
|
|
|
4665
4483
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4666
4484
|
}
|
|
4667
4485
|
|
|
4668
|
-
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,
|
|
4486
|
+
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, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, 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, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ModelMessage, Tool, InferToolInput, InferToolOutput, AssistantModelMess
|
|
|
4
4
|
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';
|
|
5
5
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
|
6
6
|
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
7
|
-
import { EmbeddingModelV2, EmbeddingModelV2Embedding, 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
|
|
7
|
+
import { EmbeddingModelV2, EmbeddingModelV2Embedding, 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 } from '@ai-sdk/provider';
|
|
8
8
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, JSONSchema7, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
|
9
9
|
import * as z3 from 'zod/v3';
|
|
10
10
|
import * as z4 from 'zod/v4';
|
|
@@ -873,9 +873,9 @@ type StopCondition<TOOLS extends ToolSet> = (options: {
|
|
|
873
873
|
declare function stepCountIs(stepCount: number): StopCondition<any>;
|
|
874
874
|
declare function hasToolCall(toolName: string): StopCondition<any>;
|
|
875
875
|
|
|
876
|
-
declare const symbol$
|
|
876
|
+
declare const symbol$e: unique symbol;
|
|
877
877
|
declare class InvalidToolInputError extends AISDKError {
|
|
878
|
-
private readonly [symbol$
|
|
878
|
+
private readonly [symbol$e];
|
|
879
879
|
readonly toolName: string;
|
|
880
880
|
readonly toolInput: string;
|
|
881
881
|
constructor({ toolInput, toolName, cause, message, }: {
|
|
@@ -887,9 +887,9 @@ declare class InvalidToolInputError extends AISDKError {
|
|
|
887
887
|
static isInstance(error: unknown): error is InvalidToolInputError;
|
|
888
888
|
}
|
|
889
889
|
|
|
890
|
-
declare const symbol$
|
|
890
|
+
declare const symbol$d: unique symbol;
|
|
891
891
|
declare class NoSuchToolError extends AISDKError {
|
|
892
|
-
private readonly [symbol$
|
|
892
|
+
private readonly [symbol$d];
|
|
893
893
|
readonly toolName: string;
|
|
894
894
|
readonly availableTools: string[] | undefined;
|
|
895
895
|
constructor({ toolName, availableTools, message, }: {
|
|
@@ -2512,9 +2512,9 @@ declare function embedMany<VALUE = string>({ model: modelArg, values, maxParalle
|
|
|
2512
2512
|
maxParallelCalls?: number;
|
|
2513
2513
|
}): Promise<EmbedManyResult<VALUE>>;
|
|
2514
2514
|
|
|
2515
|
-
declare const symbol$
|
|
2515
|
+
declare const symbol$c: unique symbol;
|
|
2516
2516
|
declare class InvalidArgumentError extends AISDKError {
|
|
2517
|
-
private readonly [symbol$
|
|
2517
|
+
private readonly [symbol$c];
|
|
2518
2518
|
readonly parameter: string;
|
|
2519
2519
|
readonly value: unknown;
|
|
2520
2520
|
constructor({ parameter, value, message, }: {
|
|
@@ -2600,9 +2600,9 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
|
|
2600
2600
|
rawValue: unknown;
|
|
2601
2601
|
};
|
|
2602
2602
|
|
|
2603
|
-
declare const symbol$
|
|
2603
|
+
declare const symbol$b: unique symbol;
|
|
2604
2604
|
declare class InvalidStreamPartError extends AISDKError {
|
|
2605
|
-
private readonly [symbol$
|
|
2605
|
+
private readonly [symbol$b];
|
|
2606
2606
|
readonly chunk: SingleRequestTextStreamPart<any>;
|
|
2607
2607
|
constructor({ chunk, message, }: {
|
|
2608
2608
|
chunk: SingleRequestTextStreamPart<any>;
|
|
@@ -2611,24 +2611,6 @@ declare class InvalidStreamPartError extends AISDKError {
|
|
|
2611
2611
|
static isInstance(error: unknown): error is InvalidStreamPartError;
|
|
2612
2612
|
}
|
|
2613
2613
|
|
|
2614
|
-
declare const symbol$b: unique symbol;
|
|
2615
|
-
/**
|
|
2616
|
-
* An error occurred with the MCP client.
|
|
2617
|
-
*/
|
|
2618
|
-
declare class MCPClientError extends AISDKError {
|
|
2619
|
-
private readonly [symbol$b];
|
|
2620
|
-
readonly data?: unknown;
|
|
2621
|
-
readonly code?: number;
|
|
2622
|
-
constructor({ name, message, cause, data, code, }: {
|
|
2623
|
-
name?: string;
|
|
2624
|
-
message: string;
|
|
2625
|
-
cause?: unknown;
|
|
2626
|
-
data?: unknown;
|
|
2627
|
-
code?: number;
|
|
2628
|
-
});
|
|
2629
|
-
static isInstance(error: unknown): error is MCPClientError;
|
|
2630
|
-
}
|
|
2631
|
-
|
|
2632
2614
|
declare const symbol$a: unique symbol;
|
|
2633
2615
|
/**
|
|
2634
2616
|
Thrown when no image could be generated. This can have multiple causes:
|
|
@@ -3758,170 +3740,6 @@ declare function pipeTextStreamToResponse({ response, status, statusText, header
|
|
|
3758
3740
|
textStream: ReadableStream<string>;
|
|
3759
3741
|
} & ResponseInit): void;
|
|
3760
3742
|
|
|
3761
|
-
declare const JSONRPCRequestSchema: z.ZodObject<{
|
|
3762
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3763
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3764
|
-
method: z.ZodString;
|
|
3765
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3766
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3767
|
-
}, z.core.$loose>>;
|
|
3768
|
-
}, z.core.$strict>;
|
|
3769
|
-
type JSONRPCRequest = z.infer<typeof JSONRPCRequestSchema>;
|
|
3770
|
-
declare const JSONRPCResponseSchema: z.ZodObject<{
|
|
3771
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3772
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3773
|
-
result: z.ZodObject<{
|
|
3774
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3775
|
-
}, z.core.$loose>;
|
|
3776
|
-
}, z.core.$strict>;
|
|
3777
|
-
type JSONRPCResponse = z.infer<typeof JSONRPCResponseSchema>;
|
|
3778
|
-
declare const JSONRPCErrorSchema: z.ZodObject<{
|
|
3779
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3780
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3781
|
-
error: z.ZodObject<{
|
|
3782
|
-
code: z.ZodNumber;
|
|
3783
|
-
message: z.ZodString;
|
|
3784
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
3785
|
-
}, z.core.$strip>;
|
|
3786
|
-
}, z.core.$strict>;
|
|
3787
|
-
type JSONRPCError = z.infer<typeof JSONRPCErrorSchema>;
|
|
3788
|
-
declare const JSONRPCNotificationSchema: z.ZodObject<{
|
|
3789
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3790
|
-
method: z.ZodString;
|
|
3791
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3792
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3793
|
-
}, z.core.$loose>>;
|
|
3794
|
-
}, z.core.$strict>;
|
|
3795
|
-
type JSONRPCNotification = z.infer<typeof JSONRPCNotificationSchema>;
|
|
3796
|
-
declare const JSONRPCMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3797
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3798
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3799
|
-
method: z.ZodString;
|
|
3800
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3801
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3802
|
-
}, z.core.$loose>>;
|
|
3803
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3804
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3805
|
-
method: z.ZodString;
|
|
3806
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
3807
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3808
|
-
}, z.core.$loose>>;
|
|
3809
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3810
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3811
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3812
|
-
result: z.ZodObject<{
|
|
3813
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3814
|
-
}, z.core.$loose>;
|
|
3815
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
3816
|
-
jsonrpc: z.ZodLiteral<"2.0">;
|
|
3817
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3818
|
-
error: z.ZodObject<{
|
|
3819
|
-
code: z.ZodNumber;
|
|
3820
|
-
message: z.ZodString;
|
|
3821
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
3822
|
-
}, z.core.$strip>;
|
|
3823
|
-
}, z.core.$strict>]>;
|
|
3824
|
-
type JSONRPCMessage = z.infer<typeof JSONRPCMessageSchema>;
|
|
3825
|
-
|
|
3826
|
-
/**
|
|
3827
|
-
* Transport interface for MCP (Model Context Protocol) communication.
|
|
3828
|
-
* Maps to the `Transport` interface in the MCP spec.
|
|
3829
|
-
*/
|
|
3830
|
-
interface MCPTransport {
|
|
3831
|
-
/**
|
|
3832
|
-
* Initialize and start the transport
|
|
3833
|
-
*/
|
|
3834
|
-
start(): Promise<void>;
|
|
3835
|
-
/**
|
|
3836
|
-
* Send a JSON-RPC message through the transport
|
|
3837
|
-
* @param message The JSON-RPC message to send
|
|
3838
|
-
*/
|
|
3839
|
-
send(message: JSONRPCMessage): Promise<void>;
|
|
3840
|
-
/**
|
|
3841
|
-
* Clean up and close the transport
|
|
3842
|
-
*/
|
|
3843
|
-
close(): Promise<void>;
|
|
3844
|
-
/**
|
|
3845
|
-
* Event handler for transport closure
|
|
3846
|
-
*/
|
|
3847
|
-
onclose?: () => void;
|
|
3848
|
-
/**
|
|
3849
|
-
* Event handler for transport errors
|
|
3850
|
-
*/
|
|
3851
|
-
onerror?: (error: Error) => void;
|
|
3852
|
-
/**
|
|
3853
|
-
* Event handler for received messages
|
|
3854
|
-
*/
|
|
3855
|
-
onmessage?: (message: JSONRPCMessage) => void;
|
|
3856
|
-
}
|
|
3857
|
-
type MCPTransportConfig = {
|
|
3858
|
-
type: 'sse';
|
|
3859
|
-
/**
|
|
3860
|
-
* The URL of the MCP server.
|
|
3861
|
-
*/
|
|
3862
|
-
url: string;
|
|
3863
|
-
/**
|
|
3864
|
-
* Additional HTTP headers to be sent with requests.
|
|
3865
|
-
*/
|
|
3866
|
-
headers?: Record<string, string>;
|
|
3867
|
-
};
|
|
3868
|
-
|
|
3869
|
-
type ToolSchemas = Record<string, {
|
|
3870
|
-
inputSchema: FlexibleSchema<JSONObject | unknown>;
|
|
3871
|
-
}> | 'automatic' | undefined;
|
|
3872
|
-
type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
|
|
3873
|
-
inputSchema: FlexibleSchema<any>;
|
|
3874
|
-
}> ? {
|
|
3875
|
-
[K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
|
|
3876
|
-
inputSchema: FlexibleSchema<infer INPUT>;
|
|
3877
|
-
} ? Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> : never;
|
|
3878
|
-
} : McpToolSet<Record<string, {
|
|
3879
|
-
inputSchema: FlexibleSchema<unknown>;
|
|
3880
|
-
}>>;
|
|
3881
|
-
declare const CallToolResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
3882
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3883
|
-
content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
3884
|
-
type: z.ZodLiteral<"text">;
|
|
3885
|
-
text: z.ZodString;
|
|
3886
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3887
|
-
type: z.ZodLiteral<"image">;
|
|
3888
|
-
data: z.ZodBase64;
|
|
3889
|
-
mimeType: z.ZodString;
|
|
3890
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3891
|
-
type: z.ZodLiteral<"resource">;
|
|
3892
|
-
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
3893
|
-
uri: z.ZodString;
|
|
3894
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
3895
|
-
text: z.ZodString;
|
|
3896
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3897
|
-
uri: z.ZodString;
|
|
3898
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
3899
|
-
blob: z.ZodBase64;
|
|
3900
|
-
}, z.core.$loose>]>;
|
|
3901
|
-
}, z.core.$loose>]>>;
|
|
3902
|
-
isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
3903
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
3904
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3905
|
-
toolResult: z.ZodUnknown;
|
|
3906
|
-
}, z.core.$loose>]>;
|
|
3907
|
-
type CallToolResult = z.infer<typeof CallToolResultSchema>;
|
|
3908
|
-
|
|
3909
|
-
interface MCPClientConfig {
|
|
3910
|
-
/** Transport configuration for connecting to the MCP server */
|
|
3911
|
-
transport: MCPTransportConfig | MCPTransport;
|
|
3912
|
-
/** Optional callback for uncaught errors */
|
|
3913
|
-
onUncaughtError?: (error: unknown) => void;
|
|
3914
|
-
/** Optional client name, defaults to 'ai-sdk-mcp-client' */
|
|
3915
|
-
name?: string;
|
|
3916
|
-
}
|
|
3917
|
-
declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
|
|
3918
|
-
interface MCPClient {
|
|
3919
|
-
tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(options?: {
|
|
3920
|
-
schemas?: TOOL_SCHEMAS;
|
|
3921
|
-
}): Promise<McpToolSet<TOOL_SCHEMAS>>;
|
|
3922
|
-
close: () => Promise<void>;
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
3743
|
/**
|
|
3926
3744
|
The result of a `transcribe` call.
|
|
3927
3745
|
It contains the transcript and additional information.
|
|
@@ -4665,4 +4483,4 @@ declare global {
|
|
|
4665
4483
|
var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
|
|
4666
4484
|
}
|
|
4667
4485
|
|
|
4668
|
-
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,
|
|
4486
|
+
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, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, 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, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
|