@mastra/schema-compat 1.3.16-alpha.0 → 1.3.17-alpha.0
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/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +274 -889
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +1051 -1301
- package/dist/{esm-CWlHuVIx.js → esm-BG70JlG8.js} +60 -108
- package/dist/{esm-CWlHuVIx.js.map → esm-BG70JlG8.js.map} +1 -1
- package/dist/{esm-CkNCkZSB.cjs → esm-BQeGF7AD.cjs} +60 -108
- package/dist/{esm-CkNCkZSB.cjs.map → esm-BQeGF7AD.cjs.map} +1 -1
- package/dist/index.cjs +162 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +162 -185
- package/dist/index.js.map +1 -1
- package/dist/{json-schema-VSnKq6-P.cjs → json-schema-7oyknwMS.cjs} +241 -247
- package/dist/json-schema-7oyknwMS.cjs.map +1 -0
- package/dist/{json-schema-R8yfooPa.js → json-schema-BdCwqjfN.js} +241 -247
- package/dist/json-schema-BdCwqjfN.js.map +1 -0
- package/dist/{json-schema-traverse-B35mHRM8.js → json-schema-traverse-D0CId4oM.js} +5 -7
- package/dist/{json-schema-traverse-B35mHRM8.js.map → json-schema-traverse-D0CId4oM.js.map} +1 -1
- package/dist/{json-schema-traverse-DbuWNYgg.cjs → json-schema-traverse-evfp8uQX.cjs} +5 -7
- package/dist/{json-schema-traverse-DbuWNYgg.cjs.map → json-schema-traverse-evfp8uQX.cjs.map} +1 -1
- package/dist/json-to-zod.cjs +153 -142
- package/dist/json-to-zod.cjs.map +1 -1
- package/dist/json-to-zod.d.ts.map +1 -1
- package/dist/json-to-zod.js +153 -142
- package/dist/json-to-zod.js.map +1 -1
- package/dist/{schema-e0VHpMt0.js → schema-Bf12g7KC.js} +4 -6
- package/dist/{schema-e0VHpMt0.js.map → schema-Bf12g7KC.js.map} +1 -1
- package/dist/{schema-IhrnbMI3.cjs → schema-D2ab1-Dc.cjs} +5 -7
- package/dist/schema-D2ab1-Dc.cjs.map +1 -0
- package/dist/schema.cjs +1 -1
- package/dist/schema.js +1 -2
- package/dist/standard-schema/adapters/ai-sdk.cjs +2 -7
- package/dist/standard-schema/adapters/ai-sdk.cjs.map +1 -1
- package/dist/standard-schema/adapters/ai-sdk.js +2 -7
- package/dist/standard-schema/adapters/ai-sdk.js.map +1 -1
- package/dist/standard-schema/adapters/json-schema.cjs +1 -1
- package/dist/standard-schema/adapters/json-schema.js +1 -2
- package/dist/standard-schema/adapters/zod-v3.cjs +3 -4
- package/dist/standard-schema/adapters/zod-v3.cjs.map +1 -1
- package/dist/standard-schema/adapters/zod-v3.js +3 -4
- package/dist/standard-schema/adapters/zod-v3.js.map +1 -1
- package/dist/zod-to-json.cjs +6 -5
- package/dist/zod-to-json.cjs.map +1 -1
- package/dist/zod-to-json.js +6 -5
- package/dist/zod-to-json.js.map +1 -1
- package/package.json +24 -25
- package/dist/json-schema-R8yfooPa.js.map +0 -1
- package/dist/json-schema-VSnKq6-P.cjs.map +0 -1
- package/dist/schema-IhrnbMI3.cjs.map +0 -1
|
@@ -17,8 +17,13 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
17
17
|
private onFinish?;
|
|
18
18
|
private onData?;
|
|
19
19
|
private sendAutomaticallyWhen?;
|
|
20
|
+
private pendingApprovalMessageId;
|
|
20
21
|
private activeResponse;
|
|
22
|
+
private activeResumeRequest;
|
|
23
|
+
private resumableStreamState;
|
|
21
24
|
private jobExecutor;
|
|
25
|
+
private activeStopCount;
|
|
26
|
+
private stopGeneration;
|
|
22
27
|
constructor({ generateId, id, transport, messageMetadataSchema, dataPartSchemas, state, onError, onToolCall, onFinish, onData, sendAutomaticallyWhen, }: Omit<ChatInit<UI_MESSAGE>, 'messages'> & {
|
|
23
28
|
state: ChatState<UI_MESSAGE>;
|
|
24
29
|
});
|
|
@@ -81,11 +86,15 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
81
86
|
/** @deprecated Use addToolOutput */
|
|
82
87
|
addToolResult: ChatAddToolOutputFunction<UI_MESSAGE>;
|
|
83
88
|
/**
|
|
84
|
-
* Abort the current request
|
|
89
|
+
* Abort the current request, keep the generated tokens if any, and wait for
|
|
90
|
+
* the request pipeline to finish.
|
|
85
91
|
*/
|
|
86
92
|
stop: () => Promise<void>;
|
|
87
93
|
private shouldSendAutomatically;
|
|
94
|
+
private runAutomaticRequest;
|
|
95
|
+
private makeRequestForToolApproval;
|
|
88
96
|
private makeRequest;
|
|
97
|
+
private makeRequestImpl;
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
/**
|
|
@@ -138,7 +147,7 @@ export declare function addToolInputExamplesMiddleware({ prefix, format, remove,
|
|
|
138
147
|
* You can implement your own Agent by implementing the `Agent` interface,
|
|
139
148
|
* or use the `ToolLoopAgent` class.
|
|
140
149
|
*/
|
|
141
|
-
export declare interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
150
|
+
export declare interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> {
|
|
142
151
|
/**
|
|
143
152
|
* The specification version of the agent interface. This will enable
|
|
144
153
|
* us to evolve the agent interface and retain backwards compatibility.
|
|
@@ -306,8 +315,10 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
306
315
|
delay,
|
|
307
316
|
downloadBlob,
|
|
308
317
|
dynamicTool,
|
|
318
|
+
encodePathSegment,
|
|
309
319
|
executeTool,
|
|
310
320
|
extractResponseHeaders,
|
|
321
|
+
fetchWithValidatedEndpoint,
|
|
311
322
|
fetchWithValidatedRedirects,
|
|
312
323
|
generateId,
|
|
313
324
|
getErrorMessage,
|
|
@@ -385,38 +396,6 @@ export declare class AISDKError extends Error {
|
|
|
385
396
|
protected static hasMarker(error: unknown, marker: string): boolean;
|
|
386
397
|
}
|
|
387
398
|
|
|
388
|
-
/**
|
|
389
|
-
* Custom error class for AI SDK related errors.
|
|
390
|
-
* @extends Error
|
|
391
|
-
*/
|
|
392
|
-
declare class AISDKError_2 extends Error {
|
|
393
|
-
private readonly [symbol$d_2];
|
|
394
|
-
/**
|
|
395
|
-
* The underlying cause of the error, if any.
|
|
396
|
-
*/
|
|
397
|
-
readonly cause?: unknown;
|
|
398
|
-
/**
|
|
399
|
-
* Creates an AI SDK Error.
|
|
400
|
-
*
|
|
401
|
-
* @param {Object} params - The parameters for creating the error.
|
|
402
|
-
* @param {string} params.name - The name of the error.
|
|
403
|
-
* @param {string} params.message - The error message.
|
|
404
|
-
* @param {unknown} [params.cause] - The underlying cause of the error.
|
|
405
|
-
*/
|
|
406
|
-
constructor({ name, message, cause, }: {
|
|
407
|
-
name: string;
|
|
408
|
-
message: string;
|
|
409
|
-
cause?: unknown;
|
|
410
|
-
});
|
|
411
|
-
/**
|
|
412
|
-
* Checks if the given error is an AI SDK Error.
|
|
413
|
-
* @param {unknown} error - The error to check.
|
|
414
|
-
* @returns {boolean} True if the error is an AI SDK Error, false otherwise.
|
|
415
|
-
*/
|
|
416
|
-
static isInstance(error: unknown): error is AISDKError_2;
|
|
417
|
-
protected static hasMarker(error: unknown, marker: string): boolean;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
399
|
export declare class APICallError extends AISDKError {
|
|
421
400
|
private readonly [symbol$c];
|
|
422
401
|
readonly url: string;
|
|
@@ -441,30 +420,6 @@ export declare class APICallError extends AISDKError {
|
|
|
441
420
|
static isInstance(error: unknown): error is APICallError;
|
|
442
421
|
}
|
|
443
422
|
|
|
444
|
-
declare class APICallError_2 extends AISDKError_2 {
|
|
445
|
-
private readonly [symbol$c_2];
|
|
446
|
-
readonly url: string;
|
|
447
|
-
readonly requestBodyValues: unknown;
|
|
448
|
-
readonly statusCode?: number;
|
|
449
|
-
readonly responseHeaders?: Record<string, string>;
|
|
450
|
-
readonly responseBody?: string;
|
|
451
|
-
readonly isRetryable: boolean;
|
|
452
|
-
readonly data?: unknown;
|
|
453
|
-
constructor({ message, url, requestBodyValues, statusCode, responseHeaders, responseBody, cause, isRetryable, // server error
|
|
454
|
-
data, }: {
|
|
455
|
-
message: string;
|
|
456
|
-
url: string;
|
|
457
|
-
requestBodyValues: unknown;
|
|
458
|
-
statusCode?: number;
|
|
459
|
-
responseHeaders?: Record<string, string>;
|
|
460
|
-
responseBody?: string;
|
|
461
|
-
cause?: unknown;
|
|
462
|
-
isRetryable?: boolean;
|
|
463
|
-
data?: unknown;
|
|
464
|
-
});
|
|
465
|
-
static isInstance(error: unknown): error is APICallError_2;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
423
|
export declare function asSchema<OBJECT>(schema: FlexibleSchema<OBJECT> | undefined): Schema<OBJECT>;
|
|
469
424
|
|
|
470
425
|
/**
|
|
@@ -532,6 +487,124 @@ declare type BaseToolCall = {
|
|
|
532
487
|
*/
|
|
533
488
|
export declare function bindTelemetryIntegration(integration: TelemetryIntegration): TelemetryIntegration;
|
|
534
489
|
|
|
490
|
+
declare interface BrowserbaseFetchConfig {
|
|
491
|
+
/** Whether to follow HTTP redirects (default: false). */
|
|
492
|
+
allowRedirects?: boolean;
|
|
493
|
+
/** Whether to bypass TLS certificate verification (default: false). */
|
|
494
|
+
allowInsecureSsl?: boolean;
|
|
495
|
+
/** Whether to route the request through Browserbase proxies (default: false). */
|
|
496
|
+
proxies?: boolean;
|
|
497
|
+
/** Output format for the response content (default: raw). */
|
|
498
|
+
format?: BrowserbaseFetchFormat;
|
|
499
|
+
/**
|
|
500
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
501
|
+
* is json.
|
|
502
|
+
*/
|
|
503
|
+
schema?: Record<string, unknown>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare interface BrowserbaseFetchError {
|
|
507
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
508
|
+
statusCode?: number;
|
|
509
|
+
message: string;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
declare type BrowserbaseFetchFormat = 'raw' | 'json' | 'markdown';
|
|
513
|
+
|
|
514
|
+
declare interface BrowserbaseFetchInput {
|
|
515
|
+
/** URL of the page to fetch. */
|
|
516
|
+
url: string;
|
|
517
|
+
/** Whether to follow HTTP redirects. */
|
|
518
|
+
allow_redirects?: boolean;
|
|
519
|
+
/** Whether to bypass TLS certificate verification. */
|
|
520
|
+
allow_insecure_ssl?: boolean;
|
|
521
|
+
/** Whether to route the request through Browserbase proxies. */
|
|
522
|
+
proxies?: boolean;
|
|
523
|
+
/** Output format for the response content. */
|
|
524
|
+
format?: BrowserbaseFetchFormat;
|
|
525
|
+
/**
|
|
526
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
527
|
+
* is json.
|
|
528
|
+
*/
|
|
529
|
+
schema?: Record<string, unknown>;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
declare type BrowserbaseFetchOutput = BrowserbaseFetchError | BrowserbaseFetchResponse;
|
|
533
|
+
|
|
534
|
+
declare interface BrowserbaseFetchResponse {
|
|
535
|
+
/** Unique identifier for the fetch request. */
|
|
536
|
+
id: string;
|
|
537
|
+
/**
|
|
538
|
+
* Response body. Raw and markdown responses return strings; JSON extraction
|
|
539
|
+
* returns an object matching the requested schema.
|
|
540
|
+
*/
|
|
541
|
+
content: string | Record<string, unknown>;
|
|
542
|
+
/** MIME type of the response. */
|
|
543
|
+
contentType: string;
|
|
544
|
+
/** Character encoding of the response. */
|
|
545
|
+
encoding: string;
|
|
546
|
+
/** Response headers from the fetched page. */
|
|
547
|
+
headers: Record<string, string>;
|
|
548
|
+
/** HTTP status code returned by the fetched page. */
|
|
549
|
+
statusCode: number;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare const browserbaseFetchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<BrowserbaseFetchInput, BrowserbaseFetchOutput, BrowserbaseFetchConfig>;
|
|
553
|
+
|
|
554
|
+
declare interface BrowserbaseSearchConfig {
|
|
555
|
+
/**
|
|
556
|
+
* Default maximum number of results to return (1-25, default: 10).
|
|
557
|
+
*/
|
|
558
|
+
numResults?: number;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
declare interface BrowserbaseSearchError {
|
|
562
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
563
|
+
statusCode?: number;
|
|
564
|
+
message: string;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
declare interface BrowserbaseSearchInput {
|
|
568
|
+
/**
|
|
569
|
+
* Web search query (1-200 characters).
|
|
570
|
+
*/
|
|
571
|
+
query: string;
|
|
572
|
+
/**
|
|
573
|
+
* Maximum number of results to return (1-25, default: 10).
|
|
574
|
+
*/
|
|
575
|
+
num_results?: number;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
declare type BrowserbaseSearchOutput = BrowserbaseSearchError | BrowserbaseSearchResponse;
|
|
579
|
+
|
|
580
|
+
declare interface BrowserbaseSearchResponse {
|
|
581
|
+
/** The search query that was executed. */
|
|
582
|
+
query: string;
|
|
583
|
+
/** Unique identifier for the request. */
|
|
584
|
+
requestId: string;
|
|
585
|
+
/** Search results. */
|
|
586
|
+
results: BrowserbaseSearchResult[];
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
declare interface BrowserbaseSearchResult {
|
|
590
|
+
/** Unique identifier for the result. */
|
|
591
|
+
id: string;
|
|
592
|
+
/** Title of the search result. */
|
|
593
|
+
title: string;
|
|
594
|
+
/** URL of the search result. */
|
|
595
|
+
url: string;
|
|
596
|
+
/** Author of the content, when available. */
|
|
597
|
+
author?: string;
|
|
598
|
+
/** Favicon URL, when available. */
|
|
599
|
+
favicon?: string;
|
|
600
|
+
/** Image URL, when available. */
|
|
601
|
+
image?: string;
|
|
602
|
+
/** Publication date in ISO 8601 format, when available. */
|
|
603
|
+
publishedDate?: string;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
declare const browserbaseSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<BrowserbaseSearchInput, BrowserbaseSearchOutput, BrowserbaseSearchConfig>;
|
|
607
|
+
|
|
535
608
|
/**
|
|
536
609
|
* Common model information used across callback events.
|
|
537
610
|
*/
|
|
@@ -810,6 +883,12 @@ export declare type ChatStatus = 'submitted' | 'streaming' | 'ready' | 'error';
|
|
|
810
883
|
* @template UI_MESSAGE - The UI message type extending UIMessage
|
|
811
884
|
*/
|
|
812
885
|
export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
886
|
+
/**
|
|
887
|
+
* Whether reconnecting returns the complete response from its beginning.
|
|
888
|
+
* Complete replays must reset the streaming message state before processing
|
|
889
|
+
* the first start chunk.
|
|
890
|
+
*/
|
|
891
|
+
readonly resumeStreamIsReplay?: boolean;
|
|
813
892
|
/**
|
|
814
893
|
* Sends messages to the chat API endpoint and returns a streaming response.
|
|
815
894
|
*
|
|
@@ -858,6 +937,7 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
|
858
937
|
*
|
|
859
938
|
* @param options - Configuration object containing:
|
|
860
939
|
* @param options.chatId - Unique identifier for the chat session to reconnect to
|
|
940
|
+
* @param options.abortSignal - Signal to abort the reconnection request if needed
|
|
861
941
|
* @param options.headers - Additional HTTP headers to include in the reconnection request
|
|
862
942
|
* @param options.body - Additional JSON properties to include in the request body
|
|
863
943
|
* @param options.metadata - Custom metadata to attach to the request
|
|
@@ -871,6 +951,8 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
|
871
951
|
reconnectToStream: (options: {
|
|
872
952
|
/** Unique identifier for the chat session to reconnect to */
|
|
873
953
|
chatId: string;
|
|
954
|
+
/** Signal to abort the reconnection request if needed */
|
|
955
|
+
abortSignal?: AbortSignal;
|
|
874
956
|
} & ChatRequestOptions) => Promise<ReadableStream<UIMessageChunk> | null>;
|
|
875
957
|
}
|
|
876
958
|
|
|
@@ -908,9 +990,10 @@ export declare type CompletionRequestOptions = {
|
|
|
908
990
|
* @param options.onError - Optional callback to handle errors that occur during consumption.
|
|
909
991
|
* @returns A promise that resolves when the stream is fully consumed.
|
|
910
992
|
*/
|
|
911
|
-
export declare function consumeStream({ stream, onError, }: {
|
|
993
|
+
export declare function consumeStream({ stream, onError, abortSignal, }: {
|
|
912
994
|
stream: ReadableStream;
|
|
913
995
|
onError?: (error: unknown) => void;
|
|
996
|
+
abortSignal?: AbortSignal;
|
|
914
997
|
}): Promise<void>;
|
|
915
998
|
|
|
916
999
|
declare type ConsumeStreamOptions = {
|
|
@@ -988,7 +1071,7 @@ export declare function convertFileListToFileUIParts(files: FileList | undefined
|
|
|
988
1071
|
* If the file is base64 data, it returns a data URI with the base64 data.
|
|
989
1072
|
* If the file is a Uint8Array, it converts it to base64 and returns a data URI.
|
|
990
1073
|
*/
|
|
991
|
-
declare function convertImageModelFileToDataUri(file:
|
|
1074
|
+
declare function convertImageModelFileToDataUri(file: ImageModelV3File): string;
|
|
992
1075
|
|
|
993
1076
|
declare function convertToBase64(value: string | Uint8Array): string;
|
|
994
1077
|
|
|
@@ -1063,7 +1146,7 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1063
1146
|
* Runs the agent and stream the output as a UI message stream.
|
|
1064
1147
|
*
|
|
1065
1148
|
* @param agent - The agent to run.
|
|
1066
|
-
* @param uiMessages - The input UI messages.
|
|
1149
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
1067
1150
|
* @param abortSignal - The abort signal. Optional.
|
|
1068
1151
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1069
1152
|
* @param options - The options for the agent.
|
|
@@ -1072,9 +1155,9 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1072
1155
|
*
|
|
1073
1156
|
* @returns The UI message stream.
|
|
1074
1157
|
*/
|
|
1075
|
-
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1158
|
+
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ agent, uiMessages, options, abortSignal, timeout, experimental_transform, onStepFinish, ...uiMessageStreamOptions }: {
|
|
1076
1159
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
1077
|
-
uiMessages
|
|
1160
|
+
uiMessages?: unknown[];
|
|
1078
1161
|
abortSignal?: AbortSignal;
|
|
1079
1162
|
timeout?: TimeoutConfiguration;
|
|
1080
1163
|
options?: CALL_OPTIONS;
|
|
@@ -1086,7 +1169,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1086
1169
|
* Runs the agent and returns a response object with a UI message stream.
|
|
1087
1170
|
*
|
|
1088
1171
|
* @param agent - The agent to run.
|
|
1089
|
-
* @param uiMessages - The input UI messages.
|
|
1172
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
1090
1173
|
* @param abortSignal - Abort signal. Optional.
|
|
1091
1174
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1092
1175
|
* @param options - The options for the agent. Optional.
|
|
@@ -1095,13 +1178,14 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1095
1178
|
* @param headers - Additional headers for the response. Optional.
|
|
1096
1179
|
* @param status - The status code for the response. Optional.
|
|
1097
1180
|
* @param statusText - The status text for the response. Optional.
|
|
1181
|
+
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
1098
1182
|
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
1099
1183
|
*
|
|
1100
1184
|
* @returns The response object.
|
|
1101
1185
|
*/
|
|
1102
|
-
export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1186
|
+
export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
1103
1187
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
1104
|
-
uiMessages
|
|
1188
|
+
uiMessages?: unknown[];
|
|
1105
1189
|
abortSignal?: AbortSignal;
|
|
1106
1190
|
timeout?: TimeoutConfiguration;
|
|
1107
1191
|
options?: CALL_OPTIONS;
|
|
@@ -1156,7 +1240,7 @@ declare const createJsonErrorResponseHandler: <T>({ errorSchema, errorToMessage,
|
|
|
1156
1240
|
errorSchema: FlexibleSchema<T>;
|
|
1157
1241
|
errorToMessage: (error: T) => string;
|
|
1158
1242
|
isRetryable?: (response: Response, error?: T) => boolean;
|
|
1159
|
-
}) => ResponseHandler<
|
|
1243
|
+
}) => ResponseHandler<APICallError>;
|
|
1160
1244
|
|
|
1161
1245
|
declare const createJsonResponseHandler: <T>(responseSchema: FlexibleSchema<T>) => ResponseHandler<T>;
|
|
1162
1246
|
|
|
@@ -1201,7 +1285,7 @@ declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS e
|
|
|
1201
1285
|
supportsDeferredResults?: boolean;
|
|
1202
1286
|
}): ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS>;
|
|
1203
1287
|
|
|
1204
|
-
declare const createStatusCodeErrorResponseHandler: () => ResponseHandler<
|
|
1288
|
+
declare const createStatusCodeErrorResponseHandler: () => ResponseHandler<APICallError>;
|
|
1205
1289
|
|
|
1206
1290
|
/**
|
|
1207
1291
|
* Creates a Response object from a text stream.
|
|
@@ -1227,7 +1311,7 @@ declare function createToolNameMapping({ tools, providerToolNames, resolveProvid
|
|
|
1227
1311
|
/**
|
|
1228
1312
|
* Tools that were passed to the language model.
|
|
1229
1313
|
*/
|
|
1230
|
-
tools: Array<
|
|
1314
|
+
tools: Array<LanguageModelV3FunctionTool | LanguageModelV3ProviderTool> | undefined;
|
|
1231
1315
|
/**
|
|
1232
1316
|
* Maps the provider tool ids to the provider tool names.
|
|
1233
1317
|
*/
|
|
@@ -1236,7 +1320,7 @@ declare function createToolNameMapping({ tools, providerToolNames, resolveProvid
|
|
|
1236
1320
|
* Optional resolver for provider tool names that cannot be represented as
|
|
1237
1321
|
* static id -> name mappings (e.g. dynamic provider names).
|
|
1238
1322
|
*/
|
|
1239
|
-
resolveProviderToolName?: (tool:
|
|
1323
|
+
resolveProviderToolName?: (tool: LanguageModelV3ProviderTool) => string | undefined;
|
|
1240
1324
|
}): ToolNameMapping;
|
|
1241
1325
|
|
|
1242
1326
|
export declare type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESSAGE, 'id' | 'role'> & {
|
|
@@ -1260,7 +1344,7 @@ export declare type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESS
|
|
|
1260
1344
|
export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ execute, onError, // prevent leaking server error details to the client by default
|
|
1261
1345
|
originalMessages, onStepFinish, onFinish, generateId, }: {
|
|
1262
1346
|
execute: (options: {
|
|
1263
|
-
writer:
|
|
1347
|
+
writer: UIMessageStreamWriterWithOutcome<UI_MESSAGE>;
|
|
1264
1348
|
}) => Promise<void> | void;
|
|
1265
1349
|
onError?: (error: unknown) => string;
|
|
1266
1350
|
/**
|
|
@@ -1284,11 +1368,12 @@ export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ ex
|
|
|
1284
1368
|
* @param options.statusText - The HTTP status text for the response.
|
|
1285
1369
|
* @param options.headers - Additional HTTP headers to include in the response.
|
|
1286
1370
|
* @param options.stream - The UI message chunk stream to send.
|
|
1371
|
+
* @param options.keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
1287
1372
|
* @param options.consumeSseStream - Optional callback to consume a copy of the SSE stream independently.
|
|
1288
1373
|
*
|
|
1289
1374
|
* @returns A `Response` object with the UI message stream as the body.
|
|
1290
1375
|
*/
|
|
1291
|
-
export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, consumeSseStream, }: UIMessageStreamResponseInit & {
|
|
1376
|
+
export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: UIMessageStreamResponseInit & {
|
|
1292
1377
|
stream: ReadableStream<UIMessageChunk>;
|
|
1293
1378
|
}): Response;
|
|
1294
1379
|
|
|
@@ -1373,7 +1458,15 @@ declare type DeepPartialInternal<T> = T extends null | undefined | string | numb
|
|
|
1373
1458
|
declare const DEFAULT_MAX_DOWNLOAD_SIZE: number;
|
|
1374
1459
|
|
|
1375
1460
|
export declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
|
|
1376
|
-
|
|
1461
|
+
readonly resumeStreamIsReplay: boolean;
|
|
1462
|
+
constructor({ resumeStreamIsReplay, ...options }?: HttpChatTransportInitOptions<UI_MESSAGE> & {
|
|
1463
|
+
/**
|
|
1464
|
+
* Whether resumed streams replay the response from the beginning.
|
|
1465
|
+
* Defaults to true. Set to false for endpoints that only continue the
|
|
1466
|
+
* interrupted response, even when they emit a start chunk.
|
|
1467
|
+
*/
|
|
1468
|
+
resumeStreamIsReplay?: boolean;
|
|
1469
|
+
});
|
|
1377
1470
|
protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageChunk>;
|
|
1378
1471
|
}
|
|
1379
1472
|
|
|
@@ -1467,7 +1560,7 @@ declare class DelayedPromise<T> {
|
|
|
1467
1560
|
* });
|
|
1468
1561
|
* ```
|
|
1469
1562
|
*/
|
|
1470
|
-
export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1563
|
+
export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>> = UIMessage<unknown, never, InferUITools<TOOLS>>> implements ChatTransport<UI_MESSAGE> {
|
|
1471
1564
|
private readonly agent;
|
|
1472
1565
|
private readonly agentOptions;
|
|
1473
1566
|
private readonly uiMessageStreamOptions;
|
|
@@ -1485,7 +1578,7 @@ export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends Too
|
|
|
1485
1578
|
/**
|
|
1486
1579
|
* Options for the `DirectChatTransport` class.
|
|
1487
1580
|
*/
|
|
1488
|
-
export declare type DirectChatTransportOptions<CALL_OPTIONS, TOOLS extends ToolSet, OUTPUT extends
|
|
1581
|
+
export declare type DirectChatTransportOptions<CALL_OPTIONS, TOOLS extends ToolSet, OUTPUT extends OutputInterface, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>>> = {
|
|
1489
1582
|
/**
|
|
1490
1583
|
* The agent to use for generating responses.
|
|
1491
1584
|
*/
|
|
@@ -1512,7 +1605,7 @@ declare function downloadBlob(url: string, options?: {
|
|
|
1512
1605
|
abortSignal?: AbortSignal;
|
|
1513
1606
|
}): Promise<Blob>;
|
|
1514
1607
|
|
|
1515
|
-
export declare class DownloadError extends
|
|
1608
|
+
export declare class DownloadError extends AISDKError {
|
|
1516
1609
|
private readonly [symbol_2];
|
|
1517
1610
|
readonly url: string;
|
|
1518
1611
|
readonly statusCode?: number;
|
|
@@ -1534,7 +1627,7 @@ export declare function dynamicTool(tool: {
|
|
|
1534
1627
|
description?: string;
|
|
1535
1628
|
title?: string;
|
|
1536
1629
|
providerOptions?: ProviderOptions;
|
|
1537
|
-
metadata?:
|
|
1630
|
+
metadata?: JSONObject;
|
|
1538
1631
|
inputSchema: FlexibleSchema<unknown>;
|
|
1539
1632
|
execute: ToolExecuteFunction<unknown, unknown>;
|
|
1540
1633
|
/**
|
|
@@ -1609,6 +1702,13 @@ export declare type DynamicToolResult = {
|
|
|
1609
1702
|
|
|
1610
1703
|
export declare type DynamicToolUIPart = {
|
|
1611
1704
|
type: 'dynamic-tool';
|
|
1705
|
+
/**
|
|
1706
|
+
* `false` when a static tool part was normalized to a dynamic tool part
|
|
1707
|
+
* because its current tool schema was unavailable or incompatible.
|
|
1708
|
+
*
|
|
1709
|
+
* This preserves its static origin across persistence boundaries.
|
|
1710
|
+
*/
|
|
1711
|
+
dynamic?: false;
|
|
1612
1712
|
/**
|
|
1613
1713
|
* Name of the tool that is being called.
|
|
1614
1714
|
*/
|
|
@@ -1626,6 +1726,15 @@ export declare type DynamicToolUIPart = {
|
|
|
1626
1726
|
} & ({
|
|
1627
1727
|
state: 'input-streaming';
|
|
1628
1728
|
input?: unknown;
|
|
1729
|
+
/**
|
|
1730
|
+
* The raw tool input text received so far.
|
|
1731
|
+
*
|
|
1732
|
+
* This is used to continue input streaming when a message is persisted
|
|
1733
|
+
* and later resumed.
|
|
1734
|
+
*/
|
|
1735
|
+
rawInput?: string;
|
|
1736
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
1737
|
+
inputEncoding?: 'json' | 'text';
|
|
1629
1738
|
output?: never;
|
|
1630
1739
|
errorText?: never;
|
|
1631
1740
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -1646,8 +1755,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1646
1755
|
approval: {
|
|
1647
1756
|
id: string;
|
|
1648
1757
|
approved?: never;
|
|
1758
|
+
descriptor?: unknown;
|
|
1649
1759
|
reason?: never;
|
|
1650
1760
|
signature?: string;
|
|
1761
|
+
inputSchemaInput?: unknown;
|
|
1651
1762
|
};
|
|
1652
1763
|
} | {
|
|
1653
1764
|
state: 'approval-responded';
|
|
@@ -1658,8 +1769,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1658
1769
|
approval: {
|
|
1659
1770
|
id: string;
|
|
1660
1771
|
approved: boolean;
|
|
1772
|
+
descriptor?: unknown;
|
|
1661
1773
|
reason?: string;
|
|
1662
1774
|
signature?: string;
|
|
1775
|
+
inputSchemaInput?: unknown;
|
|
1663
1776
|
};
|
|
1664
1777
|
} | {
|
|
1665
1778
|
state: 'output-available';
|
|
@@ -1672,8 +1785,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1672
1785
|
approval?: {
|
|
1673
1786
|
id: string;
|
|
1674
1787
|
approved: true;
|
|
1788
|
+
descriptor?: unknown;
|
|
1675
1789
|
reason?: string;
|
|
1676
1790
|
signature?: string;
|
|
1791
|
+
inputSchemaInput?: unknown;
|
|
1677
1792
|
};
|
|
1678
1793
|
} | {
|
|
1679
1794
|
state: 'output-error';
|
|
@@ -1685,8 +1800,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1685
1800
|
approval?: {
|
|
1686
1801
|
id: string;
|
|
1687
1802
|
approved: true;
|
|
1803
|
+
descriptor?: unknown;
|
|
1688
1804
|
reason?: string;
|
|
1689
1805
|
signature?: string;
|
|
1806
|
+
inputSchemaInput?: unknown;
|
|
1690
1807
|
};
|
|
1691
1808
|
} | {
|
|
1692
1809
|
state: 'output-denied';
|
|
@@ -1697,8 +1814,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1697
1814
|
approval: {
|
|
1698
1815
|
id: string;
|
|
1699
1816
|
approved: false;
|
|
1817
|
+
descriptor?: unknown;
|
|
1700
1818
|
reason?: string;
|
|
1701
1819
|
signature?: string;
|
|
1820
|
+
inputSchemaInput?: unknown;
|
|
1702
1821
|
};
|
|
1703
1822
|
});
|
|
1704
1823
|
|
|
@@ -1786,11 +1905,11 @@ export declare type EmbeddingModel = string | EmbeddingModelV3 | EmbeddingModelV
|
|
|
1786
1905
|
export declare type EmbeddingModelMiddleware = EmbeddingModelV3Middleware;
|
|
1787
1906
|
|
|
1788
1907
|
declare type EmbeddingModelProviderOptionsTransformer = (options: {
|
|
1789
|
-
providerOptions:
|
|
1908
|
+
providerOptions: SharedV3ProviderOptions | undefined;
|
|
1790
1909
|
values: Array<string>;
|
|
1791
1910
|
startIndex: number;
|
|
1792
1911
|
endIndex: number;
|
|
1793
|
-
}) =>
|
|
1912
|
+
}) => SharedV3ProviderOptions | undefined | PromiseLike<SharedV3ProviderOptions | undefined>;
|
|
1794
1913
|
|
|
1795
1914
|
/**
|
|
1796
1915
|
* Represents the number of tokens used in an embedding.
|
|
@@ -2080,8 +2199,9 @@ declare type EmbeddingModelV3Result = {
|
|
|
2080
2199
|
* Embed several values using an embedding model. The type of the value is defined
|
|
2081
2200
|
* by the embedding model.
|
|
2082
2201
|
*
|
|
2083
|
-
* `embedMany` automatically splits large requests into smaller chunks
|
|
2084
|
-
* has a limit on
|
|
2202
|
+
* `embedMany` automatically splits large requests into smaller chunks when the
|
|
2203
|
+
* model has a limit on either the number of embeddings or the UTF-8 input bytes
|
|
2204
|
+
* that can be processed in a single call.
|
|
2085
2205
|
*
|
|
2086
2206
|
* @param model - The embedding model to use.
|
|
2087
2207
|
* @param values - The values that should be embedded.
|
|
@@ -2230,6 +2350,21 @@ export declare class EmptyResponseBodyError extends AISDKError {
|
|
|
2230
2350
|
static isInstance(error: unknown): error is EmptyResponseBodyError;
|
|
2231
2351
|
}
|
|
2232
2352
|
|
|
2353
|
+
/**
|
|
2354
|
+
* Encodes a raw identifier as one URL path segment, including standalone dot
|
|
2355
|
+
* segments that URL parsers would otherwise normalize. Pass unencoded values;
|
|
2356
|
+
* for resource paths with intentional slashes, encode each segment separately.
|
|
2357
|
+
*/
|
|
2358
|
+
declare function encodePathSegment(value: string): string;
|
|
2359
|
+
|
|
2360
|
+
declare type EnforcedToolChoice = Extract<LanguageModelV3ToolChoice, {
|
|
2361
|
+
type: 'none';
|
|
2362
|
+
} | {
|
|
2363
|
+
type: 'required';
|
|
2364
|
+
} | {
|
|
2365
|
+
type: 'tool';
|
|
2366
|
+
}>;
|
|
2367
|
+
|
|
2233
2368
|
declare type EnrichedStreamPart<TOOLS extends ToolSet, PARTIAL_OUTPUT> = {
|
|
2234
2369
|
part: TextStreamPart<TOOLS>;
|
|
2235
2370
|
partialOutput: PARTIAL_OUTPUT | undefined;
|
|
@@ -2276,7 +2411,7 @@ declare interface EventSourceMessage {
|
|
|
2276
2411
|
* const eventStream =
|
|
2277
2412
|
* response.body
|
|
2278
2413
|
* .pipeThrough(new TextDecoderStream())
|
|
2279
|
-
* .pipeThrough(new EventSourceParserStream({
|
|
2414
|
+
* .pipeThrough(new EventSourceParserStream({onError: 'terminate'}))
|
|
2280
2415
|
* ```
|
|
2281
2416
|
*
|
|
2282
2417
|
* @public
|
|
@@ -2285,7 +2420,7 @@ declare class EventSourceParserStream extends TransformStream<
|
|
|
2285
2420
|
string,
|
|
2286
2421
|
EventSourceMessage
|
|
2287
2422
|
> {
|
|
2288
|
-
constructor({ onError, onRetry, onComment }?: StreamOptions);
|
|
2423
|
+
constructor({ onError, onRetry, onComment, maxBufferSize }?: StreamOptions);
|
|
2289
2424
|
}
|
|
2290
2425
|
|
|
2291
2426
|
declare type ExaSearchCategory = 'company' | 'people' | 'research paper' | 'news' | 'personal site' | 'financial report';
|
|
@@ -2611,9 +2746,10 @@ export declare function experimental_generateVideo({ model: modelArg, prompt: pr
|
|
|
2611
2746
|
*/
|
|
2612
2747
|
maxVideosPerCall?: number;
|
|
2613
2748
|
/**
|
|
2614
|
-
* Aspect ratio of the videos to generate. Must have the format
|
|
2749
|
+
* Aspect ratio of the videos to generate. Must have the format
|
|
2750
|
+
* `{width}:{height}`, or `'adaptive'` to inherit the ratio from the input media.
|
|
2615
2751
|
*/
|
|
2616
|
-
aspectRatio?: `${number}:${number}
|
|
2752
|
+
aspectRatio?: `${number}:${number}` | 'adaptive';
|
|
2617
2753
|
/**
|
|
2618
2754
|
* Resolution of the videos to generate. Must have the format `{width}x{height}`.
|
|
2619
2755
|
*/
|
|
@@ -2881,38 +3017,82 @@ declare function extractResponseHeaders(response: Response): {
|
|
|
2881
3017
|
declare type FetchFunction = typeof globalThis.fetch;
|
|
2882
3018
|
|
|
2883
3019
|
/**
|
|
2884
|
-
* Fetches
|
|
3020
|
+
* Fetches one validated URL without following redirects.
|
|
3021
|
+
*
|
|
3022
|
+
* On Node.js, the default fetch validates and pins DNS results at connect time.
|
|
3023
|
+
* An injected fetch is responsible for equivalent connect-time validation.
|
|
3024
|
+
* Redirects are rejected by default. Callers using `redirect: 'manual'` must
|
|
3025
|
+
* validate the Location target before issuing another request.
|
|
3026
|
+
*/
|
|
3027
|
+
declare function fetchWithValidatedEndpoint({ url, init, fetch: customFetch, trustedOrigin, redirect, }: {
|
|
3028
|
+
url: string | URL;
|
|
3029
|
+
init?: RequestInit;
|
|
3030
|
+
fetch?: FetchFunction;
|
|
3031
|
+
/**
|
|
3032
|
+
* A developer-configured origin that may legitimately resolve to a private
|
|
3033
|
+
* address. This must never be derived from untrusted response data.
|
|
3034
|
+
*/
|
|
3035
|
+
trustedOrigin?: string;
|
|
3036
|
+
redirect?: 'error' | 'manual';
|
|
3037
|
+
}): Promise<Response>;
|
|
3038
|
+
|
|
3039
|
+
/**
|
|
3040
|
+
* Fetches a URL while enforcing the download guard on every hop.
|
|
2885
3041
|
*
|
|
2886
3042
|
* Redirects are followed manually (`redirect: 'manual'`) so each hop is
|
|
2887
3043
|
* validated with {@link validateDownloadUrl} *before* it is requested. Relying
|
|
2888
3044
|
* on the default `redirect: 'follow'` would issue the request to a redirect
|
|
2889
3045
|
* target (e.g. an internal address) before we ever see its URL, defeating the
|
|
2890
|
-
*
|
|
3046
|
+
* guard.
|
|
3047
|
+
*
|
|
3048
|
+
* Request headers are also protected: {@link sanitizeRequestHeaders} strips
|
|
3049
|
+
* proxy/metadata/cookie/hop-by-hop headers before the first request, and all
|
|
3050
|
+
* caller headers except `User-Agent` are dropped on a cross-origin redirect.
|
|
3051
|
+
* Credentials and custom headers are preserved on the first hop for backwards
|
|
3052
|
+
* compatibility. The caller must ensure that the initial URL may receive them.
|
|
3053
|
+
* The fetch spec only strips `Authorization` on cross-origin redirects because
|
|
3054
|
+
* in a browser, CORS preflighting protects custom headers; there is no CORS on
|
|
3055
|
+
* the server, so provider API keys carried in custom headers (e.g. `x-key`)
|
|
3056
|
+
* must be dropped here as well.
|
|
2891
3057
|
*
|
|
2892
3058
|
* A `redirect: 'manual'` request yields an unreadable opaque response in the
|
|
2893
3059
|
* browser (and in other spec-compliant fetch implementations), so the redirect
|
|
2894
3060
|
* target cannot be validated here. In a real browser this is safe to follow
|
|
2895
|
-
* natively because
|
|
2896
|
-
* cannot reach a server's internal network or
|
|
2897
|
-
* runtime we cannot validate the hop, so we fail
|
|
2898
|
-
* blindly and bypass the
|
|
3061
|
+
* natively because reaching an internal network is not possible (fetch is
|
|
3062
|
+
* constrained by CORS and cannot reach a server's internal network or
|
|
3063
|
+
* cloud-metadata). On any other runtime we cannot validate the hop, so we fail
|
|
3064
|
+
* closed rather than follow it blindly and bypass the guard.
|
|
3065
|
+
*
|
|
3066
|
+
* A hop that is same-origin with `trustedOrigin` (the developer-configured
|
|
3067
|
+
* provider endpoint) skips target validation: that origin is exactly what an
|
|
3068
|
+
* unvalidated, config-derived request would fetch anyway, and validating it
|
|
3069
|
+
* would break legitimate self-hosted / localhost deployments whose response
|
|
3070
|
+
* URLs point back at the configured host. Hops on any other origin are always
|
|
3071
|
+
* validated.
|
|
2899
3072
|
*
|
|
2900
3073
|
* The returned response is the final (non-redirect) response. The caller is
|
|
2901
3074
|
* responsible for checking `response.ok` and reading the body.
|
|
2902
3075
|
*
|
|
2903
3076
|
* On Node.js, the default fetch resolves every hostname through a validating
|
|
2904
3077
|
* lookup hook and passes those exact addresses to the connector, preventing
|
|
2905
|
-
* hostname-to-private-IP and DNS-rebinding bypasses.
|
|
3078
|
+
* hostname-to-private-IP and DNS-rebinding bypasses. An injected fetch is
|
|
3079
|
+
* responsible for equivalent connect-time validation. Other runtimes should
|
|
2906
3080
|
* constrain egress at the network layer when handling untrusted URLs.
|
|
2907
3081
|
*
|
|
2908
3082
|
* @throws DownloadError if a hop is unsafe, the redirect limit is exceeded, or
|
|
2909
3083
|
* a redirect cannot be validated on a non-browser runtime.
|
|
2910
3084
|
*/
|
|
2911
|
-
declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, }: {
|
|
3085
|
+
declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, fetch: customFetch, trustedOrigin, }: {
|
|
2912
3086
|
url: string;
|
|
2913
3087
|
headers?: HeadersInit;
|
|
2914
3088
|
abortSignal?: AbortSignal;
|
|
2915
3089
|
maxRedirects?: number;
|
|
3090
|
+
fetch?: FetchFunction;
|
|
3091
|
+
/**
|
|
3092
|
+
* A developer-configured origin (e.g. the provider's `baseURL`) whose hops
|
|
3093
|
+
* skip target validation. Must never be derived from response data.
|
|
3094
|
+
*/
|
|
3095
|
+
trustedOrigin?: string;
|
|
2916
3096
|
}): Promise<Response>;
|
|
2917
3097
|
|
|
2918
3098
|
/**
|
|
@@ -2995,7 +3175,7 @@ declare interface GatewayCreditsResponse {
|
|
|
2995
3175
|
totalUsed: string;
|
|
2996
3176
|
}
|
|
2997
3177
|
|
|
2998
|
-
declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
|
|
3178
|
+
declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'cohere/embed-v5.0-fast' | 'cohere/embed-v5.0-pro' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'perplexity/pplx-embed-v1-0.6b' | 'perplexity/pplx-embed-v1-4b' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
|
|
2999
3179
|
|
|
3000
3180
|
declare interface GatewayFetchMetadataResponse {
|
|
3001
3181
|
models: GatewayLanguageModelEntry[];
|
|
@@ -3045,7 +3225,7 @@ declare interface GatewayGenerationInfoParams {
|
|
|
3045
3225
|
id: string;
|
|
3046
3226
|
}
|
|
3047
3227
|
|
|
3048
|
-
declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | '
|
|
3228
|
+
declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-3-image' | 'bfl/flux-3-image-klein' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | 'meta/muse-image-1.0' | 'microsoft/mai-image-2.6' | 'microsoft/mai-image-2.6-flash' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'prodia/flux-fast-schnell' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-flash' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | 'topaz/wonder-3.5' | (string & {});
|
|
3049
3229
|
|
|
3050
3230
|
declare interface GatewayLanguageModelEntry {
|
|
3051
3231
|
/**
|
|
@@ -3096,7 +3276,7 @@ declare interface GatewayLanguageModelEntry {
|
|
|
3096
3276
|
|
|
3097
3277
|
declare type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
|
|
3098
3278
|
|
|
3099
|
-
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/
|
|
3279
|
+
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'arcee-ai/trinity-large-thinking' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-1017-fast' | 'deepseek/deepseek-v4.1-flash-fast' | 'elorian/glimpse' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-batch' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.7-flash-batch' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-3' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-vl' | 'inclusionai/ling-3.1-flash' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | 'liquid/lfm2.5-24b-a2b' | 'meituan/longcat-2.5-preview' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-contributor' | 'meta/muse-spark-open' | 'meta/muse-wonder-1.0' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'minimax/minimax-m3.1-flash' | 'mistral/codestral' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-large-4' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'moonshotai/kimi-k3.1-pro' | 'moonshotai/kimi-k3.1-pro-highspeed' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-3.5-lightning' | 'nvidia/nemotron-3.5-lightning-free' | 'nvidia/nemotron-3.5-super-vl' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-batch' | 'openai/gpt-4.1-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-batch' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4.1-nano-batch' | 'openai/gpt-4.1-nano-fast' | 'openai/gpt-4o' | 'openai/gpt-4o-batch' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-batch' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-batch' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-batch' | 'openai/gpt-5-mini-fast' | 'openai/gpt-5-nano' | 'openai/gpt-5-nano-batch' | 'openai/gpt-5-pro' | 'openai/gpt-5-pro-batch' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.1-thinking-fast' | 'openai/gpt-5.2' | 'openai/gpt-5.2-batch' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-fast' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.3-codex-fast' | 'openai/gpt-5.4' | 'openai/gpt-5.4-batch' | 'openai/gpt-5.4-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-batch' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-nano-batch' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-batch' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.5-pro-batch' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-batch' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-batch' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-batch' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-batch' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-batch' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-batch' | 'openai/gpt-6-sol-fast' | 'openai/gpt-6.1-sol' | 'openai/gpt-6.1-sol-batch' | 'openai/gpt-6.1-sol-fast' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-120b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-fast' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'openai/o4-mini-fast' | 'perplexity/sonar' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'reflection/beam' | 'reflection/beam-free' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'scaledown/scaledown-extract-1' | 'scaledown/scaledown-summarize-1' | 'spacexai/grok-4.1-fast-non-reasoning' | 'spacexai/grok-4.1-fast-reasoning' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-batch' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-batch' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-batch' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.3-batch' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stealth/glyph-cluster' | 'stepfun/step-3.7-flash' | 'stepfun/step-5-preview' | 'tencent/hy-mt2-lite' | 'tencent/hy-mt2-plus' | 'tencent/hy-mt2-pro' | 'tencent/hy3' | 'tencent/hy4-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'xiaomi/mimo-v2.6-flash' | 'xiaomi/mimo-v2.6-pro' | 'xiaomi/mimo-v2.6-pro-ultraspeed' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5.3' | 'zai/glm-5.3-fast' | 'zai/glm-5.3-flash' | 'zai/glm-5.3-flashx' | 'zai/glm-5v-turbo' | (string & {});
|
|
3100
3280
|
|
|
3101
3281
|
declare interface GatewayProvider extends ProviderV3 {
|
|
3102
3282
|
(modelId: GatewayModelId): LanguageModelV3;
|
|
@@ -3208,9 +3388,9 @@ declare interface GatewayProviderSettings {
|
|
|
3208
3388
|
metadataCacheRefreshMillis?: number;
|
|
3209
3389
|
}
|
|
3210
3390
|
|
|
3211
|
-
declare type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
|
|
3391
|
+
declare type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'cohere/rerank-v5-fast' | 'cohere/rerank-v5-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | 'voyage/rerank-3' | 'voyage/rerank-3-lite' | (string & {});
|
|
3212
3392
|
|
|
3213
|
-
declare type GatewaySpeechModelId = 'openai/tts-1' | 'openai/tts-1-hd' | '
|
|
3393
|
+
declare type GatewaySpeechModelId = 'fish-audio/drama-3' | 'fish-audio/s1' | 'fish-audio/s2-pro' | 'fish-audio/s2.1-pro' | 'google/gemini-3.8-flash-lite-tts' | 'google/gemini-3.8-flash-tts' | 'microsoft/mai-voice-2' | 'microsoft/mai-voice-2-flash' | 'microsoft/mai-voice-2.1' | 'microsoft/mai-voice-2.1-flash' | 'mistral/voxtral-mini-tts-3' | 'openai/tts-1' | 'openai/tts-1-hd' | 'spacexai/grok-tts' | (string & {});
|
|
3214
3394
|
|
|
3215
3395
|
declare interface GatewaySpendReportParams {
|
|
3216
3396
|
/** Start date in YYYY-MM-DD format (inclusive) */
|
|
@@ -3274,6 +3454,20 @@ declare interface GatewaySpendReportRow {
|
|
|
3274
3454
|
* Gateway-specific provider-defined tools.
|
|
3275
3455
|
*/
|
|
3276
3456
|
declare const gatewayTools: {
|
|
3457
|
+
/**
|
|
3458
|
+
* Fetch page content using Browserbase's lightweight Fetch API.
|
|
3459
|
+
*
|
|
3460
|
+
* Supports raw, Markdown, and schema-driven JSON output as well as redirects,
|
|
3461
|
+
* proxy routing, and TLS controls.
|
|
3462
|
+
*/
|
|
3463
|
+
browserbaseFetch: (config?: BrowserbaseFetchConfig) => ReturnType<typeof browserbaseFetchToolFactory>;
|
|
3464
|
+
/**
|
|
3465
|
+
* Search the web using Browserbase's Search API for fast, structured results.
|
|
3466
|
+
*
|
|
3467
|
+
* Returns titles, URLs, and available publication metadata without requiring
|
|
3468
|
+
* a browser session.
|
|
3469
|
+
*/
|
|
3470
|
+
browserbaseSearch: (config?: BrowserbaseSearchConfig) => ReturnType<typeof browserbaseSearchToolFactory>;
|
|
3277
3471
|
/**
|
|
3278
3472
|
* Search the web using Exa for current information and token-efficient
|
|
3279
3473
|
* excerpts optimized for agent workflows.
|
|
@@ -3299,11 +3493,20 @@ declare const gatewayTools: {
|
|
|
3299
3493
|
* domain, language, date range, and recency filters.
|
|
3300
3494
|
*/
|
|
3301
3495
|
perplexitySearch: (config?: PerplexitySearchConfig) => ReturnType<typeof perplexitySearchToolFactory>;
|
|
3496
|
+
/**
|
|
3497
|
+
* Search the web and Tako's curated knowledge graph in one call for
|
|
3498
|
+
* token-efficient web excerpts and structured data results grounded in
|
|
3499
|
+
* premium sources, each with an embed-ready visualization.
|
|
3500
|
+
*
|
|
3501
|
+
* Supports effort, per-source web and data controls, localization, and inline
|
|
3502
|
+
* contents for agents that need to reason over underlying data.
|
|
3503
|
+
*/
|
|
3504
|
+
takoSearch: (config?: TakoSearchConfig) => ReturnType<typeof takoSearchToolFactory>;
|
|
3302
3505
|
};
|
|
3303
3506
|
|
|
3304
|
-
declare type GatewayTranscriptionModelId = 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | '
|
|
3507
|
+
declare type GatewayTranscriptionModelId = 'fish-audio/transcribe-1' | 'google/gemini-3.5-transcribe' | 'google/gemini-3.5-transcribe-live' | 'microsoft/mai-transcribe-2' | 'microsoft/mai-transcribe-2-streaming' | 'mistral/voxtral-mini-transcribe-3' | 'mistral/voxtral-small-transcribe-3' | 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | 'spacexai/grok-stt' | (string & {});
|
|
3305
3508
|
|
|
3306
|
-
declare type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | '
|
|
3509
|
+
declare type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'alibaba/wan-v3.0-video' | 'alibaba/wan-v3.0-video-prime' | 'bfl/flux-3-video' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-2.0-mini' | 'bytedance/seedance-2.5' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'google/veo-3.1-lite-generate-001' | 'heygen/heygen-video-1' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'minimax/minimax-h3' | 'minimax/minimax-h3-max' | 'spacexai/grok-imagine-video' | 'spacexai/grok-imagine-video-1.5' | 'spacexai/grok-imagine-video-1.5-lite' | 'topaz/proteus' | 'topaz/starlight-precise-2.6' | (string & {});
|
|
3307
3510
|
|
|
3308
3511
|
/**
|
|
3309
3512
|
* A generated audio file.
|
|
@@ -3355,7 +3558,7 @@ export declare const generateId: IdGenerator;
|
|
|
3355
3558
|
* @param seed - Seed for the image generation.
|
|
3356
3559
|
* @param providerOptions - Additional provider-specific options that are passed through to the provider
|
|
3357
3560
|
* as body parameters.
|
|
3358
|
-
* @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
|
|
3561
|
+
* @param maxRetries - Maximum number of retries per image model call, including retries after unclassified empty responses. Empty responses marked as not retryable by the provider are not retried. Set to 0 to disable retries. Default: 2.
|
|
3359
3562
|
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
3360
3563
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
3361
3564
|
*
|
|
@@ -3406,7 +3609,9 @@ export declare function generateImage({ model: modelArg, prompt: promptArg, n, m
|
|
|
3406
3609
|
*/
|
|
3407
3610
|
providerOptions?: ProviderOptions;
|
|
3408
3611
|
/**
|
|
3409
|
-
* Maximum number of retries per image model call
|
|
3612
|
+
* Maximum number of retries per image model call, including retries after
|
|
3613
|
+
* unclassified empty responses. Empty responses marked as not retryable by
|
|
3614
|
+
* the provider are not retried. Set to 0 to disable retries.
|
|
3410
3615
|
*
|
|
3411
3616
|
* @default 2
|
|
3412
3617
|
*/
|
|
@@ -3691,7 +3896,7 @@ export declare interface GenerateObjectResult<OBJECT> {
|
|
|
3691
3896
|
* @returns
|
|
3692
3897
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
3693
3898
|
*/
|
|
3694
|
-
export declare function generateText<TOOLS extends ToolSet, OUTPUT extends
|
|
3899
|
+
export declare function generateText<TOOLS extends ToolSet, OUTPUT extends OutputInterface = OutputInterface<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
|
|
3695
3900
|
/**
|
|
3696
3901
|
* The language model to use.
|
|
3697
3902
|
*/
|
|
@@ -3856,7 +4061,7 @@ export declare type GenerateTextOnFinishCallback<TOOLS extends ToolSet> = (event
|
|
|
3856
4061
|
*
|
|
3857
4062
|
* @param event - The event object containing generation configuration.
|
|
3858
4063
|
*/
|
|
3859
|
-
export declare type GenerateTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
4064
|
+
export declare type GenerateTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStartEvent<TOOLS, OUTPUT, GenerateTextIncludeSettings>) => PromiseLike<void> | void;
|
|
3860
4065
|
|
|
3861
4066
|
/**
|
|
3862
4067
|
* Callback that is set using the `onStepFinish` option.
|
|
@@ -3877,7 +4082,7 @@ export declare type GenerateTextOnStepFinishCallback<TOOLS extends ToolSet> = (e
|
|
|
3877
4082
|
*
|
|
3878
4083
|
* @param event - The event object containing step configuration.
|
|
3879
4084
|
*/
|
|
3880
|
-
export declare type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
4085
|
+
export declare type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStepStartEvent<TOOLS, OUTPUT, GenerateTextIncludeSettings>) => PromiseLike<void> | void;
|
|
3881
4086
|
|
|
3882
4087
|
/**
|
|
3883
4088
|
* Callback that is set using the `experimental_onToolCallFinish` option.
|
|
@@ -3907,7 +4112,7 @@ export declare type GenerateTextOnToolCallStartCallback<TOOLS extends ToolSet =
|
|
|
3907
4112
|
* The result of a `generateText` call.
|
|
3908
4113
|
* It contains the generated text, the tool calls that were made during the generation, and the results of the tool calls.
|
|
3909
4114
|
*/
|
|
3910
|
-
export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends
|
|
4115
|
+
export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends OutputInterface> {
|
|
3911
4116
|
/**
|
|
3912
4117
|
* The content that was generated in the last step.
|
|
3913
4118
|
*/
|
|
@@ -4025,7 +4230,8 @@ export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extend
|
|
|
4025
4230
|
* The generated output according to the `output` specification.
|
|
4026
4231
|
*
|
|
4027
4232
|
* @throws {NoOutputGeneratedError} When no output is available, for example
|
|
4028
|
-
* when the final step
|
|
4233
|
+
* when the final step finishes with a `tool-calls` reason, or when it
|
|
4234
|
+
* contains no text and does not finish with a `stop` reason.
|
|
4029
4235
|
*/
|
|
4030
4236
|
readonly output: InferGenerateOutput<OUTPUT>;
|
|
4031
4237
|
}
|
|
@@ -4065,13 +4271,44 @@ export declare interface GenerateVideoResult {
|
|
|
4065
4271
|
|
|
4066
4272
|
declare function getErrorMessage(error: unknown | undefined): string;
|
|
4067
4273
|
|
|
4068
|
-
declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
|
|
4274
|
+
declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin, }: {
|
|
4069
4275
|
url: string;
|
|
4070
4276
|
headers?: Record<string, string | undefined>;
|
|
4071
4277
|
failedResponseHandler: ResponseHandler<Error>;
|
|
4072
4278
|
successfulResponseHandler: ResponseHandler<T>;
|
|
4073
4279
|
abortSignal?: AbortSignal;
|
|
4074
4280
|
fetch?: FetchFunction;
|
|
4281
|
+
/**
|
|
4282
|
+
* Set `true` when `url` is untrusted (e.g. taken from a provider response
|
|
4283
|
+
* body): it is routed through {@link fetchWithValidatedRedirects}, which
|
|
4284
|
+
* rejects private/loopback/link-local targets and re-validates redirect
|
|
4285
|
+
* hops; blocked URLs throw `DownloadError`. Set `false` only for URLs built
|
|
4286
|
+
* from a developer-configured endpoint.
|
|
4287
|
+
*
|
|
4288
|
+
* Optional for backwards compatibility with existing callers; omitting it
|
|
4289
|
+
* behaves like `false` (no validation).
|
|
4290
|
+
*/
|
|
4291
|
+
validateUrl?: boolean;
|
|
4292
|
+
/**
|
|
4293
|
+
* When set, `headers` are sent only if `url` is same-origin with this origin
|
|
4294
|
+
* (the user-agent suffix is always kept). Pass the provider's configured
|
|
4295
|
+
* base URL alongside `validateUrl: true` so credentials never ride a request
|
|
4296
|
+
* to a response-supplied host on a different origin (e.g. a CDN). Redirects
|
|
4297
|
+
* that later cross origin drop all caller headers regardless (see
|
|
4298
|
+
* {@link fetchWithValidatedRedirects}).
|
|
4299
|
+
*/
|
|
4300
|
+
credentialedOrigin?: string;
|
|
4301
|
+
/**
|
|
4302
|
+
* A developer-configured origin (e.g. the provider's `baseURL`) that is
|
|
4303
|
+
* exempt from URL validation when `validateUrl` is `true`. A response URL
|
|
4304
|
+
* (or redirect hop) that is same-origin with it is fetched without target
|
|
4305
|
+
* validation — it points at exactly the host a config-derived
|
|
4306
|
+
* `validateUrl: false` request would fetch anyway, so blocking it would
|
|
4307
|
+
* only break legitimate self-hosted / localhost deployments whose response
|
|
4308
|
+
* URLs point back at the configured host. Hops on any other origin are
|
|
4309
|
+
* still validated. Must never be derived from response data.
|
|
4310
|
+
*/
|
|
4311
|
+
trustedOrigin?: string;
|
|
4075
4312
|
}) => Promise<{
|
|
4076
4313
|
value: T;
|
|
4077
4314
|
rawValue?: unknown;
|
|
@@ -4438,6 +4675,11 @@ declare type ImageModelV3 = {
|
|
|
4438
4675
|
* be returned as binary data.
|
|
4439
4676
|
*/
|
|
4440
4677
|
images: Array<string> | Array<Uint8Array>;
|
|
4678
|
+
/**
|
|
4679
|
+
* Whether an unsuccessful result, such as an empty image result, can be
|
|
4680
|
+
* retried. When omitted, the result is unclassified.
|
|
4681
|
+
*/
|
|
4682
|
+
isRetryable?: boolean;
|
|
4441
4683
|
/**
|
|
4442
4684
|
* Warnings for the call, e.g. unsupported features.
|
|
4443
4685
|
*/
|
|
@@ -4583,42 +4825,6 @@ declare type ImageModelV3File = {
|
|
|
4583
4825
|
providerOptions?: SharedV3ProviderMetadata;
|
|
4584
4826
|
};
|
|
4585
4827
|
|
|
4586
|
-
/**
|
|
4587
|
-
* An image file that can be used for image editing or variation generation.
|
|
4588
|
-
*/
|
|
4589
|
-
declare type ImageModelV3File_2 = {
|
|
4590
|
-
type: 'file';
|
|
4591
|
-
/**
|
|
4592
|
-
* The IANA media type of the file, e.g. `image/png`. Any string is supported.
|
|
4593
|
-
*
|
|
4594
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
4595
|
-
*/
|
|
4596
|
-
mediaType: string;
|
|
4597
|
-
/**
|
|
4598
|
-
* Generated file data as base64 encoded strings or binary data.
|
|
4599
|
-
*
|
|
4600
|
-
* The file data should be returned without any unnecessary conversion.
|
|
4601
|
-
* If the API returns base64 encoded strings, the file data should be returned
|
|
4602
|
-
* as base64 encoded strings. If the API returns binary data, the file data should
|
|
4603
|
-
* be returned as binary data.
|
|
4604
|
-
*/
|
|
4605
|
-
data: string | Uint8Array;
|
|
4606
|
-
/**
|
|
4607
|
-
* Optional provider-specific metadata for the file part.
|
|
4608
|
-
*/
|
|
4609
|
-
providerOptions?: SharedV3ProviderMetadata_2;
|
|
4610
|
-
} | {
|
|
4611
|
-
type: 'url';
|
|
4612
|
-
/**
|
|
4613
|
-
* The URL of the image file.
|
|
4614
|
-
*/
|
|
4615
|
-
url: string;
|
|
4616
|
-
/**
|
|
4617
|
-
* Optional provider-specific metadata for the file part.
|
|
4618
|
-
*/
|
|
4619
|
-
providerOptions?: SharedV3ProviderMetadata_2;
|
|
4620
|
-
};
|
|
4621
|
-
|
|
4622
4828
|
/**
|
|
4623
4829
|
* Middleware for ImageModelV3.
|
|
4624
4830
|
* This type defines the structure for middleware that can be used to modify
|
|
@@ -4740,19 +4946,19 @@ export { InferAgentUIMessage }
|
|
|
4740
4946
|
/**
|
|
4741
4947
|
* Infers the element type from an array output specification.
|
|
4742
4948
|
*/
|
|
4743
|
-
declare type InferElementOutput<OUTPUT extends
|
|
4949
|
+
declare type InferElementOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<any, any, infer ELEMENT> ? ELEMENT : never;
|
|
4744
4950
|
|
|
4745
4951
|
/**
|
|
4746
4952
|
* Infers the complete output type from the output specification.
|
|
4747
4953
|
*/
|
|
4748
|
-
export declare type InferGenerateOutput<OUTPUT extends
|
|
4954
|
+
export declare type InferGenerateOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<infer COMPLETE_OUTPUT, any, any> ? COMPLETE_OUTPUT : never;
|
|
4749
4955
|
|
|
4750
4956
|
export declare type InferSchema<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T : SCHEMA extends StandardSchema<infer T> ? T : SCHEMA extends LazySchema<infer T> ? T : SCHEMA extends Schema<infer T> ? T : never;
|
|
4751
4957
|
|
|
4752
4958
|
/**
|
|
4753
4959
|
* Infers the partial output type from the output specification.
|
|
4754
4960
|
*/
|
|
4755
|
-
export declare type InferStreamOutput<OUTPUT extends
|
|
4961
|
+
export declare type InferStreamOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<any, infer PARTIAL_OUTPUT, any> ? PARTIAL_OUTPUT : never;
|
|
4756
4962
|
|
|
4757
4963
|
/**
|
|
4758
4964
|
* Infer the input type of a tool.
|
|
@@ -4802,14 +5008,14 @@ export declare type InferUITools<TOOLS extends ToolSet> = {
|
|
|
4802
5008
|
};
|
|
4803
5009
|
|
|
4804
5010
|
declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPrefix, schemaSuffix, }: {
|
|
4805
|
-
messages:
|
|
5011
|
+
messages: LanguageModelV3Prompt;
|
|
4806
5012
|
schema?: JSONSchema7;
|
|
4807
5013
|
schemaPrefix?: string;
|
|
4808
5014
|
schemaSuffix?: string;
|
|
4809
|
-
}):
|
|
5015
|
+
}): LanguageModelV3Prompt;
|
|
4810
5016
|
|
|
4811
5017
|
export declare class InvalidArgumentError extends AISDKError {
|
|
4812
|
-
private readonly [symbol$
|
|
5018
|
+
private readonly [symbol$j];
|
|
4813
5019
|
readonly parameter: string;
|
|
4814
5020
|
readonly value: unknown;
|
|
4815
5021
|
constructor({ parameter, value, message, }: {
|
|
@@ -4871,7 +5077,7 @@ export declare class InvalidResponseDataError extends AISDKError {
|
|
|
4871
5077
|
}
|
|
4872
5078
|
|
|
4873
5079
|
export declare class InvalidStreamPartError extends AISDKError {
|
|
4874
|
-
private readonly [symbol$
|
|
5080
|
+
private readonly [symbol$i];
|
|
4875
5081
|
readonly chunk: SingleRequestTextStreamPart<any>;
|
|
4876
5082
|
constructor({ chunk, message, }: {
|
|
4877
5083
|
chunk: SingleRequestTextStreamPart<any>;
|
|
@@ -4881,7 +5087,7 @@ export declare class InvalidStreamPartError extends AISDKError {
|
|
|
4881
5087
|
}
|
|
4882
5088
|
|
|
4883
5089
|
export declare class InvalidToolApprovalError extends AISDKError {
|
|
4884
|
-
private readonly [symbol$
|
|
5090
|
+
private readonly [symbol$h];
|
|
4885
5091
|
readonly approvalId: string;
|
|
4886
5092
|
constructor({ approvalId }: {
|
|
4887
5093
|
approvalId: string;
|
|
@@ -4890,7 +5096,7 @@ export declare class InvalidToolApprovalError extends AISDKError {
|
|
|
4890
5096
|
}
|
|
4891
5097
|
|
|
4892
5098
|
export declare class InvalidToolApprovalSignatureError extends AISDKError {
|
|
4893
|
-
private readonly [symbol$
|
|
5099
|
+
private readonly [symbol$g];
|
|
4894
5100
|
readonly approvalId: string;
|
|
4895
5101
|
readonly toolCallId: string;
|
|
4896
5102
|
constructor({ approvalId, toolCallId, reason, }: {
|
|
@@ -4902,7 +5108,7 @@ export declare class InvalidToolApprovalSignatureError extends AISDKError {
|
|
|
4902
5108
|
}
|
|
4903
5109
|
|
|
4904
5110
|
export declare class InvalidToolInputError extends AISDKError {
|
|
4905
|
-
private readonly [symbol$
|
|
5111
|
+
private readonly [symbol$l];
|
|
4906
5112
|
readonly toolName: string;
|
|
4907
5113
|
readonly toolInput: string;
|
|
4908
5114
|
constructor({ toolInput, toolName, cause, message, }: {
|
|
@@ -5031,16 +5237,10 @@ declare type Job = () => Promise<void>;
|
|
|
5031
5237
|
|
|
5032
5238
|
declare type JSONArray = JSONValue_2[];
|
|
5033
5239
|
|
|
5034
|
-
declare type JSONArray_2 = JSONValue_3[];
|
|
5035
|
-
|
|
5036
5240
|
declare type JSONObject = {
|
|
5037
5241
|
[key: string]: JSONValue_2 | undefined;
|
|
5038
5242
|
};
|
|
5039
5243
|
|
|
5040
|
-
declare type JSONObject_2 = {
|
|
5041
|
-
[key: string]: JSONValue_3 | undefined;
|
|
5042
|
-
};
|
|
5043
|
-
|
|
5044
5244
|
export declare class JSONParseError extends AISDKError {
|
|
5045
5245
|
private readonly [symbol$7];
|
|
5046
5246
|
readonly text: string;
|
|
@@ -5051,16 +5251,6 @@ export declare class JSONParseError extends AISDKError {
|
|
|
5051
5251
|
static isInstance(error: unknown): error is JSONParseError;
|
|
5052
5252
|
}
|
|
5053
5253
|
|
|
5054
|
-
declare class JSONParseError_2 extends AISDKError_2 {
|
|
5055
|
-
private readonly [symbol$7_2];
|
|
5056
|
-
readonly text: string;
|
|
5057
|
-
constructor({ text, cause }: {
|
|
5058
|
-
text: string;
|
|
5059
|
-
cause: unknown;
|
|
5060
|
-
});
|
|
5061
|
-
static isInstance(error: unknown): error is JSONParseError_2;
|
|
5062
|
-
}
|
|
5063
|
-
|
|
5064
5254
|
/**
|
|
5065
5255
|
* Create a schema using a JSON Schema.
|
|
5066
5256
|
*
|
|
@@ -5090,12 +5280,6 @@ export declare type JSONValue = JSONValue_2;
|
|
|
5090
5280
|
*/
|
|
5091
5281
|
declare type JSONValue_2 = null | string | number | boolean | JSONObject | JSONArray;
|
|
5092
5282
|
|
|
5093
|
-
/**
|
|
5094
|
-
* A JSON value can be a string, number, boolean, object, array, or null.
|
|
5095
|
-
* JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
|
|
5096
|
-
*/
|
|
5097
|
-
declare type JSONValue_3 = null | string | number | boolean | JSONObject_2 | JSONArray_2;
|
|
5098
|
-
|
|
5099
5283
|
declare const KNOWN_MODEL_TYPES: readonly ["embedding", "image", "language", "reranking", "speech", "transcription", "video"];
|
|
5100
5284
|
|
|
5101
5285
|
declare type KnownModelType = (typeof KNOWN_MODEL_TYPES)[number];
|
|
@@ -6118,11 +6302,6 @@ declare type LanguageModelV3Content = LanguageModelV3Text | LanguageModelV3Reaso
|
|
|
6118
6302
|
*/
|
|
6119
6303
|
declare type LanguageModelV3DataContent = Uint8Array | string | URL;
|
|
6120
6304
|
|
|
6121
|
-
/**
|
|
6122
|
-
* Data content. Can be a Uint8Array, base64 encoded data as a string or a URL.
|
|
6123
|
-
*/
|
|
6124
|
-
declare type LanguageModelV3DataContent_2 = Uint8Array | string | URL;
|
|
6125
|
-
|
|
6126
6305
|
/**
|
|
6127
6306
|
* A file that has been generated by the model.
|
|
6128
6307
|
* Generated files as base64 encoded strings or binary data.
|
|
@@ -6151,34 +6330,6 @@ declare type LanguageModelV3File = {
|
|
|
6151
6330
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
6152
6331
|
};
|
|
6153
6332
|
|
|
6154
|
-
/**
|
|
6155
|
-
* A file that has been generated by the model.
|
|
6156
|
-
* Generated files as base64 encoded strings or binary data.
|
|
6157
|
-
* The files should be returned without any unnecessary conversion.
|
|
6158
|
-
*/
|
|
6159
|
-
declare type LanguageModelV3File_2 = {
|
|
6160
|
-
type: 'file';
|
|
6161
|
-
/**
|
|
6162
|
-
* The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
|
|
6163
|
-
*
|
|
6164
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
6165
|
-
*/
|
|
6166
|
-
mediaType: string;
|
|
6167
|
-
/**
|
|
6168
|
-
* Generated file data as base64 encoded strings or binary data.
|
|
6169
|
-
*
|
|
6170
|
-
* The file data should be returned without any unnecessary conversion.
|
|
6171
|
-
* If the API returns base64 encoded strings, the file data should be returned
|
|
6172
|
-
* as base64 encoded strings. If the API returns binary data, the file data should
|
|
6173
|
-
* be returned as binary data.
|
|
6174
|
-
*/
|
|
6175
|
-
data: string | Uint8Array;
|
|
6176
|
-
/**
|
|
6177
|
-
* Optional provider-specific metadata for the file part.
|
|
6178
|
-
*/
|
|
6179
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6180
|
-
};
|
|
6181
|
-
|
|
6182
6333
|
/**
|
|
6183
6334
|
* File content part of a prompt. It contains a file.
|
|
6184
6335
|
*/
|
|
@@ -6192,6 +6343,13 @@ declare interface LanguageModelV3FilePart {
|
|
|
6192
6343
|
* File data. Can be a Uint8Array, base64 encoded data as a string or a URL.
|
|
6193
6344
|
*/
|
|
6194
6345
|
data: LanguageModelV3DataContent;
|
|
6346
|
+
/**
|
|
6347
|
+
* The original URL string before it was parsed into a URL.
|
|
6348
|
+
*
|
|
6349
|
+
* This is available when parsing changes the string and a provider needs to
|
|
6350
|
+
* preserve an opaque non-HTTP URI exactly.
|
|
6351
|
+
*/
|
|
6352
|
+
originalUrl?: string;
|
|
6195
6353
|
/**
|
|
6196
6354
|
* IANA media type of the file.
|
|
6197
6355
|
*
|
|
@@ -6208,42 +6366,6 @@ declare interface LanguageModelV3FilePart {
|
|
|
6208
6366
|
providerOptions?: SharedV3ProviderOptions;
|
|
6209
6367
|
}
|
|
6210
6368
|
|
|
6211
|
-
/**
|
|
6212
|
-
* File content part of a prompt. It contains a file.
|
|
6213
|
-
*/
|
|
6214
|
-
declare interface LanguageModelV3FilePart_2 {
|
|
6215
|
-
type: 'file';
|
|
6216
|
-
/**
|
|
6217
|
-
* Optional filename of the file.
|
|
6218
|
-
*/
|
|
6219
|
-
filename?: string;
|
|
6220
|
-
/**
|
|
6221
|
-
* File data. Can be a Uint8Array, base64 encoded data as a string or a URL.
|
|
6222
|
-
*/
|
|
6223
|
-
data: LanguageModelV3DataContent_2;
|
|
6224
|
-
/**
|
|
6225
|
-
* The original URL string before it was parsed into a URL.
|
|
6226
|
-
*
|
|
6227
|
-
* This is available when parsing changes the string and a provider needs to
|
|
6228
|
-
* preserve an opaque non-HTTP URI exactly.
|
|
6229
|
-
*/
|
|
6230
|
-
originalUrl?: string;
|
|
6231
|
-
/**
|
|
6232
|
-
* IANA media type of the file.
|
|
6233
|
-
*
|
|
6234
|
-
* Can support wildcards, e.g. `image/*` (in which case the provider needs to take appropriate action).
|
|
6235
|
-
*
|
|
6236
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
6237
|
-
*/
|
|
6238
|
-
mediaType: string;
|
|
6239
|
-
/**
|
|
6240
|
-
* Additional provider-specific options. They are passed through
|
|
6241
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
6242
|
-
* functionality that can be fully encapsulated in the provider.
|
|
6243
|
-
*/
|
|
6244
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
6245
|
-
}
|
|
6246
|
-
|
|
6247
6369
|
/**
|
|
6248
6370
|
* Reason why a language model finished generating a response.
|
|
6249
6371
|
*
|
|
@@ -6271,33 +6393,6 @@ declare type LanguageModelV3FinishReason = {
|
|
|
6271
6393
|
raw: string | undefined;
|
|
6272
6394
|
};
|
|
6273
6395
|
|
|
6274
|
-
/**
|
|
6275
|
-
* Reason why a language model finished generating a response.
|
|
6276
|
-
*
|
|
6277
|
-
* Contains both a unified finish reason and a raw finish reason from the provider.
|
|
6278
|
-
* The unified finish reason is used to provide a consistent finish reason across different providers.
|
|
6279
|
-
* The raw finish reason is used to provide the original finish reason from the provider.
|
|
6280
|
-
*/
|
|
6281
|
-
declare type LanguageModelV3FinishReason_2 = {
|
|
6282
|
-
/**
|
|
6283
|
-
* Unified finish reason. This enables using the same finish reason across different providers.
|
|
6284
|
-
*
|
|
6285
|
-
* Can be one of the following:
|
|
6286
|
-
* - `stop`: model generated stop sequence
|
|
6287
|
-
* - `length`: model generated maximum number of tokens
|
|
6288
|
-
* - `content-filter`: content filter violation stopped the model
|
|
6289
|
-
* - `tool-calls`: model triggered tool calls
|
|
6290
|
-
* - `error`: model stopped because of an error
|
|
6291
|
-
* - `other`: model stopped for other reasons
|
|
6292
|
-
*/
|
|
6293
|
-
unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
6294
|
-
/**
|
|
6295
|
-
* Raw finish reason from the provider.
|
|
6296
|
-
* This is the original finish reason from the provider.
|
|
6297
|
-
*/
|
|
6298
|
-
raw: string | undefined;
|
|
6299
|
-
};
|
|
6300
|
-
|
|
6301
6396
|
/**
|
|
6302
6397
|
* A tool has a name, a description, and a set of parameters.
|
|
6303
6398
|
*
|
|
@@ -6344,52 +6439,6 @@ declare type LanguageModelV3FunctionTool = {
|
|
|
6344
6439
|
providerOptions?: SharedV3ProviderOptions;
|
|
6345
6440
|
};
|
|
6346
6441
|
|
|
6347
|
-
/**
|
|
6348
|
-
* A tool has a name, a description, and a set of parameters.
|
|
6349
|
-
*
|
|
6350
|
-
* Note: this is **not** the user-facing tool definition. The AI SDK methods will
|
|
6351
|
-
* map the user-facing tool definitions to this format.
|
|
6352
|
-
*/
|
|
6353
|
-
declare type LanguageModelV3FunctionTool_2 = {
|
|
6354
|
-
/**
|
|
6355
|
-
* The type of the tool (always 'function').
|
|
6356
|
-
*/
|
|
6357
|
-
type: 'function';
|
|
6358
|
-
/**
|
|
6359
|
-
* The name of the tool. Unique within this model call.
|
|
6360
|
-
*/
|
|
6361
|
-
name: string;
|
|
6362
|
-
/**
|
|
6363
|
-
* A description of the tool. The language model uses this to understand the
|
|
6364
|
-
* tool's purpose and to provide better completion suggestions.
|
|
6365
|
-
*/
|
|
6366
|
-
description?: string;
|
|
6367
|
-
/**
|
|
6368
|
-
* The parameters that the tool expects. The language model uses this to
|
|
6369
|
-
* understand the tool's input requirements and to provide matching suggestions.
|
|
6370
|
-
*/
|
|
6371
|
-
inputSchema: JSONSchema7;
|
|
6372
|
-
/**
|
|
6373
|
-
* An optional list of input examples that show the language
|
|
6374
|
-
* model what the input should look like.
|
|
6375
|
-
*/
|
|
6376
|
-
inputExamples?: Array<{
|
|
6377
|
-
input: JSONObject_2;
|
|
6378
|
-
}>;
|
|
6379
|
-
/**
|
|
6380
|
-
* Strict mode setting for the tool.
|
|
6381
|
-
*
|
|
6382
|
-
* Providers that support strict mode will use this setting to determine
|
|
6383
|
-
* how the input should be generated. Strict mode will always produce
|
|
6384
|
-
* valid inputs, but it might limit what input schemas are supported.
|
|
6385
|
-
*/
|
|
6386
|
-
strict?: boolean;
|
|
6387
|
-
/**
|
|
6388
|
-
* The provider-specific options for the tool.
|
|
6389
|
-
*/
|
|
6390
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
6391
|
-
};
|
|
6392
|
-
|
|
6393
6442
|
/**
|
|
6394
6443
|
* The result of a language model doGenerate call.
|
|
6395
6444
|
*/
|
|
@@ -6461,27 +6510,6 @@ declare type LanguageModelV3Message = ({
|
|
|
6461
6510
|
providerOptions?: SharedV3ProviderOptions;
|
|
6462
6511
|
};
|
|
6463
6512
|
|
|
6464
|
-
declare type LanguageModelV3Message_2 = ({
|
|
6465
|
-
role: 'system';
|
|
6466
|
-
content: string;
|
|
6467
|
-
} | {
|
|
6468
|
-
role: 'user';
|
|
6469
|
-
content: Array<LanguageModelV3TextPart_2 | LanguageModelV3FilePart_2>;
|
|
6470
|
-
} | {
|
|
6471
|
-
role: 'assistant';
|
|
6472
|
-
content: Array<LanguageModelV3TextPart_2 | LanguageModelV3FilePart_2 | LanguageModelV3ReasoningPart_2 | LanguageModelV3ToolCallPart_2 | LanguageModelV3ToolResultPart_2>;
|
|
6473
|
-
} | {
|
|
6474
|
-
role: 'tool';
|
|
6475
|
-
content: Array<LanguageModelV3ToolResultPart_2 | LanguageModelV3ToolApprovalResponsePart_2>;
|
|
6476
|
-
}) & {
|
|
6477
|
-
/**
|
|
6478
|
-
* Additional provider-specific options. They are passed through
|
|
6479
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
6480
|
-
* functionality that can be fully encapsulated in the provider.
|
|
6481
|
-
*/
|
|
6482
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
6483
|
-
};
|
|
6484
|
-
|
|
6485
6513
|
/**
|
|
6486
6514
|
* Experimental middleware for LanguageModelV3.
|
|
6487
6515
|
* This type defines the structure for middleware that can be used to modify
|
|
@@ -6571,17 +6599,6 @@ declare type LanguageModelV3Middleware = {
|
|
|
6571
6599
|
*/
|
|
6572
6600
|
declare type LanguageModelV3Prompt = Array<LanguageModelV3Message>;
|
|
6573
6601
|
|
|
6574
|
-
/**
|
|
6575
|
-
* A prompt is a list of messages.
|
|
6576
|
-
*
|
|
6577
|
-
* Note: Not all models and prompt formats support multi-modal inputs and
|
|
6578
|
-
* tool calls. The validation happens at runtime.
|
|
6579
|
-
*
|
|
6580
|
-
* Note: This is not a user-facing prompt. The AI SDK methods will map the
|
|
6581
|
-
* user-facing prompt types such as chat or instruction prompts to this format.
|
|
6582
|
-
*/
|
|
6583
|
-
declare type LanguageModelV3Prompt_2 = Array<LanguageModelV3Message_2>;
|
|
6584
|
-
|
|
6585
6602
|
/**
|
|
6586
6603
|
* The configuration of a provider tool.
|
|
6587
6604
|
*
|
|
@@ -6608,32 +6625,6 @@ declare type LanguageModelV3ProviderTool = {
|
|
|
6608
6625
|
args: Record<string, unknown>;
|
|
6609
6626
|
};
|
|
6610
6627
|
|
|
6611
|
-
/**
|
|
6612
|
-
* The configuration of a provider tool.
|
|
6613
|
-
*
|
|
6614
|
-
* Provider tools are tools that are specific to a certain provider.
|
|
6615
|
-
* The input and output schemas are defined be the provider, and
|
|
6616
|
-
* some of the tools are also executed on the provider systems.
|
|
6617
|
-
*/
|
|
6618
|
-
declare type LanguageModelV3ProviderTool_2 = {
|
|
6619
|
-
/**
|
|
6620
|
-
* The type of the tool (always 'provider').
|
|
6621
|
-
*/
|
|
6622
|
-
type: 'provider';
|
|
6623
|
-
/**
|
|
6624
|
-
* The ID of the tool. Should follow the format `<provider-id>.<unique-tool-name>`.
|
|
6625
|
-
*/
|
|
6626
|
-
id: `${string}.${string}`;
|
|
6627
|
-
/**
|
|
6628
|
-
* The name of the tool. Unique within this model call.
|
|
6629
|
-
*/
|
|
6630
|
-
name: string;
|
|
6631
|
-
/**
|
|
6632
|
-
* The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
|
|
6633
|
-
*/
|
|
6634
|
-
args: Record<string, unknown>;
|
|
6635
|
-
};
|
|
6636
|
-
|
|
6637
6628
|
/**
|
|
6638
6629
|
* Reasoning that the model has generated.
|
|
6639
6630
|
*/
|
|
@@ -6663,23 +6654,6 @@ declare interface LanguageModelV3ReasoningPart {
|
|
|
6663
6654
|
providerOptions?: SharedV3ProviderOptions;
|
|
6664
6655
|
}
|
|
6665
6656
|
|
|
6666
|
-
/**
|
|
6667
|
-
* Reasoning content part of a prompt. It contains a string of reasoning text.
|
|
6668
|
-
*/
|
|
6669
|
-
declare interface LanguageModelV3ReasoningPart_2 {
|
|
6670
|
-
type: 'reasoning';
|
|
6671
|
-
/**
|
|
6672
|
-
* The reasoning text.
|
|
6673
|
-
*/
|
|
6674
|
-
text: string;
|
|
6675
|
-
/**
|
|
6676
|
-
* Additional provider-specific options. They are passed through
|
|
6677
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
6678
|
-
* functionality that can be fully encapsulated in the provider.
|
|
6679
|
-
*/
|
|
6680
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
6681
|
-
}
|
|
6682
|
-
|
|
6683
6657
|
declare interface LanguageModelV3ResponseMetadata {
|
|
6684
6658
|
/**
|
|
6685
6659
|
* ID for the generated response, if the provider sends one.
|
|
@@ -6695,21 +6669,6 @@ declare interface LanguageModelV3ResponseMetadata {
|
|
|
6695
6669
|
modelId?: string;
|
|
6696
6670
|
}
|
|
6697
6671
|
|
|
6698
|
-
declare interface LanguageModelV3ResponseMetadata_2 {
|
|
6699
|
-
/**
|
|
6700
|
-
* ID for the generated response, if the provider sends one.
|
|
6701
|
-
*/
|
|
6702
|
-
id?: string;
|
|
6703
|
-
/**
|
|
6704
|
-
* Timestamp for the start of the generated response, if the provider sends one.
|
|
6705
|
-
*/
|
|
6706
|
-
timestamp?: Date;
|
|
6707
|
-
/**
|
|
6708
|
-
* The ID of the response model that was used to generate the response, if the provider sends one.
|
|
6709
|
-
*/
|
|
6710
|
-
modelId?: string;
|
|
6711
|
-
}
|
|
6712
|
-
|
|
6713
6672
|
/**
|
|
6714
6673
|
* A source that has been used as input to generate the response.
|
|
6715
6674
|
*/
|
|
@@ -6763,59 +6722,6 @@ declare type LanguageModelV3Source = {
|
|
|
6763
6722
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
6764
6723
|
};
|
|
6765
6724
|
|
|
6766
|
-
/**
|
|
6767
|
-
* A source that has been used as input to generate the response.
|
|
6768
|
-
*/
|
|
6769
|
-
declare type LanguageModelV3Source_2 = {
|
|
6770
|
-
type: 'source';
|
|
6771
|
-
/**
|
|
6772
|
-
* The type of source - URL sources reference web content.
|
|
6773
|
-
*/
|
|
6774
|
-
sourceType: 'url';
|
|
6775
|
-
/**
|
|
6776
|
-
* The ID of the source.
|
|
6777
|
-
*/
|
|
6778
|
-
id: string;
|
|
6779
|
-
/**
|
|
6780
|
-
* The URL of the source.
|
|
6781
|
-
*/
|
|
6782
|
-
url: string;
|
|
6783
|
-
/**
|
|
6784
|
-
* The title of the source.
|
|
6785
|
-
*/
|
|
6786
|
-
title?: string;
|
|
6787
|
-
/**
|
|
6788
|
-
* Additional provider metadata for the source.
|
|
6789
|
-
*/
|
|
6790
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6791
|
-
} | {
|
|
6792
|
-
type: 'source';
|
|
6793
|
-
/**
|
|
6794
|
-
* The type of source - document sources reference files/documents.
|
|
6795
|
-
*/
|
|
6796
|
-
sourceType: 'document';
|
|
6797
|
-
/**
|
|
6798
|
-
* The ID of the source.
|
|
6799
|
-
*/
|
|
6800
|
-
id: string;
|
|
6801
|
-
/**
|
|
6802
|
-
* IANA media type of the document (e.g., 'application/pdf').
|
|
6803
|
-
*/
|
|
6804
|
-
mediaType: string;
|
|
6805
|
-
/**
|
|
6806
|
-
* The title of the document.
|
|
6807
|
-
*/
|
|
6808
|
-
title: string;
|
|
6809
|
-
/**
|
|
6810
|
-
* Optional filename of the document.
|
|
6811
|
-
*/
|
|
6812
|
-
filename?: string;
|
|
6813
|
-
/**
|
|
6814
|
-
* Additional provider metadata for the source.
|
|
6815
|
-
*/
|
|
6816
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6817
|
-
};
|
|
6818
|
-
|
|
6819
6725
|
declare type LanguageModelV3StreamPart = {
|
|
6820
6726
|
type: 'text-start';
|
|
6821
6727
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
@@ -6846,6 +6752,12 @@ declare type LanguageModelV3StreamPart = {
|
|
|
6846
6752
|
type: 'tool-input-start';
|
|
6847
6753
|
id: string;
|
|
6848
6754
|
toolName: string;
|
|
6755
|
+
/**
|
|
6756
|
+
* Encoding of the input deltas. Defaults to JSON when omitted.
|
|
6757
|
+
* Text deltas concatenate to a raw string. The final tool-call input
|
|
6758
|
+
* must still be JSON-encoded, regardless of the delta encoding.
|
|
6759
|
+
*/
|
|
6760
|
+
inputEncoding?: 'json' | 'text';
|
|
6849
6761
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
6850
6762
|
providerExecuted?: boolean;
|
|
6851
6763
|
dynamic?: boolean;
|
|
@@ -6877,67 +6789,6 @@ declare type LanguageModelV3StreamPart = {
|
|
|
6877
6789
|
error: unknown;
|
|
6878
6790
|
};
|
|
6879
6791
|
|
|
6880
|
-
declare type LanguageModelV3StreamPart_2 = {
|
|
6881
|
-
type: 'text-start';
|
|
6882
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6883
|
-
id: string;
|
|
6884
|
-
} | {
|
|
6885
|
-
type: 'text-delta';
|
|
6886
|
-
id: string;
|
|
6887
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6888
|
-
delta: string;
|
|
6889
|
-
} | {
|
|
6890
|
-
type: 'text-end';
|
|
6891
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6892
|
-
id: string;
|
|
6893
|
-
} | {
|
|
6894
|
-
type: 'reasoning-start';
|
|
6895
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6896
|
-
id: string;
|
|
6897
|
-
} | {
|
|
6898
|
-
type: 'reasoning-delta';
|
|
6899
|
-
id: string;
|
|
6900
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6901
|
-
delta: string;
|
|
6902
|
-
} | {
|
|
6903
|
-
type: 'reasoning-end';
|
|
6904
|
-
id: string;
|
|
6905
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6906
|
-
} | {
|
|
6907
|
-
type: 'tool-input-start';
|
|
6908
|
-
id: string;
|
|
6909
|
-
toolName: string;
|
|
6910
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6911
|
-
providerExecuted?: boolean;
|
|
6912
|
-
dynamic?: boolean;
|
|
6913
|
-
title?: string;
|
|
6914
|
-
} | {
|
|
6915
|
-
type: 'tool-input-delta';
|
|
6916
|
-
id: string;
|
|
6917
|
-
delta: string;
|
|
6918
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6919
|
-
} | {
|
|
6920
|
-
type: 'tool-input-end';
|
|
6921
|
-
id: string;
|
|
6922
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6923
|
-
} | LanguageModelV3ToolApprovalRequest_2 | LanguageModelV3ToolCall_2 | LanguageModelV3ToolResult_2 | LanguageModelV3File_2 | LanguageModelV3Source_2 | {
|
|
6924
|
-
type: 'stream-start';
|
|
6925
|
-
warnings: Array<SharedV3Warning_2>;
|
|
6926
|
-
} | ({
|
|
6927
|
-
type: 'response-metadata';
|
|
6928
|
-
} & LanguageModelV3ResponseMetadata_2) | {
|
|
6929
|
-
type: 'finish';
|
|
6930
|
-
usage: LanguageModelV3Usage_2;
|
|
6931
|
-
finishReason: LanguageModelV3FinishReason_2;
|
|
6932
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
6933
|
-
} | {
|
|
6934
|
-
type: 'raw';
|
|
6935
|
-
rawValue: unknown;
|
|
6936
|
-
} | {
|
|
6937
|
-
type: 'error';
|
|
6938
|
-
error: unknown;
|
|
6939
|
-
};
|
|
6940
|
-
|
|
6941
6792
|
/**
|
|
6942
6793
|
* The result of a language model doStream call.
|
|
6943
6794
|
*/
|
|
@@ -6995,23 +6846,6 @@ declare interface LanguageModelV3TextPart {
|
|
|
6995
6846
|
providerOptions?: SharedV3ProviderOptions;
|
|
6996
6847
|
}
|
|
6997
6848
|
|
|
6998
|
-
/**
|
|
6999
|
-
* Text content part of a prompt. It contains a string of text.
|
|
7000
|
-
*/
|
|
7001
|
-
declare interface LanguageModelV3TextPart_2 {
|
|
7002
|
-
type: 'text';
|
|
7003
|
-
/**
|
|
7004
|
-
* The text content.
|
|
7005
|
-
*/
|
|
7006
|
-
text: string;
|
|
7007
|
-
/**
|
|
7008
|
-
* Additional provider-specific options. They are passed through
|
|
7009
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
7010
|
-
* functionality that can be fully encapsulated in the provider.
|
|
7011
|
-
*/
|
|
7012
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
7013
|
-
}
|
|
7014
|
-
|
|
7015
6849
|
/**
|
|
7016
6850
|
* Tool approval request emitted by a provider for a provider-executed tool call.
|
|
7017
6851
|
*
|
|
@@ -7035,29 +6869,6 @@ declare type LanguageModelV3ToolApprovalRequest = {
|
|
|
7035
6869
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
7036
6870
|
};
|
|
7037
6871
|
|
|
7038
|
-
/**
|
|
7039
|
-
* Tool approval request emitted by a provider for a provider-executed tool call.
|
|
7040
|
-
*
|
|
7041
|
-
* This is used for flows where the provider executes the tool (e.g. MCP tools)
|
|
7042
|
-
* but requires an explicit user approval before continuing.
|
|
7043
|
-
*/
|
|
7044
|
-
declare type LanguageModelV3ToolApprovalRequest_2 = {
|
|
7045
|
-
type: 'tool-approval-request';
|
|
7046
|
-
/**
|
|
7047
|
-
* ID of the approval request. This ID is referenced by the subsequent
|
|
7048
|
-
* tool-approval-response (tool message) to approve or deny execution.
|
|
7049
|
-
*/
|
|
7050
|
-
approvalId: string;
|
|
7051
|
-
/**
|
|
7052
|
-
* The tool call ID that this approval request is for.
|
|
7053
|
-
*/
|
|
7054
|
-
toolCallId: string;
|
|
7055
|
-
/**
|
|
7056
|
-
* Additional provider-specific metadata for the approval request.
|
|
7057
|
-
*/
|
|
7058
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
7059
|
-
};
|
|
7060
|
-
|
|
7061
6872
|
/**
|
|
7062
6873
|
* Tool approval response content part of a prompt. It contains the user's
|
|
7063
6874
|
* decision to approve or deny a provider-executed tool call.
|
|
@@ -7083,425 +6894,129 @@ declare interface LanguageModelV3ToolApprovalResponsePart {
|
|
|
7083
6894
|
*/
|
|
7084
6895
|
providerOptions?: SharedV3ProviderOptions;
|
|
7085
6896
|
}
|
|
7086
|
-
|
|
7087
|
-
/**
|
|
7088
|
-
* Tool
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
*
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
*
|
|
7108
|
-
*
|
|
7109
|
-
*/
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
*
|
|
7129
|
-
*/
|
|
7130
|
-
|
|
7131
|
-
/**
|
|
7132
|
-
*
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
*
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
*
|
|
7192
|
-
*/
|
|
7193
|
-
|
|
7194
|
-
/**
|
|
7195
|
-
*
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
*
|
|
7201
|
-
*/
|
|
7202
|
-
|
|
7203
|
-
/**
|
|
7204
|
-
* Additional provider-specific options. They are passed through
|
|
7205
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
7206
|
-
* functionality that can be fully encapsulated in the provider.
|
|
7207
|
-
*/
|
|
7208
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
|
-
/**
|
|
7212
|
-
* Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
7213
|
-
*/
|
|
7214
|
-
declare interface LanguageModelV3ToolCallPart_2 {
|
|
7215
|
-
type: 'tool-call';
|
|
7216
|
-
/**
|
|
7217
|
-
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
7218
|
-
*/
|
|
7219
|
-
toolCallId: string;
|
|
7220
|
-
/**
|
|
7221
|
-
* Name of the tool that is being called.
|
|
7222
|
-
*/
|
|
7223
|
-
toolName: string;
|
|
7224
|
-
/**
|
|
7225
|
-
* Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
7226
|
-
*/
|
|
7227
|
-
input: unknown;
|
|
7228
|
-
/**
|
|
7229
|
-
* Whether the tool call will be executed by the provider.
|
|
7230
|
-
* If this flag is not set or is false, the tool call will be executed by the client.
|
|
7231
|
-
*/
|
|
7232
|
-
providerExecuted?: boolean;
|
|
7233
|
-
/**
|
|
7234
|
-
* Additional provider-specific options. They are passed through
|
|
7235
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
7236
|
-
* functionality that can be fully encapsulated in the provider.
|
|
7237
|
-
*/
|
|
7238
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
7239
|
-
}
|
|
7240
|
-
|
|
7241
|
-
declare type LanguageModelV3ToolChoice = {
|
|
7242
|
-
type: 'auto';
|
|
7243
|
-
} | {
|
|
7244
|
-
type: 'none';
|
|
7245
|
-
} | {
|
|
7246
|
-
type: 'required';
|
|
7247
|
-
} | {
|
|
7248
|
-
type: 'tool';
|
|
7249
|
-
toolName: string;
|
|
7250
|
-
};
|
|
7251
|
-
|
|
7252
|
-
/**
|
|
7253
|
-
* Result of a tool call that has been executed by the provider.
|
|
7254
|
-
*/
|
|
7255
|
-
declare type LanguageModelV3ToolResult = {
|
|
7256
|
-
type: 'tool-result';
|
|
7257
|
-
/**
|
|
7258
|
-
* The ID of the tool call that this result is associated with.
|
|
7259
|
-
*/
|
|
7260
|
-
toolCallId: string;
|
|
7261
|
-
/**
|
|
7262
|
-
* Name of the tool that generated this result.
|
|
7263
|
-
*/
|
|
7264
|
-
toolName: string;
|
|
7265
|
-
/**
|
|
7266
|
-
* Result of the tool call. This is a JSON-serializable object.
|
|
7267
|
-
*/
|
|
7268
|
-
result: NonNullable<JSONValue_2>;
|
|
7269
|
-
/**
|
|
7270
|
-
* Optional flag if the result is an error or an error message.
|
|
7271
|
-
*/
|
|
7272
|
-
isError?: boolean;
|
|
7273
|
-
/**
|
|
7274
|
-
* Whether the tool result is preliminary.
|
|
7275
|
-
*
|
|
7276
|
-
* Preliminary tool results replace each other, e.g. image previews.
|
|
7277
|
-
* There always has to be a final, non-preliminary tool result.
|
|
7278
|
-
*
|
|
7279
|
-
* If this flag is set to true, the tool result is preliminary.
|
|
7280
|
-
* If this flag is not set or is false, the tool result is not preliminary.
|
|
7281
|
-
*/
|
|
7282
|
-
preliminary?: boolean;
|
|
7283
|
-
/**
|
|
7284
|
-
* Whether the tool is dynamic, i.e. defined at runtime.
|
|
7285
|
-
* For example, MCP (Model Context Protocol) tools that are executed by the provider.
|
|
7286
|
-
*/
|
|
7287
|
-
dynamic?: boolean;
|
|
7288
|
-
/**
|
|
7289
|
-
* Additional provider-specific metadata for the tool result.
|
|
7290
|
-
*/
|
|
7291
|
-
providerMetadata?: SharedV3ProviderMetadata;
|
|
7292
|
-
};
|
|
7293
|
-
|
|
7294
|
-
/**
|
|
7295
|
-
* Result of a tool call that has been executed by the provider.
|
|
7296
|
-
*/
|
|
7297
|
-
declare type LanguageModelV3ToolResult_2 = {
|
|
7298
|
-
type: 'tool-result';
|
|
7299
|
-
/**
|
|
7300
|
-
* The ID of the tool call that this result is associated with.
|
|
7301
|
-
*/
|
|
7302
|
-
toolCallId: string;
|
|
7303
|
-
/**
|
|
7304
|
-
* Name of the tool that generated this result.
|
|
7305
|
-
*/
|
|
7306
|
-
toolName: string;
|
|
7307
|
-
/**
|
|
7308
|
-
* Result of the tool call. This is a JSON-serializable object.
|
|
7309
|
-
*/
|
|
7310
|
-
result: NonNullable<JSONValue_3>;
|
|
7311
|
-
/**
|
|
7312
|
-
* Optional flag if the result is an error or an error message.
|
|
7313
|
-
*/
|
|
7314
|
-
isError?: boolean;
|
|
7315
|
-
/**
|
|
7316
|
-
* Whether the tool result is preliminary.
|
|
7317
|
-
*
|
|
7318
|
-
* Preliminary tool results replace each other, e.g. image previews.
|
|
7319
|
-
* There always has to be a final, non-preliminary tool result.
|
|
7320
|
-
*
|
|
7321
|
-
* If this flag is set to true, the tool result is preliminary.
|
|
7322
|
-
* If this flag is not set or is false, the tool result is not preliminary.
|
|
7323
|
-
*/
|
|
7324
|
-
preliminary?: boolean;
|
|
7325
|
-
/**
|
|
7326
|
-
* Whether the tool is dynamic, i.e. defined at runtime.
|
|
7327
|
-
* For example, MCP (Model Context Protocol) tools that are executed by the provider.
|
|
7328
|
-
*/
|
|
7329
|
-
dynamic?: boolean;
|
|
7330
|
-
/**
|
|
7331
|
-
* Additional provider-specific metadata for the tool result.
|
|
7332
|
-
*/
|
|
7333
|
-
providerMetadata?: SharedV3ProviderMetadata_2;
|
|
7334
|
-
};
|
|
7335
|
-
|
|
7336
|
-
/**
|
|
7337
|
-
* Result of a tool call.
|
|
7338
|
-
*/
|
|
7339
|
-
declare type LanguageModelV3ToolResultOutput = {
|
|
7340
|
-
/**
|
|
7341
|
-
* Text tool output that should be directly sent to the API.
|
|
7342
|
-
*/
|
|
7343
|
-
type: 'text';
|
|
7344
|
-
value: string;
|
|
7345
|
-
/**
|
|
7346
|
-
* Provider-specific options.
|
|
7347
|
-
*/
|
|
7348
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7349
|
-
} | {
|
|
7350
|
-
type: 'json';
|
|
7351
|
-
value: JSONValue_2;
|
|
7352
|
-
/**
|
|
7353
|
-
* Provider-specific options.
|
|
7354
|
-
*/
|
|
7355
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7356
|
-
} | {
|
|
7357
|
-
/**
|
|
7358
|
-
* Type when the user has denied the execution of the tool call.
|
|
7359
|
-
*/
|
|
7360
|
-
type: 'execution-denied';
|
|
7361
|
-
/**
|
|
7362
|
-
* Optional reason for the execution denial.
|
|
7363
|
-
*/
|
|
7364
|
-
reason?: string;
|
|
7365
|
-
/**
|
|
7366
|
-
* Provider-specific options.
|
|
7367
|
-
*/
|
|
7368
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7369
|
-
} | {
|
|
7370
|
-
type: 'error-text';
|
|
7371
|
-
value: string;
|
|
7372
|
-
/**
|
|
7373
|
-
* Provider-specific options.
|
|
7374
|
-
*/
|
|
7375
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7376
|
-
} | {
|
|
7377
|
-
type: 'error-json';
|
|
7378
|
-
value: JSONValue_2;
|
|
7379
|
-
/**
|
|
7380
|
-
* Provider-specific options.
|
|
7381
|
-
*/
|
|
7382
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7383
|
-
} | {
|
|
7384
|
-
type: 'content';
|
|
7385
|
-
value: Array<{
|
|
7386
|
-
type: 'text';
|
|
7387
|
-
/**
|
|
7388
|
-
* Text content.
|
|
7389
|
-
*/
|
|
7390
|
-
text: string;
|
|
7391
|
-
/**
|
|
7392
|
-
* Provider-specific options.
|
|
7393
|
-
*/
|
|
7394
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7395
|
-
} | {
|
|
7396
|
-
type: 'file-data';
|
|
7397
|
-
/**
|
|
7398
|
-
* Base-64 encoded media data.
|
|
7399
|
-
*/
|
|
7400
|
-
data: string;
|
|
7401
|
-
/**
|
|
7402
|
-
* IANA media type.
|
|
7403
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
7404
|
-
*/
|
|
7405
|
-
mediaType: string;
|
|
7406
|
-
/**
|
|
7407
|
-
* Optional filename of the file.
|
|
7408
|
-
*/
|
|
7409
|
-
filename?: string;
|
|
7410
|
-
/**
|
|
7411
|
-
* Provider-specific options.
|
|
7412
|
-
*/
|
|
7413
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7414
|
-
} | {
|
|
7415
|
-
type: 'file-url';
|
|
7416
|
-
/**
|
|
7417
|
-
* URL of the file.
|
|
7418
|
-
*/
|
|
7419
|
-
url: string;
|
|
7420
|
-
/**
|
|
7421
|
-
* Provider-specific options.
|
|
7422
|
-
*/
|
|
7423
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7424
|
-
} | {
|
|
7425
|
-
type: 'file-id';
|
|
7426
|
-
/**
|
|
7427
|
-
* ID of the file.
|
|
7428
|
-
*
|
|
7429
|
-
* If you use multiple providers, you need to
|
|
7430
|
-
* specify the provider specific ids using
|
|
7431
|
-
* the Record option. The key is the provider
|
|
7432
|
-
* name, e.g. 'openai' or 'anthropic'.
|
|
7433
|
-
*/
|
|
7434
|
-
fileId: string | Record<string, string>;
|
|
7435
|
-
/**
|
|
7436
|
-
* Provider-specific options.
|
|
7437
|
-
*/
|
|
7438
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7439
|
-
} | {
|
|
7440
|
-
/**
|
|
7441
|
-
* Images that are referenced using base64 encoded data.
|
|
7442
|
-
*/
|
|
7443
|
-
type: 'image-data';
|
|
7444
|
-
/**
|
|
7445
|
-
* Base-64 encoded image data.
|
|
7446
|
-
*/
|
|
7447
|
-
data: string;
|
|
7448
|
-
/**
|
|
7449
|
-
* IANA media type.
|
|
7450
|
-
* @see https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
7451
|
-
*/
|
|
7452
|
-
mediaType: string;
|
|
7453
|
-
/**
|
|
7454
|
-
* Provider-specific options.
|
|
7455
|
-
*/
|
|
7456
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7457
|
-
} | {
|
|
7458
|
-
/**
|
|
7459
|
-
* Images that are referenced using a URL.
|
|
7460
|
-
*/
|
|
7461
|
-
type: 'image-url';
|
|
7462
|
-
/**
|
|
7463
|
-
* URL of the image.
|
|
7464
|
-
*/
|
|
7465
|
-
url: string;
|
|
7466
|
-
/**
|
|
7467
|
-
* Provider-specific options.
|
|
7468
|
-
*/
|
|
7469
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7470
|
-
} | {
|
|
7471
|
-
/**
|
|
7472
|
-
* Images that are referenced using a provider file id.
|
|
7473
|
-
*/
|
|
7474
|
-
type: 'image-file-id';
|
|
7475
|
-
/**
|
|
7476
|
-
* Image that is referenced using a provider file id.
|
|
7477
|
-
*
|
|
7478
|
-
* If you use multiple providers, you need to
|
|
7479
|
-
* specify the provider specific ids using
|
|
7480
|
-
* the Record option. The key is the provider
|
|
7481
|
-
* name, e.g. 'openai' or 'anthropic'.
|
|
7482
|
-
*/
|
|
7483
|
-
fileId: string | Record<string, string>;
|
|
7484
|
-
/**
|
|
7485
|
-
* Provider-specific options.
|
|
7486
|
-
*/
|
|
7487
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7488
|
-
} | {
|
|
7489
|
-
/**
|
|
7490
|
-
* Custom content part. This can be used to implement
|
|
7491
|
-
* provider-specific content parts.
|
|
7492
|
-
*/
|
|
7493
|
-
type: 'custom';
|
|
7494
|
-
/**
|
|
7495
|
-
* Provider-specific options.
|
|
7496
|
-
*/
|
|
7497
|
-
providerOptions?: SharedV3ProviderOptions;
|
|
7498
|
-
}>;
|
|
6897
|
+
|
|
6898
|
+
/**
|
|
6899
|
+
* Tool calls that the model has generated.
|
|
6900
|
+
*/
|
|
6901
|
+
declare type LanguageModelV3ToolCall = {
|
|
6902
|
+
type: 'tool-call';
|
|
6903
|
+
/**
|
|
6904
|
+
* The identifier of the tool call. It must be unique across all tool calls.
|
|
6905
|
+
*/
|
|
6906
|
+
toolCallId: string;
|
|
6907
|
+
/**
|
|
6908
|
+
* The name of the tool that should be called.
|
|
6909
|
+
*/
|
|
6910
|
+
toolName: string;
|
|
6911
|
+
/**
|
|
6912
|
+
* JSON-encoded tool input. Must match the input schema of the tool.
|
|
6913
|
+
* String inputs must also be JSON-encoded, even when input deltas use text
|
|
6914
|
+
* encoding.
|
|
6915
|
+
*/
|
|
6916
|
+
input: string;
|
|
6917
|
+
/**
|
|
6918
|
+
* Whether the tool call will be executed by the provider.
|
|
6919
|
+
* If this flag is not set or is false, the tool call will be executed by the client.
|
|
6920
|
+
*/
|
|
6921
|
+
providerExecuted?: boolean;
|
|
6922
|
+
/**
|
|
6923
|
+
* Whether the tool is dynamic, i.e. defined at runtime.
|
|
6924
|
+
* For example, MCP (Model Context Protocol) tools that are executed by the provider.
|
|
6925
|
+
*/
|
|
6926
|
+
dynamic?: boolean;
|
|
6927
|
+
/**
|
|
6928
|
+
* Additional provider-specific metadata for the tool call.
|
|
6929
|
+
*/
|
|
6930
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
6931
|
+
};
|
|
6932
|
+
|
|
6933
|
+
/**
|
|
6934
|
+
* Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
|
|
6935
|
+
*/
|
|
6936
|
+
declare interface LanguageModelV3ToolCallPart {
|
|
6937
|
+
type: 'tool-call';
|
|
6938
|
+
/**
|
|
6939
|
+
* ID of the tool call. This ID is used to match the tool call with the tool result.
|
|
6940
|
+
*/
|
|
6941
|
+
toolCallId: string;
|
|
6942
|
+
/**
|
|
6943
|
+
* Name of the tool that is being called.
|
|
6944
|
+
*/
|
|
6945
|
+
toolName: string;
|
|
6946
|
+
/**
|
|
6947
|
+
* Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
|
|
6948
|
+
*/
|
|
6949
|
+
input: unknown;
|
|
6950
|
+
/**
|
|
6951
|
+
* Whether the tool call will be executed by the provider.
|
|
6952
|
+
* If this flag is not set or is false, the tool call will be executed by the client.
|
|
6953
|
+
*/
|
|
6954
|
+
providerExecuted?: boolean;
|
|
6955
|
+
/**
|
|
6956
|
+
* Additional provider-specific options. They are passed through
|
|
6957
|
+
* to the provider from the AI SDK and enable provider-specific
|
|
6958
|
+
* functionality that can be fully encapsulated in the provider.
|
|
6959
|
+
*/
|
|
6960
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
6961
|
+
}
|
|
6962
|
+
|
|
6963
|
+
declare type LanguageModelV3ToolChoice = {
|
|
6964
|
+
type: 'auto';
|
|
6965
|
+
} | {
|
|
6966
|
+
type: 'none';
|
|
6967
|
+
} | {
|
|
6968
|
+
type: 'required';
|
|
6969
|
+
} | {
|
|
6970
|
+
type: 'tool';
|
|
6971
|
+
toolName: string;
|
|
6972
|
+
};
|
|
6973
|
+
|
|
6974
|
+
/**
|
|
6975
|
+
* Result of a tool call that has been executed by the provider.
|
|
6976
|
+
*/
|
|
6977
|
+
declare type LanguageModelV3ToolResult = {
|
|
6978
|
+
type: 'tool-result';
|
|
6979
|
+
/**
|
|
6980
|
+
* The ID of the tool call that this result is associated with.
|
|
6981
|
+
*/
|
|
6982
|
+
toolCallId: string;
|
|
6983
|
+
/**
|
|
6984
|
+
* Name of the tool that generated this result.
|
|
6985
|
+
*/
|
|
6986
|
+
toolName: string;
|
|
6987
|
+
/**
|
|
6988
|
+
* Result of the tool call. This is a JSON-serializable object.
|
|
6989
|
+
*/
|
|
6990
|
+
result: NonNullable<JSONValue_2>;
|
|
6991
|
+
/**
|
|
6992
|
+
* Optional flag if the result is an error or an error message.
|
|
6993
|
+
*/
|
|
6994
|
+
isError?: boolean;
|
|
6995
|
+
/**
|
|
6996
|
+
* Whether the tool result is preliminary.
|
|
6997
|
+
*
|
|
6998
|
+
* Preliminary tool results replace each other, e.g. image previews.
|
|
6999
|
+
* There always has to be a final, non-preliminary tool result.
|
|
7000
|
+
*
|
|
7001
|
+
* If this flag is set to true, the tool result is preliminary.
|
|
7002
|
+
* If this flag is not set or is false, the tool result is not preliminary.
|
|
7003
|
+
*/
|
|
7004
|
+
preliminary?: boolean;
|
|
7005
|
+
/**
|
|
7006
|
+
* Whether the tool is dynamic, i.e. defined at runtime.
|
|
7007
|
+
* For example, MCP (Model Context Protocol) tools that are executed by the provider.
|
|
7008
|
+
*/
|
|
7009
|
+
dynamic?: boolean;
|
|
7010
|
+
/**
|
|
7011
|
+
* Additional provider-specific metadata for the tool result.
|
|
7012
|
+
*/
|
|
7013
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
7499
7014
|
};
|
|
7500
7015
|
|
|
7501
7016
|
/**
|
|
7502
7017
|
* Result of a tool call.
|
|
7503
7018
|
*/
|
|
7504
|
-
declare type
|
|
7019
|
+
declare type LanguageModelV3ToolResultOutput = {
|
|
7505
7020
|
/**
|
|
7506
7021
|
* Text tool output that should be directly sent to the API.
|
|
7507
7022
|
*/
|
|
@@ -7510,14 +7025,14 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7510
7025
|
/**
|
|
7511
7026
|
* Provider-specific options.
|
|
7512
7027
|
*/
|
|
7513
|
-
providerOptions?:
|
|
7028
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7514
7029
|
} | {
|
|
7515
7030
|
type: 'json';
|
|
7516
|
-
value:
|
|
7031
|
+
value: JSONValue_2;
|
|
7517
7032
|
/**
|
|
7518
7033
|
* Provider-specific options.
|
|
7519
7034
|
*/
|
|
7520
|
-
providerOptions?:
|
|
7035
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7521
7036
|
} | {
|
|
7522
7037
|
/**
|
|
7523
7038
|
* Type when the user has denied the execution of the tool call.
|
|
@@ -7530,21 +7045,21 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7530
7045
|
/**
|
|
7531
7046
|
* Provider-specific options.
|
|
7532
7047
|
*/
|
|
7533
|
-
providerOptions?:
|
|
7048
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7534
7049
|
} | {
|
|
7535
7050
|
type: 'error-text';
|
|
7536
7051
|
value: string;
|
|
7537
7052
|
/**
|
|
7538
7053
|
* Provider-specific options.
|
|
7539
7054
|
*/
|
|
7540
|
-
providerOptions?:
|
|
7055
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7541
7056
|
} | {
|
|
7542
7057
|
type: 'error-json';
|
|
7543
|
-
value:
|
|
7058
|
+
value: JSONValue_2;
|
|
7544
7059
|
/**
|
|
7545
7060
|
* Provider-specific options.
|
|
7546
7061
|
*/
|
|
7547
|
-
providerOptions?:
|
|
7062
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7548
7063
|
} | {
|
|
7549
7064
|
type: 'content';
|
|
7550
7065
|
value: Array<{
|
|
@@ -7556,7 +7071,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7556
7071
|
/**
|
|
7557
7072
|
* Provider-specific options.
|
|
7558
7073
|
*/
|
|
7559
|
-
providerOptions?:
|
|
7074
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7560
7075
|
} | {
|
|
7561
7076
|
type: 'file-data';
|
|
7562
7077
|
/**
|
|
@@ -7575,7 +7090,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7575
7090
|
/**
|
|
7576
7091
|
* Provider-specific options.
|
|
7577
7092
|
*/
|
|
7578
|
-
providerOptions?:
|
|
7093
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7579
7094
|
} | {
|
|
7580
7095
|
type: 'file-url';
|
|
7581
7096
|
/**
|
|
@@ -7590,7 +7105,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7590
7105
|
/**
|
|
7591
7106
|
* Provider-specific options.
|
|
7592
7107
|
*/
|
|
7593
|
-
providerOptions?:
|
|
7108
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7594
7109
|
} | {
|
|
7595
7110
|
type: 'file-id';
|
|
7596
7111
|
/**
|
|
@@ -7605,7 +7120,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7605
7120
|
/**
|
|
7606
7121
|
* Provider-specific options.
|
|
7607
7122
|
*/
|
|
7608
|
-
providerOptions?:
|
|
7123
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7609
7124
|
} | {
|
|
7610
7125
|
/**
|
|
7611
7126
|
* Images that are referenced using base64 encoded data.
|
|
@@ -7623,7 +7138,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7623
7138
|
/**
|
|
7624
7139
|
* Provider-specific options.
|
|
7625
7140
|
*/
|
|
7626
|
-
providerOptions?:
|
|
7141
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7627
7142
|
} | {
|
|
7628
7143
|
/**
|
|
7629
7144
|
* Images that are referenced using a URL.
|
|
@@ -7636,7 +7151,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7636
7151
|
/**
|
|
7637
7152
|
* Provider-specific options.
|
|
7638
7153
|
*/
|
|
7639
|
-
providerOptions?:
|
|
7154
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7640
7155
|
} | {
|
|
7641
7156
|
/**
|
|
7642
7157
|
* Images that are referenced using a provider file id.
|
|
@@ -7654,7 +7169,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7654
7169
|
/**
|
|
7655
7170
|
* Provider-specific options.
|
|
7656
7171
|
*/
|
|
7657
|
-
providerOptions?:
|
|
7172
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7658
7173
|
} | {
|
|
7659
7174
|
/**
|
|
7660
7175
|
* Custom content part. This can be used to implement
|
|
@@ -7664,7 +7179,7 @@ declare type LanguageModelV3ToolResultOutput_2 = {
|
|
|
7664
7179
|
/**
|
|
7665
7180
|
* Provider-specific options.
|
|
7666
7181
|
*/
|
|
7667
|
-
providerOptions?:
|
|
7182
|
+
providerOptions?: SharedV3ProviderOptions;
|
|
7668
7183
|
}>;
|
|
7669
7184
|
};
|
|
7670
7185
|
|
|
@@ -7693,31 +7208,6 @@ declare interface LanguageModelV3ToolResultPart {
|
|
|
7693
7208
|
providerOptions?: SharedV3ProviderOptions;
|
|
7694
7209
|
}
|
|
7695
7210
|
|
|
7696
|
-
/**
|
|
7697
|
-
* Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
|
|
7698
|
-
*/
|
|
7699
|
-
declare interface LanguageModelV3ToolResultPart_2 {
|
|
7700
|
-
type: 'tool-result';
|
|
7701
|
-
/**
|
|
7702
|
-
* ID of the tool call that this result is associated with.
|
|
7703
|
-
*/
|
|
7704
|
-
toolCallId: string;
|
|
7705
|
-
/**
|
|
7706
|
-
* Name of the tool that generated this result.
|
|
7707
|
-
*/
|
|
7708
|
-
toolName: string;
|
|
7709
|
-
/**
|
|
7710
|
-
* Result of the tool call.
|
|
7711
|
-
*/
|
|
7712
|
-
output: LanguageModelV3ToolResultOutput_2;
|
|
7713
|
-
/**
|
|
7714
|
-
* Additional provider-specific options. They are passed through
|
|
7715
|
-
* to the provider from the AI SDK and enable provider-specific
|
|
7716
|
-
* functionality that can be fully encapsulated in the provider.
|
|
7717
|
-
*/
|
|
7718
|
-
providerOptions?: SharedV3ProviderOptions_2;
|
|
7719
|
-
}
|
|
7720
|
-
|
|
7721
7211
|
/**
|
|
7722
7212
|
* Usage information for a language model call.
|
|
7723
7213
|
*/
|
|
@@ -7769,57 +7259,6 @@ declare type LanguageModelV3Usage = {
|
|
|
7769
7259
|
raw?: JSONObject;
|
|
7770
7260
|
};
|
|
7771
7261
|
|
|
7772
|
-
/**
|
|
7773
|
-
* Usage information for a language model call.
|
|
7774
|
-
*/
|
|
7775
|
-
declare type LanguageModelV3Usage_2 = {
|
|
7776
|
-
/**
|
|
7777
|
-
* Information about the input tokens.
|
|
7778
|
-
*/
|
|
7779
|
-
inputTokens: {
|
|
7780
|
-
/**
|
|
7781
|
-
* The total number of input (prompt) tokens used.
|
|
7782
|
-
*/
|
|
7783
|
-
total: number | undefined;
|
|
7784
|
-
/**
|
|
7785
|
-
* The number of non-cached input (prompt) tokens used.
|
|
7786
|
-
*/
|
|
7787
|
-
noCache: number | undefined;
|
|
7788
|
-
/**
|
|
7789
|
-
* The number of cached input (prompt) tokens read.
|
|
7790
|
-
*/
|
|
7791
|
-
cacheRead: number | undefined;
|
|
7792
|
-
/**
|
|
7793
|
-
* The number of cached input (prompt) tokens written.
|
|
7794
|
-
*/
|
|
7795
|
-
cacheWrite: number | undefined;
|
|
7796
|
-
};
|
|
7797
|
-
/**
|
|
7798
|
-
* Information about the output tokens.
|
|
7799
|
-
*/
|
|
7800
|
-
outputTokens: {
|
|
7801
|
-
/**
|
|
7802
|
-
* The total number of output (completion) tokens used.
|
|
7803
|
-
*/
|
|
7804
|
-
total: number | undefined;
|
|
7805
|
-
/**
|
|
7806
|
-
* The number of text tokens used.
|
|
7807
|
-
*/
|
|
7808
|
-
text: number | undefined;
|
|
7809
|
-
/**
|
|
7810
|
-
* The number of reasoning tokens used.
|
|
7811
|
-
*/
|
|
7812
|
-
reasoning: number | undefined;
|
|
7813
|
-
};
|
|
7814
|
-
/**
|
|
7815
|
-
* Raw usage information from the provider.
|
|
7816
|
-
*
|
|
7817
|
-
* This is the usage information in the shape that the provider returns.
|
|
7818
|
-
* It can include additional information that is not part of the standard usage information.
|
|
7819
|
-
*/
|
|
7820
|
-
raw?: JSONObject_2;
|
|
7821
|
-
};
|
|
7822
|
-
|
|
7823
7262
|
/**
|
|
7824
7263
|
* Check if the last message is an assistant message with completed tool call approvals.
|
|
7825
7264
|
* The last step of the message must have at least one tool approval response and
|
|
@@ -7832,7 +7271,9 @@ export declare function lastAssistantMessageIsCompleteWithApprovalResponses({ me
|
|
|
7832
7271
|
/**
|
|
7833
7272
|
* Check if the last message is an assistant message with completed tool calls.
|
|
7834
7273
|
* The last step of the message must have at least one tool invocation and
|
|
7835
|
-
* all tool invocations must have a result.
|
|
7274
|
+
* all tool invocations must have a result. Completed model text may follow
|
|
7275
|
+
* the tool invocation because client-side tool results update parts in place,
|
|
7276
|
+
* but trailing text without a completed stream state prevents resubmission.
|
|
7836
7277
|
*/
|
|
7837
7278
|
export declare function lastAssistantMessageIsCompleteWithToolCalls({ messages, }: {
|
|
7838
7279
|
messages: UIMessage[];
|
|
@@ -7985,7 +7426,7 @@ export declare class MessageConversionError extends AISDKError {
|
|
|
7985
7426
|
}
|
|
7986
7427
|
|
|
7987
7428
|
export declare class MissingToolResultsError extends AISDKError {
|
|
7988
|
-
private readonly [symbol$
|
|
7429
|
+
private readonly [symbol$e];
|
|
7989
7430
|
readonly toolCallIds: string[];
|
|
7990
7431
|
constructor({ toolCallIds }: {
|
|
7991
7432
|
toolCallIds: string[];
|
|
@@ -8021,7 +7462,7 @@ export declare class NoContentGeneratedError extends AISDKError {
|
|
|
8021
7462
|
* - The model generated a response that could not be parsed.
|
|
8022
7463
|
*/
|
|
8023
7464
|
export declare class NoImageGeneratedError extends AISDKError {
|
|
8024
|
-
private readonly [symbol$
|
|
7465
|
+
private readonly [symbol$d_2];
|
|
8025
7466
|
/**
|
|
8026
7467
|
* The response metadata for each call.
|
|
8027
7468
|
*/
|
|
@@ -8046,7 +7487,7 @@ export declare class NoImageGeneratedError extends AISDKError {
|
|
|
8046
7487
|
* - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
|
|
8047
7488
|
*/
|
|
8048
7489
|
export declare class NoObjectGeneratedError extends AISDKError {
|
|
8049
|
-
private readonly [symbol$
|
|
7490
|
+
private readonly [symbol$c_2];
|
|
8050
7491
|
/**
|
|
8051
7492
|
* The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
|
|
8052
7493
|
*/
|
|
@@ -8078,7 +7519,7 @@ export declare class NoObjectGeneratedError extends AISDKError {
|
|
|
8078
7519
|
* Thrown when no LLM output was generated, e.g. because of errors.
|
|
8079
7520
|
*/
|
|
8080
7521
|
export declare class NoOutputGeneratedError extends AISDKError {
|
|
8081
|
-
private readonly [symbol$
|
|
7522
|
+
private readonly [symbol$b_2];
|
|
8082
7523
|
constructor({ message, cause, }?: {
|
|
8083
7524
|
message?: string;
|
|
8084
7525
|
cause?: Error;
|
|
@@ -8099,7 +7540,7 @@ declare function normalizeHeaders(headers: HeadersInit | Record<string, string |
|
|
|
8099
7540
|
* Error that is thrown when no speech audio was generated.
|
|
8100
7541
|
*/
|
|
8101
7542
|
export declare class NoSpeechGeneratedError extends AISDKError {
|
|
8102
|
-
private readonly [symbol$
|
|
7543
|
+
private readonly [symbol$a];
|
|
8103
7544
|
readonly responses: Array<SpeechModelResponseMetadata>;
|
|
8104
7545
|
constructor(options: {
|
|
8105
7546
|
responses: Array<SpeechModelResponseMetadata>;
|
|
@@ -8135,7 +7576,7 @@ export declare class NoSuchProviderError extends NoSuchModelError {
|
|
|
8135
7576
|
}
|
|
8136
7577
|
|
|
8137
7578
|
export declare class NoSuchToolError extends AISDKError {
|
|
8138
|
-
private readonly [symbol$
|
|
7579
|
+
private readonly [symbol$k];
|
|
8139
7580
|
readonly toolName: string;
|
|
8140
7581
|
readonly availableTools: string[] | undefined;
|
|
8141
7582
|
constructor({ toolName, availableTools, message, }: {
|
|
@@ -8150,7 +7591,7 @@ export declare class NoSuchToolError extends AISDKError {
|
|
|
8150
7591
|
* Error that is thrown when no transcript was generated.
|
|
8151
7592
|
*/
|
|
8152
7593
|
export declare class NoTranscriptGeneratedError extends AISDKError {
|
|
8153
|
-
private readonly [symbol$
|
|
7594
|
+
private readonly [symbol$9_2];
|
|
8154
7595
|
readonly responses: Array<TranscriptionModelResponseMetadata>;
|
|
8155
7596
|
constructor(options: {
|
|
8156
7597
|
responses: Array<TranscriptionModelResponseMetadata>;
|
|
@@ -8159,7 +7600,7 @@ export declare class NoTranscriptGeneratedError extends AISDKError {
|
|
|
8159
7600
|
}
|
|
8160
7601
|
|
|
8161
7602
|
export declare class NoVideoGeneratedError extends AISDKError {
|
|
8162
|
-
private readonly [symbol$
|
|
7603
|
+
private readonly [symbol$8_2];
|
|
8163
7604
|
readonly responses: Array<VideoModelResponseMetadata>;
|
|
8164
7605
|
constructor({ message, cause, responses, }: {
|
|
8165
7606
|
message?: string;
|
|
@@ -8230,7 +7671,7 @@ export declare type OnFinishEvent<TOOLS extends ToolSet = ToolSet> = StepResult<
|
|
|
8230
7671
|
*
|
|
8231
7672
|
* Called when the generation operation begins, before any LLM calls.
|
|
8232
7673
|
*/
|
|
8233
|
-
export declare interface OnStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
7674
|
+
export declare interface OnStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface, INCLUDE = {
|
|
8234
7675
|
requestBody?: boolean;
|
|
8235
7676
|
responseBody?: boolean;
|
|
8236
7677
|
}> {
|
|
@@ -8313,7 +7754,7 @@ export declare type OnStepFinishEvent<TOOLS extends ToolSet = ToolSet> = StepRes
|
|
|
8313
7754
|
* Called when a step (LLM call) begins, before the provider is called.
|
|
8314
7755
|
* Each step represents a single LLM invocation.
|
|
8315
7756
|
*/
|
|
8316
|
-
export declare interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
7757
|
+
export declare interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface, INCLUDE = {
|
|
8317
7758
|
requestBody?: boolean;
|
|
8318
7759
|
responseBody?: boolean;
|
|
8319
7760
|
}> {
|
|
@@ -8445,7 +7886,7 @@ export declare namespace Output {
|
|
|
8445
7886
|
};
|
|
8446
7887
|
}
|
|
8447
7888
|
|
|
8448
|
-
declare interface
|
|
7889
|
+
export declare interface OutputInterface<OUTPUT = any, PARTIAL = any, ELEMENT = any> {
|
|
8449
7890
|
/**
|
|
8450
7891
|
* The name of the output mode.
|
|
8451
7892
|
*/
|
|
@@ -8480,11 +7921,9 @@ declare interface Output_2<OUTPUT = any, PARTIAL = any, ELEMENT = any> {
|
|
|
8480
7921
|
|
|
8481
7922
|
declare interface ParallelSearchConfig {
|
|
8482
7923
|
/**
|
|
8483
|
-
*
|
|
8484
|
-
* - "one-shot": Comprehensive results with longer excerpts for single-response answers (default)
|
|
8485
|
-
* - "agentic": Concise, token-efficient results for multi-step agentic workflows
|
|
7924
|
+
* Search mode. Defaults to `basic`.
|
|
8486
7925
|
*/
|
|
8487
|
-
mode?:
|
|
7926
|
+
mode?: ParallelSearchMode;
|
|
8488
7927
|
/**
|
|
8489
7928
|
* Default maximum number of results to return (1-20).
|
|
8490
7929
|
* Defaults to 10 if not specified.
|
|
@@ -8498,15 +7937,24 @@ declare interface ParallelSearchConfig {
|
|
|
8498
7937
|
* Default excerpt configuration for controlling result length.
|
|
8499
7938
|
*/
|
|
8500
7939
|
excerpts?: ParallelSearchExcerpts;
|
|
7940
|
+
/**
|
|
7941
|
+
* Maximum total characters across all result excerpts.
|
|
7942
|
+
*/
|
|
7943
|
+
maxCharsTotal?: number;
|
|
8501
7944
|
/**
|
|
8502
7945
|
* Default fetch policy for controlling content freshness.
|
|
8503
7946
|
*/
|
|
8504
7947
|
fetchPolicy?: ParallelSearchFetchPolicy;
|
|
7948
|
+
/**
|
|
7949
|
+
* ISO 3166-1 alpha-2 country code to localize results, e.g. 'us'.
|
|
7950
|
+
* Invalid codes are ignored with a warning.
|
|
7951
|
+
*/
|
|
7952
|
+
location?: string;
|
|
8505
7953
|
}
|
|
8506
7954
|
|
|
8507
7955
|
declare interface ParallelSearchError {
|
|
8508
7956
|
/** Error type */
|
|
8509
|
-
error: 'api_error' | '
|
|
7957
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'gateway_rate_limit' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown' | 'unknown_tool';
|
|
8510
7958
|
/** HTTP status code if applicable */
|
|
8511
7959
|
statusCode?: number;
|
|
8512
7960
|
/** Human-readable error message */
|
|
@@ -8520,16 +7968,27 @@ declare interface ParallelSearchExcerpts {
|
|
|
8520
7968
|
maxCharsPerResult?: number;
|
|
8521
7969
|
/**
|
|
8522
7970
|
* Maximum total characters across all results.
|
|
7971
|
+
* @deprecated Use the top-level `maxCharsTotal` option instead.
|
|
8523
7972
|
*/
|
|
8524
7973
|
maxCharsTotal?: number;
|
|
8525
7974
|
}
|
|
8526
7975
|
|
|
8527
7976
|
declare interface ParallelSearchFetchPolicy {
|
|
8528
7977
|
/**
|
|
8529
|
-
* Maximum age in seconds
|
|
8530
|
-
*
|
|
7978
|
+
* Maximum age in seconds of cached content before a live fetch is attempted.
|
|
7979
|
+
* Minimum 600; lower values are raised to 600.
|
|
8531
7980
|
*/
|
|
8532
7981
|
maxAgeSeconds?: number;
|
|
7982
|
+
/**
|
|
7983
|
+
* Timeout in seconds for a live fetch when content is not cached.
|
|
7984
|
+
* The gateway caps it to stay within its own tool timeout.
|
|
7985
|
+
*/
|
|
7986
|
+
timeoutSeconds?: number;
|
|
7987
|
+
/**
|
|
7988
|
+
* Return an error instead of falling back to older cached content when a
|
|
7989
|
+
* live fetch fails or times out. Defaults to false.
|
|
7990
|
+
*/
|
|
7991
|
+
disableCacheFallback?: boolean;
|
|
8533
7992
|
}
|
|
8534
7993
|
|
|
8535
7994
|
declare interface ParallelSearchInput {
|
|
@@ -8540,16 +7999,13 @@ declare interface ParallelSearchInput {
|
|
|
8540
7999
|
*/
|
|
8541
8000
|
objective: string;
|
|
8542
8001
|
/**
|
|
8543
|
-
*
|
|
8544
|
-
* Maximum 200 characters per query.
|
|
8002
|
+
* 2-3 concise keyword queries, 3-6 words each (max 5, 200 characters each).
|
|
8545
8003
|
*/
|
|
8546
8004
|
search_queries?: string[];
|
|
8547
8005
|
/**
|
|
8548
|
-
*
|
|
8549
|
-
* - "one-shot": Comprehensive results with longer excerpts
|
|
8550
|
-
* - "agentic": Concise, token-efficient results for multi-step workflows
|
|
8006
|
+
* Search mode. Defaults to `basic`.
|
|
8551
8007
|
*/
|
|
8552
|
-
mode?:
|
|
8008
|
+
mode?: ParallelSearchMode;
|
|
8553
8009
|
/**
|
|
8554
8010
|
* Maximum number of results to return (1-20).
|
|
8555
8011
|
* Defaults to 10 if not specified.
|
|
@@ -8568,51 +8024,75 @@ declare interface ParallelSearchInput {
|
|
|
8568
8024
|
*/
|
|
8569
8025
|
excerpts?: {
|
|
8570
8026
|
max_chars_per_result?: number;
|
|
8027
|
+
/** @deprecated Use the top-level `max_chars_total` instead. */
|
|
8571
8028
|
max_chars_total?: number;
|
|
8572
8029
|
};
|
|
8030
|
+
/**
|
|
8031
|
+
* Maximum total characters across all result excerpts.
|
|
8032
|
+
*/
|
|
8033
|
+
max_chars_total?: number;
|
|
8573
8034
|
/**
|
|
8574
8035
|
* Fetch policy for controlling content freshness.
|
|
8575
8036
|
*/
|
|
8576
8037
|
fetch_policy?: {
|
|
8577
8038
|
max_age_seconds?: number;
|
|
8039
|
+
timeout_seconds?: number;
|
|
8040
|
+
disable_cache_fallback?: boolean;
|
|
8578
8041
|
};
|
|
8042
|
+
/**
|
|
8043
|
+
* ISO 3166-1 alpha-2 country code to localize results.
|
|
8044
|
+
*/
|
|
8045
|
+
location?: string;
|
|
8579
8046
|
}
|
|
8580
8047
|
|
|
8048
|
+
/**
|
|
8049
|
+
* Search mode. `turbo` and `fast` trade excerpt depth for latency (`turbo` is
|
|
8050
|
+
* English and Japanese only), `basic` is balanced, `advanced` is the most thorough.
|
|
8051
|
+
* Deprecated: `one-shot` (runs as `basic`) and `agentic` (runs as `advanced`).
|
|
8052
|
+
*/
|
|
8053
|
+
declare type ParallelSearchMode = (typeof parallelSearchModes)[number];
|
|
8054
|
+
|
|
8055
|
+
declare const parallelSearchModes: readonly ["turbo", "fast", "basic", "advanced", "one-shot", "agentic"];
|
|
8056
|
+
|
|
8581
8057
|
declare type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
8582
8058
|
|
|
8583
8059
|
declare interface ParallelSearchResponse {
|
|
8584
8060
|
/** Unique identifier for this search request */
|
|
8585
|
-
|
|
8586
|
-
/**
|
|
8061
|
+
search_id: string;
|
|
8062
|
+
/** Search results, ordered by decreasing relevance */
|
|
8587
8063
|
results: ParallelSearchResult[];
|
|
8064
|
+
/** Non-fatal issues with the request, such as an ignored `location` */
|
|
8065
|
+
warnings?: ParallelSearchWarning[] | null;
|
|
8066
|
+
/** Usage reported by Parallel for this search */
|
|
8067
|
+
usage?: ParallelSearchUsage[] | null;
|
|
8068
|
+
/** Session identifier shared by the searches made during one request */
|
|
8069
|
+
session_id?: string;
|
|
8588
8070
|
}
|
|
8589
8071
|
|
|
8590
8072
|
declare interface ParallelSearchResult {
|
|
8591
8073
|
/** URL of the search result */
|
|
8592
8074
|
url: string;
|
|
8593
|
-
/** Title of the
|
|
8594
|
-
title
|
|
8595
|
-
/**
|
|
8596
|
-
|
|
8597
|
-
/**
|
|
8598
|
-
|
|
8599
|
-
/** Relevance score for the result */
|
|
8600
|
-
relevanceScore?: number;
|
|
8075
|
+
/** Title of the page, if available */
|
|
8076
|
+
title?: string | null;
|
|
8077
|
+
/** Publication date of the page (YYYY-MM-DD), if available */
|
|
8078
|
+
publish_date?: string | null;
|
|
8079
|
+
/** Relevant excerpts from the page, formatted as markdown */
|
|
8080
|
+
excerpts: string[];
|
|
8601
8081
|
}
|
|
8602
8082
|
|
|
8603
8083
|
declare interface ParallelSearchSourcePolicy {
|
|
8604
8084
|
/**
|
|
8605
|
-
*
|
|
8606
|
-
* Example: ['wikipedia.org', '
|
|
8085
|
+
* Domains or domain/path prefixes to restrict results to. When set,
|
|
8086
|
+
* `excludeDomains` is ignored. Example: ['wikipedia.org', 'docs.python.org/3']
|
|
8607
8087
|
*/
|
|
8608
8088
|
includeDomains?: string[];
|
|
8609
8089
|
/**
|
|
8610
|
-
*
|
|
8611
|
-
* Example: ['reddit.com'
|
|
8090
|
+
* Domains or domain/path prefixes to exclude from results.
|
|
8091
|
+
* Example: ['reddit.com']
|
|
8612
8092
|
*/
|
|
8613
8093
|
excludeDomains?: string[];
|
|
8614
8094
|
/**
|
|
8615
|
-
* Only include results published after this date (
|
|
8095
|
+
* Only include results published on or after this date (YYYY-MM-DD).
|
|
8616
8096
|
* Example: '2024-01-01'
|
|
8617
8097
|
*/
|
|
8618
8098
|
afterDate?: string;
|
|
@@ -8620,6 +8100,22 @@ declare interface ParallelSearchSourcePolicy {
|
|
|
8620
8100
|
|
|
8621
8101
|
declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
|
|
8622
8102
|
|
|
8103
|
+
declare interface ParallelSearchUsage {
|
|
8104
|
+
/** Usage item name, e.g. 'sku_search' */
|
|
8105
|
+
name: string;
|
|
8106
|
+
/** Count for the usage item */
|
|
8107
|
+
count?: number;
|
|
8108
|
+
}
|
|
8109
|
+
|
|
8110
|
+
declare interface ParallelSearchWarning {
|
|
8111
|
+
/** Warning type, e.g. 'input_validation_warning'. New types may be added. */
|
|
8112
|
+
type: string;
|
|
8113
|
+
/** Human-readable message */
|
|
8114
|
+
message: string;
|
|
8115
|
+
/** Optional detail supporting the warning */
|
|
8116
|
+
detail?: Record<string, unknown> | null;
|
|
8117
|
+
}
|
|
8118
|
+
|
|
8623
8119
|
/**
|
|
8624
8120
|
* Parses a JSON string into an unknown object.
|
|
8625
8121
|
*
|
|
@@ -8629,7 +8125,7 @@ declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFact
|
|
|
8629
8125
|
declare function parseJSON(options: {
|
|
8630
8126
|
text: string;
|
|
8631
8127
|
schema?: undefined;
|
|
8632
|
-
}): Promise<
|
|
8128
|
+
}): Promise<JSONValue_2>;
|
|
8633
8129
|
|
|
8634
8130
|
/**
|
|
8635
8131
|
* Parses a JSON string into a strongly-typed object using the provided schema.
|
|
@@ -8669,7 +8165,7 @@ declare type ParseResult<T> = {
|
|
|
8669
8165
|
rawValue: unknown;
|
|
8670
8166
|
} | {
|
|
8671
8167
|
success: false;
|
|
8672
|
-
error:
|
|
8168
|
+
error: JSONParseError | TypeValidationError;
|
|
8673
8169
|
rawValue: unknown;
|
|
8674
8170
|
};
|
|
8675
8171
|
|
|
@@ -8824,7 +8320,7 @@ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFa
|
|
|
8824
8320
|
*
|
|
8825
8321
|
* @param response - The Node.js ServerResponse object to pipe to.
|
|
8826
8322
|
* @param agent - The agent to run.
|
|
8827
|
-
* @param uiMessages - The input UI messages.
|
|
8323
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
8828
8324
|
* @param abortSignal - Abort signal. Optional.
|
|
8829
8325
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
8830
8326
|
* @param options - The options for the agent. Optional.
|
|
@@ -8833,12 +8329,13 @@ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFa
|
|
|
8833
8329
|
* @param headers - Additional headers for the response. Optional.
|
|
8834
8330
|
* @param status - The status code for the response. Optional.
|
|
8835
8331
|
* @param statusText - The status text for the response. Optional.
|
|
8332
|
+
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
8836
8333
|
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
8837
8334
|
*/
|
|
8838
|
-
export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
8335
|
+
export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ response, headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
8839
8336
|
response: ServerResponse;
|
|
8840
8337
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
8841
|
-
uiMessages
|
|
8338
|
+
uiMessages?: unknown[];
|
|
8842
8339
|
abortSignal?: AbortSignal;
|
|
8843
8340
|
timeout?: TimeoutConfiguration;
|
|
8844
8341
|
options?: CALL_OPTIONS;
|
|
@@ -8873,10 +8370,11 @@ export declare function pipeTextStreamToResponse({ response, status, statusText,
|
|
|
8873
8370
|
* @param options.statusText - The HTTP status text for the response.
|
|
8874
8371
|
* @param options.headers - Additional HTTP headers to include in the response.
|
|
8875
8372
|
* @param options.stream - The UI message chunk stream to send.
|
|
8373
|
+
* @param options.keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
8876
8374
|
* @param options.consumeSseStream - Optional callback to consume a copy of the SSE stream independently.
|
|
8877
8375
|
* @returns A promise that resolves when the stream has been written.
|
|
8878
8376
|
*/
|
|
8879
|
-
export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream, }: {
|
|
8377
|
+
export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: {
|
|
8880
8378
|
response: ServerResponse;
|
|
8881
8379
|
stream: ReadableStream<UIMessageChunk>;
|
|
8882
8380
|
} & UIMessageStreamResponseInit): Promise<void>;
|
|
@@ -8885,7 +8383,7 @@ declare const postFormDataToApi: <T>({ url, headers, formData, failedResponseHan
|
|
|
8885
8383
|
url: string;
|
|
8886
8384
|
headers?: Record<string, string | undefined>;
|
|
8887
8385
|
formData: FormData;
|
|
8888
|
-
failedResponseHandler: ResponseHandler<
|
|
8386
|
+
failedResponseHandler: ResponseHandler<APICallError>;
|
|
8889
8387
|
successfulResponseHandler: ResponseHandler<T>;
|
|
8890
8388
|
abortSignal?: AbortSignal;
|
|
8891
8389
|
fetch?: FetchFunction;
|
|
@@ -8899,7 +8397,7 @@ declare const postJsonToApi: <T>({ url, headers, body, failedResponseHandler, su
|
|
|
8899
8397
|
url: string;
|
|
8900
8398
|
headers?: Record<string, string | undefined>;
|
|
8901
8399
|
body: unknown;
|
|
8902
|
-
failedResponseHandler: ResponseHandler<
|
|
8400
|
+
failedResponseHandler: ResponseHandler<APICallError>;
|
|
8903
8401
|
successfulResponseHandler: ResponseHandler<T>;
|
|
8904
8402
|
abortSignal?: AbortSignal;
|
|
8905
8403
|
fetch?: FetchFunction;
|
|
@@ -9142,7 +8640,7 @@ export declare type Provider = {
|
|
|
9142
8640
|
*
|
|
9143
8641
|
* @throws {NoSuchModelError} If no such model exists.
|
|
9144
8642
|
*/
|
|
9145
|
-
rerankingModel(modelId: string): RerankingModel;
|
|
8643
|
+
rerankingModel?(modelId: string): RerankingModel;
|
|
9146
8644
|
};
|
|
9147
8645
|
|
|
9148
8646
|
/**
|
|
@@ -9159,7 +8657,7 @@ export declare type ProviderMetadata = SharedV3ProviderMetadata;
|
|
|
9159
8657
|
* They are passed through to the provider from the AI SDK and enable
|
|
9160
8658
|
* provider-specific functionality that can be fully encapsulated in the provider.
|
|
9161
8659
|
*/
|
|
9162
|
-
declare type ProviderOptions =
|
|
8660
|
+
declare type ProviderOptions = SharedV3ProviderOptions;
|
|
9163
8661
|
|
|
9164
8662
|
export declare interface ProviderRegistryProvider<PROVIDERS extends Record<string, ProviderV3> = Record<string, ProviderV3>, SEPARATOR extends string = ':'> {
|
|
9165
8663
|
languageModel<KEY extends keyof PROVIDERS>(id: KEY extends string ? `${KEY & string}${SEPARATOR}${ExtractLiteralUnion<Parameters<NonNullable<PROVIDERS[KEY]['languageModel']>>[0]>}` : never): LanguageModelV3;
|
|
@@ -9425,6 +8923,10 @@ declare interface ReasoningPart {
|
|
|
9425
8923
|
*/
|
|
9426
8924
|
export declare type ReasoningUIPart = {
|
|
9427
8925
|
type: 'reasoning';
|
|
8926
|
+
/**
|
|
8927
|
+
* The reasoning part ID.
|
|
8928
|
+
*/
|
|
8929
|
+
id?: string;
|
|
9428
8930
|
/**
|
|
9429
8931
|
* The reasoning text.
|
|
9430
8932
|
*/
|
|
@@ -9727,7 +9229,7 @@ declare type RetryDelayProvider = ({ error, exponentialBackoffDelay, }: {
|
|
|
9727
9229
|
}) => number;
|
|
9728
9230
|
|
|
9729
9231
|
export declare class RetryError extends AISDKError {
|
|
9730
|
-
private readonly [symbol$
|
|
9232
|
+
private readonly [symbol$1_2];
|
|
9731
9233
|
readonly reason: RetryErrorReason_2;
|
|
9732
9234
|
readonly lastError: unknown;
|
|
9733
9235
|
readonly errors: Array<unknown>;
|
|
@@ -9773,7 +9275,7 @@ declare const retryWithExponentialBackoff: ({ maxRetries, initialDelayInMs, back
|
|
|
9773
9275
|
declare function safeParseJSON(options: {
|
|
9774
9276
|
text: string;
|
|
9775
9277
|
schema?: undefined;
|
|
9776
|
-
}): Promise<ParseResult<
|
|
9278
|
+
}): Promise<ParseResult<JSONValue_2>>;
|
|
9777
9279
|
|
|
9778
9280
|
/**
|
|
9779
9281
|
* Safely parses a JSON string into a strongly-typed object, using a provided schema to validate the object.
|
|
@@ -9801,32 +9303,23 @@ declare function safeParseJSON<T>(options: {
|
|
|
9801
9303
|
declare function safeValidateTypes<OBJECT>({ value, schema, context, }: {
|
|
9802
9304
|
value: unknown;
|
|
9803
9305
|
schema: FlexibleSchema<OBJECT>;
|
|
9804
|
-
context?:
|
|
9306
|
+
context?: TypeValidationContext;
|
|
9805
9307
|
}): Promise<{
|
|
9806
9308
|
success: true;
|
|
9807
9309
|
value: OBJECT;
|
|
9808
9310
|
rawValue: unknown;
|
|
9809
9311
|
} | {
|
|
9810
9312
|
success: false;
|
|
9811
|
-
error:
|
|
9313
|
+
error: TypeValidationError;
|
|
9812
9314
|
rawValue: unknown;
|
|
9813
9315
|
}>;
|
|
9814
9316
|
|
|
9815
9317
|
/**
|
|
9816
9318
|
* Validates a list of UI messages like `validateUIMessages`,
|
|
9817
|
-
* but instead of throwing it returns `{ success: true, data }`
|
|
9818
|
-
* or `{ success: false, error }`.
|
|
9819
|
-
*/
|
|
9820
|
-
export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>(
|
|
9821
|
-
messages: unknown;
|
|
9822
|
-
metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
|
|
9823
|
-
dataSchemas?: {
|
|
9824
|
-
[NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
|
|
9825
|
-
};
|
|
9826
|
-
tools?: {
|
|
9827
|
-
[NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
|
|
9828
|
-
};
|
|
9829
|
-
}): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
|
|
9319
|
+
* but instead of throwing it returns `{ success: true, data }`
|
|
9320
|
+
* or `{ success: false, error }`.
|
|
9321
|
+
*/
|
|
9322
|
+
export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
|
|
9830
9323
|
|
|
9831
9324
|
export declare type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
|
|
9832
9325
|
success: true;
|
|
@@ -9866,8 +9359,10 @@ declare function secureJsonParse(text: string): any;
|
|
|
9866
9359
|
export declare class SerialJobExecutor {
|
|
9867
9360
|
private queue;
|
|
9868
9361
|
private isProcessing;
|
|
9362
|
+
private idleWaiters;
|
|
9869
9363
|
private processQueue;
|
|
9870
9364
|
run(job: Job): Promise<void>;
|
|
9365
|
+
waitForIdle(): Promise<void>;
|
|
9871
9366
|
}
|
|
9872
9367
|
|
|
9873
9368
|
declare type SharedV2Headers = Record<string, string>;
|
|
@@ -9943,29 +9438,6 @@ declare type SharedV3Headers = Record<string, string>;
|
|
|
9943
9438
|
*/
|
|
9944
9439
|
declare type SharedV3ProviderMetadata = Record<string, JSONObject>;
|
|
9945
9440
|
|
|
9946
|
-
/**
|
|
9947
|
-
* Additional provider-specific metadata.
|
|
9948
|
-
* Metadata are additional outputs from the provider.
|
|
9949
|
-
* They are passed through to the provider from the AI SDK
|
|
9950
|
-
* and enable provider-specific functionality
|
|
9951
|
-
* that can be fully encapsulated in the provider.
|
|
9952
|
-
*
|
|
9953
|
-
* This enables us to quickly ship provider-specific functionality
|
|
9954
|
-
* without affecting the core AI SDK.
|
|
9955
|
-
*
|
|
9956
|
-
* The outer record is keyed by the provider name, and the inner
|
|
9957
|
-
* record is keyed by the provider-specific metadata key.
|
|
9958
|
-
*
|
|
9959
|
-
* ```ts
|
|
9960
|
-
* {
|
|
9961
|
-
* "anthropic": {
|
|
9962
|
-
* "cacheControl": { "type": "ephemeral" }
|
|
9963
|
-
* }
|
|
9964
|
-
* }
|
|
9965
|
-
* ```
|
|
9966
|
-
*/
|
|
9967
|
-
declare type SharedV3ProviderMetadata_2 = Record<string, JSONObject_2>;
|
|
9968
|
-
|
|
9969
9441
|
/**
|
|
9970
9442
|
* Additional provider-specific options.
|
|
9971
9443
|
* Options are additional input to the provider.
|
|
@@ -9989,29 +9461,6 @@ declare type SharedV3ProviderMetadata_2 = Record<string, JSONObject_2>;
|
|
|
9989
9461
|
*/
|
|
9990
9462
|
declare type SharedV3ProviderOptions = Record<string, JSONObject>;
|
|
9991
9463
|
|
|
9992
|
-
/**
|
|
9993
|
-
* Additional provider-specific options.
|
|
9994
|
-
* Options are additional input to the provider.
|
|
9995
|
-
* They are passed through to the provider from the AI SDK
|
|
9996
|
-
* and enable provider-specific functionality
|
|
9997
|
-
* that can be fully encapsulated in the provider.
|
|
9998
|
-
*
|
|
9999
|
-
* This enables us to quickly ship provider-specific functionality
|
|
10000
|
-
* without affecting the core AI SDK.
|
|
10001
|
-
*
|
|
10002
|
-
* The outer record is keyed by the provider name, and the inner
|
|
10003
|
-
* record is keyed by the provider-specific metadata key.
|
|
10004
|
-
*
|
|
10005
|
-
* ```ts
|
|
10006
|
-
* {
|
|
10007
|
-
* "anthropic": {
|
|
10008
|
-
* "cacheControl": { "type": "ephemeral" }
|
|
10009
|
-
* }
|
|
10010
|
-
* }
|
|
10011
|
-
* ```
|
|
10012
|
-
*/
|
|
10013
|
-
declare type SharedV3ProviderOptions_2 = Record<string, JSONObject_2>;
|
|
10014
|
-
|
|
10015
9464
|
/**
|
|
10016
9465
|
* Warning from the model.
|
|
10017
9466
|
*
|
|
@@ -10055,49 +9504,6 @@ declare type SharedV3Warning = {
|
|
|
10055
9504
|
message: string;
|
|
10056
9505
|
};
|
|
10057
9506
|
|
|
10058
|
-
/**
|
|
10059
|
-
* Warning from the model.
|
|
10060
|
-
*
|
|
10061
|
-
* For example, that certain features are unsupported or compatibility
|
|
10062
|
-
* functionality is used (which might lead to suboptimal results).
|
|
10063
|
-
*/
|
|
10064
|
-
declare type SharedV3Warning_2 = {
|
|
10065
|
-
/**
|
|
10066
|
-
* A feature is not supported by the model.
|
|
10067
|
-
*/
|
|
10068
|
-
type: 'unsupported';
|
|
10069
|
-
/**
|
|
10070
|
-
* The feature that is not supported.
|
|
10071
|
-
*/
|
|
10072
|
-
feature: string;
|
|
10073
|
-
/**
|
|
10074
|
-
* Additional details about the warning.
|
|
10075
|
-
*/
|
|
10076
|
-
details?: string;
|
|
10077
|
-
} | {
|
|
10078
|
-
/**
|
|
10079
|
-
* A compatibility feature is used that might lead to suboptimal results.
|
|
10080
|
-
*/
|
|
10081
|
-
type: 'compatibility';
|
|
10082
|
-
/**
|
|
10083
|
-
* The feature that is used in a compatibility mode.
|
|
10084
|
-
*/
|
|
10085
|
-
feature: string;
|
|
10086
|
-
/**
|
|
10087
|
-
* Additional details about the warning.
|
|
10088
|
-
*/
|
|
10089
|
-
details?: string;
|
|
10090
|
-
} | {
|
|
10091
|
-
/**
|
|
10092
|
-
* Other warning.
|
|
10093
|
-
*/
|
|
10094
|
-
type: 'other';
|
|
10095
|
-
/**
|
|
10096
|
-
* The message of the warning.
|
|
10097
|
-
*/
|
|
10098
|
-
message: string;
|
|
10099
|
-
};
|
|
10100
|
-
|
|
10101
9507
|
declare type ShouldRetryFunction = (error: unknown) => boolean | Promise<boolean>;
|
|
10102
9508
|
|
|
10103
9509
|
/**
|
|
@@ -10202,7 +9608,7 @@ declare type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
|
|
10202
9608
|
/**
|
|
10203
9609
|
* Smooths text and reasoning streaming output.
|
|
10204
9610
|
*
|
|
10205
|
-
* @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay.
|
|
9611
|
+
* @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay. The delay is skipped while the document is hidden (e.g. browser background tabs), where timer throttling would otherwise stall the stream.
|
|
10206
9612
|
* @param chunking - Controls how the text is chunked for streaming. Use "word" to stream word by word (default), "line" to stream line by line, provide a custom RegExp pattern for custom chunking, provide an Intl.Segmenter for locale-aware word segmentation (recommended for CJK languages), or provide a custom ChunkDetector function.
|
|
10207
9613
|
*
|
|
10208
9614
|
* @returns A transform stream that smooths text streaming output.
|
|
@@ -11178,7 +10584,7 @@ declare class StreamingToolCallTracker<DELTA extends StreamingToolCallDelta = St
|
|
|
11178
10584
|
private finishToolCall;
|
|
11179
10585
|
}
|
|
11180
10586
|
|
|
11181
|
-
declare type StreamingToolCallTrackerController = Pick<TransformStreamDefaultController<
|
|
10587
|
+
declare type StreamingToolCallTrackerController = Pick<TransformStreamDefaultController<LanguageModelV3StreamPart>, 'enqueue'>;
|
|
11182
10588
|
|
|
11183
10589
|
declare interface StreamingToolCallTrackerOptions<DELTA extends StreamingToolCallDelta = StreamingToolCallDelta> {
|
|
11184
10590
|
/**
|
|
@@ -11198,11 +10604,11 @@ declare interface StreamingToolCallTrackerOptions<DELTA extends StreamingToolCal
|
|
|
11198
10604
|
* Extract provider-specific metadata from a tool call delta.
|
|
11199
10605
|
* Called once when a new tool call is detected.
|
|
11200
10606
|
*/
|
|
11201
|
-
extractMetadata?: (delta: DELTA) =>
|
|
10607
|
+
extractMetadata?: (delta: DELTA) => SharedV3ProviderMetadata | undefined;
|
|
11202
10608
|
/**
|
|
11203
10609
|
* Build the `providerMetadata` object for a `tool-call` event.
|
|
11204
10610
|
*/
|
|
11205
|
-
buildToolCallProviderMetadata?: (metadata:
|
|
10611
|
+
buildToolCallProviderMetadata?: (metadata: SharedV3ProviderMetadata | undefined) => SharedV3ProviderMetadata | undefined;
|
|
11206
10612
|
}
|
|
11207
10613
|
|
|
11208
10614
|
/**
|
|
@@ -11486,6 +10892,16 @@ declare interface StreamOptions {
|
|
|
11486
10892
|
* @param comment - The comment encountered in the stream.
|
|
11487
10893
|
*/
|
|
11488
10894
|
onComment?: ((comment: string) => void) | undefined;
|
|
10895
|
+
/**
|
|
10896
|
+
* Maximum number of characters the parser is allowed to buffer across calls to `feed()`.
|
|
10897
|
+
* See {@link ParserConfig.maxBufferSize} for details.
|
|
10898
|
+
*
|
|
10899
|
+
* When the limit is exceeded, the stream is always errored (regardless of the `onError`
|
|
10900
|
+
* setting) since the underlying parser is unrecoverable without a `reset()`.
|
|
10901
|
+
*
|
|
10902
|
+
* @defaultValue `undefined` (unbounded)
|
|
10903
|
+
*/
|
|
10904
|
+
maxBufferSize?: number | undefined;
|
|
11489
10905
|
}
|
|
11490
10906
|
|
|
11491
10907
|
/**
|
|
@@ -11535,7 +10951,7 @@ declare interface StreamOptions {
|
|
|
11535
10951
|
* @returns
|
|
11536
10952
|
* A result object for accessing different stream types and additional information.
|
|
11537
10953
|
*/
|
|
11538
|
-
export declare function streamText<TOOLS extends ToolSet, OUTPUT extends
|
|
10954
|
+
export declare function streamText<TOOLS extends ToolSet, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
|
|
11539
10955
|
/**
|
|
11540
10956
|
* The language model to use.
|
|
11541
10957
|
*/
|
|
@@ -11636,7 +11052,7 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output_
|
|
|
11636
11052
|
*
|
|
11637
11053
|
* The usage is the combined usage of all steps.
|
|
11638
11054
|
*/
|
|
11639
|
-
onFinish?: StreamTextOnFinishCallback<TOOLS
|
|
11055
|
+
onFinish?: StreamTextOnFinishCallback<NoInfer<TOOLS>, NoInfer<OUTPUT>>;
|
|
11640
11056
|
onAbort?: StreamTextOnAbortCallback<TOOLS>;
|
|
11641
11057
|
/**
|
|
11642
11058
|
* Callback that is called when each step (LLM call) is finished, including intermediate steps.
|
|
@@ -11700,6 +11116,14 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output_
|
|
|
11700
11116
|
};
|
|
11701
11117
|
}): StreamTextResult<TOOLS, OUTPUT>;
|
|
11702
11118
|
|
|
11119
|
+
export declare type StreamTextEndEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = OnFinishEvent<TOOLS> & {
|
|
11120
|
+
/**
|
|
11121
|
+
* The parsed output when an output setting was provided and parsing
|
|
11122
|
+
* succeeded.
|
|
11123
|
+
*/
|
|
11124
|
+
readonly output?: InferGenerateOutput<OUTPUT>;
|
|
11125
|
+
};
|
|
11126
|
+
|
|
11703
11127
|
/**
|
|
11704
11128
|
* Include settings for streamText (requestBody only).
|
|
11705
11129
|
*/
|
|
@@ -11730,6 +11154,8 @@ export declare type StreamTextOnChunkCallback<TOOLS extends ToolSet> = (event: {
|
|
|
11730
11154
|
}>;
|
|
11731
11155
|
}) => PromiseLike<void> | void;
|
|
11732
11156
|
|
|
11157
|
+
export declare type StreamTextOnEndCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: StreamTextEndEvent<TOOLS, OUTPUT>) => PromiseLike<void> | void;
|
|
11158
|
+
|
|
11733
11159
|
/**
|
|
11734
11160
|
* Callback that is set using the `onError` option.
|
|
11735
11161
|
*
|
|
@@ -11744,7 +11170,7 @@ export declare type StreamTextOnErrorCallback = (event: {
|
|
|
11744
11170
|
*
|
|
11745
11171
|
* @param event - The event that is passed to the callback.
|
|
11746
11172
|
*/
|
|
11747
|
-
export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet
|
|
11173
|
+
export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = StreamTextOnEndCallback<TOOLS, OUTPUT>;
|
|
11748
11174
|
|
|
11749
11175
|
/**
|
|
11750
11176
|
* Callback that is set using the `experimental_onStart` option.
|
|
@@ -11755,7 +11181,7 @@ export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet> = (event:
|
|
|
11755
11181
|
*
|
|
11756
11182
|
* @param event - The event object containing generation configuration.
|
|
11757
11183
|
*/
|
|
11758
|
-
export declare type StreamTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
11184
|
+
export declare type StreamTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStartEvent<TOOLS, OUTPUT, StreamTextIncludeSettings>) => PromiseLike<void> | void;
|
|
11759
11185
|
|
|
11760
11186
|
/**
|
|
11761
11187
|
* Callback that is set using the `onStepFinish` option.
|
|
@@ -11773,7 +11199,7 @@ export declare type StreamTextOnStepFinishCallback<TOOLS extends ToolSet> = (eve
|
|
|
11773
11199
|
*
|
|
11774
11200
|
* @param event - The event object containing step configuration.
|
|
11775
11201
|
*/
|
|
11776
|
-
export declare type StreamTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
11202
|
+
export declare type StreamTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStepStartEvent<TOOLS, OUTPUT, StreamTextIncludeSettings>) => PromiseLike<void> | void;
|
|
11777
11203
|
|
|
11778
11204
|
export declare type StreamTextOnToolCallFinishCallback<TOOLS extends ToolSet = ToolSet> = (event: OnToolCallFinishEvent<TOOLS>) => PromiseLike<void> | void;
|
|
11779
11205
|
|
|
@@ -11782,7 +11208,7 @@ export declare type StreamTextOnToolCallStartCallback<TOOLS extends ToolSet = To
|
|
|
11782
11208
|
/**
|
|
11783
11209
|
* A result object for accessing different stream types and additional information.
|
|
11784
11210
|
*/
|
|
11785
|
-
export declare interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends
|
|
11211
|
+
export declare interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends OutputInterface> {
|
|
11786
11212
|
/**
|
|
11787
11213
|
* The content that was generated in the last step.
|
|
11788
11214
|
*
|
|
@@ -12023,8 +11449,6 @@ declare const symbol$1: unique symbol;
|
|
|
12023
11449
|
|
|
12024
11450
|
declare const symbol$1_2: unique symbol;
|
|
12025
11451
|
|
|
12026
|
-
declare const symbol$1_3: unique symbol;
|
|
12027
|
-
|
|
12028
11452
|
declare const symbol$2: unique symbol;
|
|
12029
11453
|
|
|
12030
11454
|
declare const symbol$2_2: unique symbol;
|
|
@@ -12049,8 +11473,6 @@ declare const symbol$7: unique symbol;
|
|
|
12049
11473
|
|
|
12050
11474
|
declare const symbol$7_2: unique symbol;
|
|
12051
11475
|
|
|
12052
|
-
declare const symbol$7_3: unique symbol;
|
|
12053
|
-
|
|
12054
11476
|
declare const symbol$8: unique symbol;
|
|
12055
11477
|
|
|
12056
11478
|
declare const symbol$8_2: unique symbol;
|
|
@@ -12069,14 +11491,10 @@ declare const symbol$c: unique symbol;
|
|
|
12069
11491
|
|
|
12070
11492
|
declare const symbol$c_2: unique symbol;
|
|
12071
11493
|
|
|
12072
|
-
declare const symbol$c_3: unique symbol;
|
|
12073
|
-
|
|
12074
11494
|
declare const symbol$d: unique symbol;
|
|
12075
11495
|
|
|
12076
11496
|
declare const symbol$d_2: unique symbol;
|
|
12077
11497
|
|
|
12078
|
-
declare const symbol$d_3: unique symbol;
|
|
12079
|
-
|
|
12080
11498
|
declare const symbol$e: unique symbol;
|
|
12081
11499
|
|
|
12082
11500
|
declare const symbol$f: unique symbol;
|
|
@@ -12091,6 +11509,8 @@ declare const symbol$j: unique symbol;
|
|
|
12091
11509
|
|
|
12092
11510
|
declare const symbol$k: unique symbol;
|
|
12093
11511
|
|
|
11512
|
+
declare const symbol$l: unique symbol;
|
|
11513
|
+
|
|
12094
11514
|
declare const symbol: unique symbol;
|
|
12095
11515
|
|
|
12096
11516
|
declare const symbol_2: unique symbol;
|
|
@@ -12117,13 +11537,260 @@ export declare type SystemModelMessage = {
|
|
|
12117
11537
|
|
|
12118
11538
|
export declare const systemModelMessageSchema: z.ZodType<SystemModelMessage>;
|
|
12119
11539
|
|
|
11540
|
+
declare interface TakoCard {
|
|
11541
|
+
card_id?: string | null;
|
|
11542
|
+
title?: string | null;
|
|
11543
|
+
description?: string | null;
|
|
11544
|
+
semantic_description?: string | null;
|
|
11545
|
+
webpage_url?: string | null;
|
|
11546
|
+
image_url?: string | null;
|
|
11547
|
+
embed_url?: string | null;
|
|
11548
|
+
sources?: Array<{
|
|
11549
|
+
source_name?: string | null;
|
|
11550
|
+
source_description?: string | null;
|
|
11551
|
+
source_index: 'data' | 'web';
|
|
11552
|
+
source_text?: string | null;
|
|
11553
|
+
url?: string | null;
|
|
11554
|
+
}> | null;
|
|
11555
|
+
methodologies?: Array<{
|
|
11556
|
+
methodology_name: string | null;
|
|
11557
|
+
methodology_description: string | null;
|
|
11558
|
+
}> | null;
|
|
11559
|
+
source_indexes?: Array<'data' | 'web'> | null;
|
|
11560
|
+
card_type?: string | null;
|
|
11561
|
+
relevance?: 'High' | 'Low' | 'Medium' | null;
|
|
11562
|
+
content?: TakoResultContent | null;
|
|
11563
|
+
exportable?: boolean;
|
|
11564
|
+
nodes?: Array<{
|
|
11565
|
+
id: string;
|
|
11566
|
+
type: 'entity' | 'metric';
|
|
11567
|
+
name: string;
|
|
11568
|
+
description?: string | null;
|
|
11569
|
+
}> | null;
|
|
11570
|
+
metric_definitions?: Array<{
|
|
11571
|
+
name: string;
|
|
11572
|
+
definition: string;
|
|
11573
|
+
}> | null;
|
|
11574
|
+
data_freshness?: {
|
|
11575
|
+
coverage_end?: string | null;
|
|
11576
|
+
data_as_of?: string | null;
|
|
11577
|
+
last_updated?: string | null;
|
|
11578
|
+
} | null;
|
|
11579
|
+
}
|
|
11580
|
+
|
|
11581
|
+
declare type TakoContentFormat = 'card_json' | 'csv' | 'json_compact' | 'json_records';
|
|
11582
|
+
|
|
11583
|
+
declare type TakoDatasetCell = boolean | number | string | null;
|
|
11584
|
+
|
|
11585
|
+
declare interface TakoDataSourceConfig {
|
|
11586
|
+
/**
|
|
11587
|
+
* Maximum number of data results to return (1-20). When includeContents is
|
|
11588
|
+
* true, each additional result adds its own data surcharge.
|
|
11589
|
+
*/
|
|
11590
|
+
count?: number;
|
|
11591
|
+
/**
|
|
11592
|
+
* Inline rows for each data result. This adds a data surcharge based on row
|
|
11593
|
+
* count and dataset source. To estimate cost, search with includeContents
|
|
11594
|
+
* disabled and inspect cards.content.export_pricing. This applies to every
|
|
11595
|
+
* returned card; limit sources.data.count and sources.data.maxRows to control
|
|
11596
|
+
* cost.
|
|
11597
|
+
*/
|
|
11598
|
+
includeContents?: boolean;
|
|
11599
|
+
/** Requested delivery mode for card data. Search cards are always inlined. */
|
|
11600
|
+
mode?: 'inline' | 'url';
|
|
11601
|
+
/** Serialization for inlined card data. */
|
|
11602
|
+
contentFormat?: TakoContentFormat;
|
|
11603
|
+
/**
|
|
11604
|
+
* Maximum rows to inline per result. Omit to use the allowance in
|
|
11605
|
+
* cards.content.export_pricing. A data surcharge applies per 1,000 exported
|
|
11606
|
+
* rows; lower values reduce cost.
|
|
11607
|
+
*/
|
|
11608
|
+
maxRows?: number;
|
|
11609
|
+
/** Data Graph node IDs to prioritize. */
|
|
11610
|
+
nodeIds?: string[];
|
|
11611
|
+
/** Return only cards matching nodeIds. Requires at least one node ID. */
|
|
11612
|
+
strict?: boolean;
|
|
11613
|
+
}
|
|
11614
|
+
|
|
11615
|
+
declare interface TakoResultContent {
|
|
11616
|
+
content_format?: TakoContentFormat | null;
|
|
11617
|
+
cost?: number;
|
|
11618
|
+
data?: string | null;
|
|
11619
|
+
records?: Array<Record<string, TakoDatasetCell>> | null;
|
|
11620
|
+
dataset?: {
|
|
11621
|
+
columns: Array<{
|
|
11622
|
+
name: string;
|
|
11623
|
+
type: 'boolean' | 'date' | 'datetime' | 'number' | 'string';
|
|
11624
|
+
unit?: string | null;
|
|
11625
|
+
}>;
|
|
11626
|
+
rows: TakoDatasetCell[][];
|
|
11627
|
+
total_rows: number;
|
|
11628
|
+
truncated: boolean;
|
|
11629
|
+
ref: string;
|
|
11630
|
+
sources: Array<{
|
|
11631
|
+
name: string;
|
|
11632
|
+
index?: 'data' | 'web';
|
|
11633
|
+
}>;
|
|
11634
|
+
provenance?: 'query' | 'web_extraction';
|
|
11635
|
+
} | null;
|
|
11636
|
+
card_data?: Record<string, unknown> | null;
|
|
11637
|
+
card_data_schema?: Record<string, unknown> | null;
|
|
11638
|
+
url?: string | null;
|
|
11639
|
+
expires_at?: string | null;
|
|
11640
|
+
total_rows?: number | null;
|
|
11641
|
+
truncated?: boolean;
|
|
11642
|
+
export_pricing?: {
|
|
11643
|
+
baseline_usd: number;
|
|
11644
|
+
free_rows: number;
|
|
11645
|
+
max_rows_ceiling: number;
|
|
11646
|
+
row_cpm_usd: number;
|
|
11647
|
+
} | null;
|
|
11648
|
+
manifest?: Array<{
|
|
11649
|
+
dtype?: 'boolean' | 'date' | 'datetime' | 'number' | 'string' | null;
|
|
11650
|
+
entity?: string | null;
|
|
11651
|
+
metric?: string | null;
|
|
11652
|
+
name?: string | null;
|
|
11653
|
+
unit?: string | null;
|
|
11654
|
+
}> | null;
|
|
11655
|
+
}
|
|
11656
|
+
|
|
11657
|
+
declare interface TakoSearchConfig {
|
|
11658
|
+
/** Search effort. fast is the default balanced option. */
|
|
11659
|
+
effort?: TakoSearchEffort;
|
|
11660
|
+
/** Sources to search. Omit to search both curated data and the web. */
|
|
11661
|
+
sources?: {
|
|
11662
|
+
data?: TakoDataSourceConfig;
|
|
11663
|
+
web?: TakoWebSourceConfig;
|
|
11664
|
+
};
|
|
11665
|
+
/** End-user coordinates for localized results. */
|
|
11666
|
+
location?: {
|
|
11667
|
+
latitude: number;
|
|
11668
|
+
longitude: number;
|
|
11669
|
+
};
|
|
11670
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
11671
|
+
countryCode?: string;
|
|
11672
|
+
/** BCP-47 locale. */
|
|
11673
|
+
locale?: string;
|
|
11674
|
+
/** IANA timezone. */
|
|
11675
|
+
timezone?: string;
|
|
11676
|
+
/** Settings that control card rendering. */
|
|
11677
|
+
outputSettings?: {
|
|
11678
|
+
imageDarkMode?: boolean;
|
|
11679
|
+
/** Instant-effort only. */
|
|
11680
|
+
forceRefresh?: boolean;
|
|
11681
|
+
};
|
|
11682
|
+
/** Maximum related search suggestions to include (1-20). */
|
|
11683
|
+
includeRelated?: number;
|
|
11684
|
+
}
|
|
11685
|
+
|
|
11686
|
+
declare type TakoSearchEffort = 'deep' | 'fast' | 'instant';
|
|
11687
|
+
|
|
11688
|
+
declare interface TakoSearchError {
|
|
11689
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown_tool';
|
|
11690
|
+
statusCode?: number;
|
|
11691
|
+
message: string;
|
|
11692
|
+
}
|
|
11693
|
+
|
|
11694
|
+
declare interface TakoSearchInput {
|
|
11695
|
+
query: string;
|
|
11696
|
+
effort?: TakoSearchEffort;
|
|
11697
|
+
sources?: {
|
|
11698
|
+
data?: {
|
|
11699
|
+
count?: number;
|
|
11700
|
+
include_contents?: boolean;
|
|
11701
|
+
mode?: 'inline' | 'url';
|
|
11702
|
+
content_format?: TakoContentFormat;
|
|
11703
|
+
max_rows?: number;
|
|
11704
|
+
node_ids?: string[];
|
|
11705
|
+
strict?: boolean;
|
|
11706
|
+
};
|
|
11707
|
+
web?: {
|
|
11708
|
+
count?: number;
|
|
11709
|
+
include_contents?: boolean;
|
|
11710
|
+
category?: 'finance' | 'news' | 'sports';
|
|
11711
|
+
include_domains?: string[];
|
|
11712
|
+
exclude_domains?: string[];
|
|
11713
|
+
snippet_max_chars?: number;
|
|
11714
|
+
highlights?: boolean;
|
|
11715
|
+
article_content_max_chars?: number;
|
|
11716
|
+
published_after?: string;
|
|
11717
|
+
published_before?: string;
|
|
11718
|
+
};
|
|
11719
|
+
};
|
|
11720
|
+
location?: {
|
|
11721
|
+
latitude: number;
|
|
11722
|
+
longitude: number;
|
|
11723
|
+
};
|
|
11724
|
+
country_code?: string;
|
|
11725
|
+
locale?: string;
|
|
11726
|
+
timezone?: string;
|
|
11727
|
+
output_settings?: {
|
|
11728
|
+
image_dark_mode?: boolean;
|
|
11729
|
+
force_refresh?: boolean;
|
|
11730
|
+
};
|
|
11731
|
+
include_related?: number;
|
|
11732
|
+
}
|
|
11733
|
+
|
|
11734
|
+
declare type TakoSearchOutput = TakoSearchError | TakoSearchResponse;
|
|
11735
|
+
|
|
11736
|
+
declare interface TakoSearchResponse {
|
|
11737
|
+
request_id: string;
|
|
11738
|
+
cards?: TakoCard[];
|
|
11739
|
+
web_results?: TakoWebResult[];
|
|
11740
|
+
usage?: {
|
|
11741
|
+
total_cost_usd: number;
|
|
11742
|
+
compute?: {
|
|
11743
|
+
cost_usd: number;
|
|
11744
|
+
} | null;
|
|
11745
|
+
data?: {
|
|
11746
|
+
cost_usd: number;
|
|
11747
|
+
datasets: number;
|
|
11748
|
+
} | null;
|
|
11749
|
+
} | null;
|
|
11750
|
+
related?: Array<Record<string, unknown>> | null;
|
|
11751
|
+
}
|
|
11752
|
+
|
|
11753
|
+
declare const takoSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<TakoSearchInput, TakoSearchOutput, TakoSearchConfig>;
|
|
11754
|
+
|
|
11755
|
+
declare interface TakoWebResult {
|
|
11756
|
+
title: string;
|
|
11757
|
+
url: string;
|
|
11758
|
+
snippet?: string | null;
|
|
11759
|
+
source_name?: string | null;
|
|
11760
|
+
publish_date?: string | null;
|
|
11761
|
+
content?: TakoResultContent | null;
|
|
11762
|
+
}
|
|
11763
|
+
|
|
11764
|
+
declare interface TakoWebSourceConfig {
|
|
11765
|
+
/** Maximum number of web results to return (1-20). */
|
|
11766
|
+
count?: number;
|
|
11767
|
+
/** Inline extracted web page text. This can add a data charge. */
|
|
11768
|
+
includeContents?: boolean;
|
|
11769
|
+
/** Optional web-result category filter. */
|
|
11770
|
+
category?: 'finance' | 'news' | 'sports';
|
|
11771
|
+
/** Only return results from these bare domains. */
|
|
11772
|
+
includeDomains?: string[];
|
|
11773
|
+
/** Exclude results from these bare domains. */
|
|
11774
|
+
excludeDomains?: string[];
|
|
11775
|
+
/** Maximum characters in each web-result snippet. */
|
|
11776
|
+
snippetMaxChars?: number;
|
|
11777
|
+
/** Include highlighted passages in web results. Defaults to true in AI Gateway. */
|
|
11778
|
+
highlights?: boolean;
|
|
11779
|
+
/** Maximum extracted characters per web page when including contents. */
|
|
11780
|
+
articleContentMaxChars?: number;
|
|
11781
|
+
/** Keep results published on or after this ISO date. */
|
|
11782
|
+
publishedAfter?: string;
|
|
11783
|
+
/** Keep results published on or before this ISO date. */
|
|
11784
|
+
publishedBefore?: string;
|
|
11785
|
+
}
|
|
11786
|
+
|
|
12120
11787
|
/**
|
|
12121
11788
|
* Implement this interface to create custom telemetry integrations.
|
|
12122
11789
|
* Methods can be sync or return a PromiseLike.
|
|
12123
11790
|
*/
|
|
12124
11791
|
export declare interface TelemetryIntegration {
|
|
12125
|
-
onStart?: Listener<OnStartEvent<ToolSet,
|
|
12126
|
-
onStepStart?: Listener<OnStepStartEvent<ToolSet,
|
|
11792
|
+
onStart?: Listener<OnStartEvent<ToolSet, OutputInterface>>;
|
|
11793
|
+
onStepStart?: Listener<OnStepStartEvent<ToolSet, OutputInterface>>;
|
|
12127
11794
|
onToolCallStart?: Listener<OnToolCallStartEvent<ToolSet>>;
|
|
12128
11795
|
onToolCallFinish?: Listener<OnToolCallFinishEvent<ToolSet>>;
|
|
12129
11796
|
onStepFinish?: Listener<OnStepFinishEvent<ToolSet>>;
|
|
@@ -12225,6 +11892,8 @@ export declare type TextStreamPart<TOOLS extends ToolSet> = {
|
|
|
12225
11892
|
type: 'tool-input-start';
|
|
12226
11893
|
id: string;
|
|
12227
11894
|
toolName: string;
|
|
11895
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
11896
|
+
inputEncoding?: 'json' | 'text';
|
|
12228
11897
|
providerMetadata?: ProviderMetadata;
|
|
12229
11898
|
toolMetadata?: JSONObject;
|
|
12230
11899
|
providerExecuted?: boolean;
|
|
@@ -12329,7 +11998,7 @@ export declare type TimeoutConfiguration = number | {
|
|
|
12329
11998
|
*
|
|
12330
11999
|
* The tool can also contain an optional execute function for the actual execution function of the tool.
|
|
12331
12000
|
*/
|
|
12332
|
-
export declare type Tool<INPUT extends
|
|
12001
|
+
export declare type Tool<INPUT extends JSONValue_2 | unknown | never = any, OUTPUT extends JSONValue_2 | unknown | never = any> = {
|
|
12333
12002
|
/**
|
|
12334
12003
|
* An optional description of what the tool does.
|
|
12335
12004
|
* Will be used by the language model to decide whether to use the tool.
|
|
@@ -12355,7 +12024,7 @@ export declare type Tool<INPUT extends JSONValue_3 | unknown | never = any, OUTP
|
|
|
12355
12024
|
* and UI message parts. This is useful for sources of dynamic tools (e.g.
|
|
12356
12025
|
* an MCP server) to identify themselves.
|
|
12357
12026
|
*/
|
|
12358
|
-
metadata?:
|
|
12027
|
+
metadata?: JSONObject;
|
|
12359
12028
|
/**
|
|
12360
12029
|
* The schema of the input that the tool expects.
|
|
12361
12030
|
* The language model will use this to generate the input.
|
|
@@ -12538,6 +12207,13 @@ export declare type ToolApprovalResponse = {
|
|
|
12538
12207
|
approved: boolean;
|
|
12539
12208
|
/**
|
|
12540
12209
|
* Optional reason for the approval or denial.
|
|
12210
|
+
*
|
|
12211
|
+
* For denied tool calls, the reason is included in the `execution-denied`
|
|
12212
|
+
* tool result that is sent to the model. For approved tool calls that are
|
|
12213
|
+
* executed by the SDK, the reason remains in the message history: it is not
|
|
12214
|
+
* included in the model prompt and is not exposed through a dedicated tool
|
|
12215
|
+
* execution option. For provider-executed tools, the approval response
|
|
12216
|
+
* (including the reason) is forwarded to the provider.
|
|
12541
12217
|
*/
|
|
12542
12218
|
reason?: string;
|
|
12543
12219
|
/**
|
|
@@ -12576,7 +12252,7 @@ declare interface ToolCall<NAME extends string, INPUT> {
|
|
|
12576
12252
|
}
|
|
12577
12253
|
|
|
12578
12254
|
export declare class ToolCallNotFoundForApprovalError extends AISDKError {
|
|
12579
|
-
private readonly [symbol$
|
|
12255
|
+
private readonly [symbol$f];
|
|
12580
12256
|
readonly toolCallId: string;
|
|
12581
12257
|
readonly approvalId: string;
|
|
12582
12258
|
constructor({ toolCallId, approvalId, }: {
|
|
@@ -12668,6 +12344,45 @@ export declare type ToolChoice<TOOLS extends Record<string, unknown>> = 'auto' |
|
|
|
12668
12344
|
toolName: Extract<keyof TOOLS, string>;
|
|
12669
12345
|
};
|
|
12670
12346
|
|
|
12347
|
+
/**
|
|
12348
|
+
* Thrown when a model response does not satisfy an enforced tool choice.
|
|
12349
|
+
*/
|
|
12350
|
+
export declare class ToolChoiceViolationError extends AISDKError {
|
|
12351
|
+
private readonly [symbol$7_2];
|
|
12352
|
+
/**
|
|
12353
|
+
* The tool choice that the model response did not satisfy.
|
|
12354
|
+
*/
|
|
12355
|
+
readonly toolChoice: EnforcedToolChoice;
|
|
12356
|
+
/**
|
|
12357
|
+
* Reason why the model finished generating the response.
|
|
12358
|
+
*/
|
|
12359
|
+
readonly finishReason: FinishReason;
|
|
12360
|
+
/**
|
|
12361
|
+
* The provider that returned the response.
|
|
12362
|
+
*/
|
|
12363
|
+
readonly provider: string;
|
|
12364
|
+
/**
|
|
12365
|
+
* The model that returned the response.
|
|
12366
|
+
*/
|
|
12367
|
+
readonly modelId: string;
|
|
12368
|
+
/**
|
|
12369
|
+
* The normalized content returned by the model.
|
|
12370
|
+
*
|
|
12371
|
+
* This can be inspected to recover a tool call that the provider returned as
|
|
12372
|
+
* text or reasoning instead of a structured tool call.
|
|
12373
|
+
*/
|
|
12374
|
+
readonly content: Array<LanguageModelV3Content>;
|
|
12375
|
+
constructor({ toolChoice, finishReason, provider, modelId, content, message, }: {
|
|
12376
|
+
toolChoice: EnforcedToolChoice;
|
|
12377
|
+
finishReason: FinishReason;
|
|
12378
|
+
provider: string;
|
|
12379
|
+
modelId: string;
|
|
12380
|
+
content: Array<LanguageModelV3Content>;
|
|
12381
|
+
message?: string;
|
|
12382
|
+
});
|
|
12383
|
+
static isInstance(error: unknown): error is ToolChoiceViolationError;
|
|
12384
|
+
}
|
|
12385
|
+
|
|
12671
12386
|
/**
|
|
12672
12387
|
* Content of a tool message. It is an array of tool result parts.
|
|
12673
12388
|
*/
|
|
@@ -12718,7 +12433,7 @@ export declare interface ToolExecutionOptions {
|
|
|
12718
12433
|
* - A tool call needs approval, or
|
|
12719
12434
|
* - A stop condition is met (default stop condition is stepCountIs(20))
|
|
12720
12435
|
*/
|
|
12721
|
-
declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
12436
|
+
declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> implements Agent<CALL_OPTIONS, TOOLS, OUTPUT> {
|
|
12722
12437
|
readonly version = "agent-v1";
|
|
12723
12438
|
private readonly settings;
|
|
12724
12439
|
constructor(settings: ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>);
|
|
@@ -12751,7 +12466,7 @@ export declare type ToolLoopAgentOnStepFinishCallback<TOOLS extends ToolSet = {}
|
|
|
12751
12466
|
/**
|
|
12752
12467
|
* Configuration options for an agent.
|
|
12753
12468
|
*/
|
|
12754
|
-
declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
12469
|
+
declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> = Omit<CallSettings, 'abortSignal'> & {
|
|
12755
12470
|
/**
|
|
12756
12471
|
* The id of the agent.
|
|
12757
12472
|
*/
|
|
@@ -12819,6 +12534,12 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
12819
12534
|
* Callback that is called when all steps are finished and the response is complete.
|
|
12820
12535
|
*/
|
|
12821
12536
|
onFinish?: ToolLoopAgentOnFinishCallback<NoInfer<TOOLS>>;
|
|
12537
|
+
/**
|
|
12538
|
+
* Secret for HMAC-signing tool approval requests. When set, the server
|
|
12539
|
+
* signs each approval request at issuance and verifies the signature when
|
|
12540
|
+
* the approval is replayed, preventing client-forged approvals.
|
|
12541
|
+
*/
|
|
12542
|
+
experimental_toolApprovalSecret?: string | Uint8Array;
|
|
12822
12543
|
/**
|
|
12823
12544
|
* Additional provider-specific options. They are passed through
|
|
12824
12545
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -12858,7 +12579,7 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
12858
12579
|
* }),
|
|
12859
12580
|
* ```
|
|
12860
12581
|
*/
|
|
12861
|
-
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'providerOptions' | 'experimental_context' | 'experimental_download'> & Omit<Prompt, 'system'>>;
|
|
12582
|
+
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'timeout' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'> & Omit<Prompt, 'system'>>;
|
|
12862
12583
|
};
|
|
12863
12584
|
export { ToolLoopAgentSettings as Experimental_AgentSettings }
|
|
12864
12585
|
export { ToolLoopAgentSettings }
|
|
@@ -12983,7 +12704,7 @@ declare type ToolResultOutput = {
|
|
|
12983
12704
|
providerOptions?: ProviderOptions;
|
|
12984
12705
|
} | {
|
|
12985
12706
|
type: 'json';
|
|
12986
|
-
value:
|
|
12707
|
+
value: JSONValue_2;
|
|
12987
12708
|
/**
|
|
12988
12709
|
* Provider-specific options.
|
|
12989
12710
|
*/
|
|
@@ -13010,7 +12731,7 @@ declare type ToolResultOutput = {
|
|
|
13010
12731
|
providerOptions?: ProviderOptions;
|
|
13011
12732
|
} | {
|
|
13012
12733
|
type: 'error-json';
|
|
13013
|
-
value:
|
|
12734
|
+
value: JSONValue_2;
|
|
13014
12735
|
/**
|
|
13015
12736
|
* Provider-specific options.
|
|
13016
12737
|
*/
|
|
@@ -13643,21 +13364,6 @@ declare interface TypeValidationContext {
|
|
|
13643
13364
|
entityId?: string;
|
|
13644
13365
|
}
|
|
13645
13366
|
|
|
13646
|
-
declare interface TypeValidationContext_2 {
|
|
13647
|
-
/**
|
|
13648
|
-
* Field path in dot notation (e.g., "message.metadata", "message.parts[3].data")
|
|
13649
|
-
*/
|
|
13650
|
-
field?: string;
|
|
13651
|
-
/**
|
|
13652
|
-
* Entity name (e.g., tool name, data type name)
|
|
13653
|
-
*/
|
|
13654
|
-
entityName?: string;
|
|
13655
|
-
/**
|
|
13656
|
-
* Entity identifier (e.g., message ID, tool call ID)
|
|
13657
|
-
*/
|
|
13658
|
-
entityId?: string;
|
|
13659
|
-
}
|
|
13660
|
-
|
|
13661
13367
|
export declare class TypeValidationError extends AISDKError {
|
|
13662
13368
|
private readonly [symbol$1];
|
|
13663
13369
|
readonly value: unknown;
|
|
@@ -13686,34 +13392,6 @@ export declare class TypeValidationError extends AISDKError {
|
|
|
13686
13392
|
}): TypeValidationError;
|
|
13687
13393
|
}
|
|
13688
13394
|
|
|
13689
|
-
declare class TypeValidationError_2 extends AISDKError_2 {
|
|
13690
|
-
private readonly [symbol$1_2];
|
|
13691
|
-
readonly value: unknown;
|
|
13692
|
-
readonly context?: TypeValidationContext_2;
|
|
13693
|
-
constructor({ value, cause, context, }: {
|
|
13694
|
-
value: unknown;
|
|
13695
|
-
cause: unknown;
|
|
13696
|
-
context?: TypeValidationContext_2;
|
|
13697
|
-
});
|
|
13698
|
-
static isInstance(error: unknown): error is TypeValidationError_2;
|
|
13699
|
-
/**
|
|
13700
|
-
* Wraps an error into a TypeValidationError.
|
|
13701
|
-
* If the cause is already a TypeValidationError with the same value and context, it returns the cause.
|
|
13702
|
-
* Otherwise, it creates a new TypeValidationError.
|
|
13703
|
-
*
|
|
13704
|
-
* @param {Object} params - The parameters for wrapping the error.
|
|
13705
|
-
* @param {unknown} params.value - The value that failed validation.
|
|
13706
|
-
* @param {unknown} params.cause - The original error or cause of the validation failure.
|
|
13707
|
-
* @param {TypeValidationContext} params.context - Optional context about what is being validated.
|
|
13708
|
-
* @returns {TypeValidationError} A TypeValidationError instance.
|
|
13709
|
-
*/
|
|
13710
|
-
static wrap({ value, cause, context, }: {
|
|
13711
|
-
value: unknown;
|
|
13712
|
-
cause: unknown;
|
|
13713
|
-
context?: TypeValidationContext_2;
|
|
13714
|
-
}): TypeValidationError_2;
|
|
13715
|
-
}
|
|
13716
|
-
|
|
13717
13395
|
export declare const UI_MESSAGE_STREAM_HEADERS: {
|
|
13718
13396
|
'content-type': string;
|
|
13719
13397
|
'cache-control': string;
|
|
@@ -13816,6 +13494,8 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
13816
13494
|
type: 'tool-approval-request';
|
|
13817
13495
|
approvalId: string;
|
|
13818
13496
|
toolCallId: string;
|
|
13497
|
+
approvalDescriptor?: unknown;
|
|
13498
|
+
inputSchemaInput?: unknown;
|
|
13819
13499
|
signature?: string;
|
|
13820
13500
|
} | {
|
|
13821
13501
|
type: 'tool-output-available';
|
|
@@ -13841,6 +13521,8 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
13841
13521
|
type: 'tool-input-start';
|
|
13842
13522
|
toolCallId: string;
|
|
13843
13523
|
toolName: string;
|
|
13524
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
13525
|
+
inputEncoding?: 'json' | 'text';
|
|
13844
13526
|
providerExecuted?: boolean;
|
|
13845
13527
|
providerMetadata?: ProviderMetadata;
|
|
13846
13528
|
toolMetadata?: JSONObject;
|
|
@@ -13934,6 +13616,11 @@ export declare type UIMessageStreamOnFinishCallback<UI_MESSAGE extends UIMessage
|
|
|
13934
13616
|
* Indicates whether the stream was aborted.
|
|
13935
13617
|
*/
|
|
13936
13618
|
isAborted: boolean;
|
|
13619
|
+
/**
|
|
13620
|
+
* The operation-level outcome of the stream. Fatal stream-processing
|
|
13621
|
+
* failures override outcomes declared by the stream owner.
|
|
13622
|
+
*/
|
|
13623
|
+
outcome: UIMessageStreamOutcome;
|
|
13937
13624
|
/**
|
|
13938
13625
|
* The message that was sent to the client as a response
|
|
13939
13626
|
* (including the original message if it was extended).
|
|
@@ -14015,16 +13702,45 @@ export declare type UIMessageStreamOptions<UI_MESSAGE extends UIMessage> = {
|
|
|
14015
13702
|
/**
|
|
14016
13703
|
* Process an error, e.g. to log it. Default to `() => 'An error occurred.'`.
|
|
14017
13704
|
*
|
|
13705
|
+
* Tool execution errors marked `providerExecuted: true` bypass this callback.
|
|
13706
|
+
* Their strings pass through unchanged; other values are JSON-stringified to
|
|
13707
|
+
* preserve provider error data for model-message round trips. Stream errors
|
|
13708
|
+
* and invalid tool calls still use it.
|
|
13709
|
+
*
|
|
14018
13710
|
* @returns error message to include in the data stream.
|
|
14019
13711
|
*/
|
|
14020
13712
|
onError?: (error: unknown) => string;
|
|
14021
13713
|
};
|
|
14022
13714
|
|
|
13715
|
+
/**
|
|
13716
|
+
* The operation-level outcome of a UI message stream.
|
|
13717
|
+
*
|
|
13718
|
+
* This is separate from model finish reasons and individual stream chunks.
|
|
13719
|
+
* Fatal stream-processing failures override outcomes declared by the stream
|
|
13720
|
+
* owner.
|
|
13721
|
+
*/
|
|
13722
|
+
export declare type UIMessageStreamOutcome = {
|
|
13723
|
+
status: 'completed';
|
|
13724
|
+
} | {
|
|
13725
|
+
status: 'failed';
|
|
13726
|
+
error?: unknown;
|
|
13727
|
+
} | {
|
|
13728
|
+
status: 'aborted';
|
|
13729
|
+
} | {
|
|
13730
|
+
status: 'unknown';
|
|
13731
|
+
};
|
|
13732
|
+
|
|
14023
13733
|
/**
|
|
14024
13734
|
* Options for creating a UI message stream response.
|
|
14025
13735
|
* Extends the standard `ResponseInit` with additional streaming options.
|
|
14026
13736
|
*/
|
|
14027
13737
|
declare type UIMessageStreamResponseInit = ResponseInit & {
|
|
13738
|
+
/**
|
|
13739
|
+
* Optional interval in milliseconds for sending SSE keep-alive comments.
|
|
13740
|
+
* When set, an opening comment is sent immediately and additional comments
|
|
13741
|
+
* are sent after the stream has been idle for the configured interval.
|
|
13742
|
+
*/
|
|
13743
|
+
keepAliveMs?: number;
|
|
14028
13744
|
/**
|
|
14029
13745
|
* Optional callback to consume a copy of the SSE stream independently.
|
|
14030
13746
|
* This is useful for logging, debugging, or processing the stream in parallel.
|
|
@@ -14052,6 +13768,18 @@ export declare interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UI
|
|
|
14052
13768
|
onError: ErrorHandler | undefined;
|
|
14053
13769
|
}
|
|
14054
13770
|
|
|
13771
|
+
export declare interface UIMessageStreamWriterWithOutcome<UI_MESSAGE extends UIMessage = UIMessage> extends UIMessageStreamWriter<UI_MESSAGE> {
|
|
13772
|
+
/**
|
|
13773
|
+
* Declares the operation-level outcome of the composed stream.
|
|
13774
|
+
*
|
|
13775
|
+
* The first outcome declared through this method is retained. Fatal
|
|
13776
|
+
* execution, merge, error-handling, or downstream processing failures
|
|
13777
|
+
* override declared outcomes. Declaring an outcome does not write a chunk or
|
|
13778
|
+
* close the stream.
|
|
13779
|
+
*/
|
|
13780
|
+
setOutcome(outcome: UIMessageStreamOutcome): void;
|
|
13781
|
+
}
|
|
13782
|
+
|
|
14055
13783
|
export declare type UITool = {
|
|
14056
13784
|
input: unknown;
|
|
14057
13785
|
output: unknown | undefined;
|
|
@@ -14076,6 +13804,15 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14076
13804
|
} & ({
|
|
14077
13805
|
state: 'input-streaming';
|
|
14078
13806
|
input?: DeepPartial<asUITool<TOOL>['input']> | undefined;
|
|
13807
|
+
/**
|
|
13808
|
+
* The raw tool input text received so far.
|
|
13809
|
+
*
|
|
13810
|
+
* This is used to continue input streaming when a message is persisted
|
|
13811
|
+
* and later resumed.
|
|
13812
|
+
*/
|
|
13813
|
+
rawInput?: string;
|
|
13814
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
13815
|
+
inputEncoding?: 'json' | 'text';
|
|
14079
13816
|
output?: never;
|
|
14080
13817
|
errorText?: never;
|
|
14081
13818
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -14096,8 +13833,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14096
13833
|
approval: {
|
|
14097
13834
|
id: string;
|
|
14098
13835
|
approved?: never;
|
|
13836
|
+
descriptor?: unknown;
|
|
14099
13837
|
reason?: never;
|
|
14100
13838
|
signature?: string;
|
|
13839
|
+
inputSchemaInput?: unknown;
|
|
14101
13840
|
};
|
|
14102
13841
|
} | {
|
|
14103
13842
|
state: 'approval-responded';
|
|
@@ -14108,8 +13847,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14108
13847
|
approval: {
|
|
14109
13848
|
id: string;
|
|
14110
13849
|
approved: boolean;
|
|
13850
|
+
descriptor?: unknown;
|
|
14111
13851
|
reason?: string;
|
|
14112
13852
|
signature?: string;
|
|
13853
|
+
inputSchemaInput?: unknown;
|
|
14113
13854
|
};
|
|
14114
13855
|
} | {
|
|
14115
13856
|
state: 'output-available';
|
|
@@ -14122,8 +13863,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14122
13863
|
approval?: {
|
|
14123
13864
|
id: string;
|
|
14124
13865
|
approved: true;
|
|
13866
|
+
descriptor?: unknown;
|
|
14125
13867
|
reason?: string;
|
|
14126
13868
|
signature?: string;
|
|
13869
|
+
inputSchemaInput?: unknown;
|
|
14127
13870
|
};
|
|
14128
13871
|
} | {
|
|
14129
13872
|
state: 'output-error';
|
|
@@ -14136,8 +13879,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14136
13879
|
approval?: {
|
|
14137
13880
|
id: string;
|
|
14138
13881
|
approved: true;
|
|
13882
|
+
descriptor?: unknown;
|
|
14139
13883
|
reason?: string;
|
|
14140
13884
|
signature?: string;
|
|
13885
|
+
inputSchemaInput?: unknown;
|
|
14141
13886
|
};
|
|
14142
13887
|
} | {
|
|
14143
13888
|
state: 'output-denied';
|
|
@@ -14148,8 +13893,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
14148
13893
|
approval: {
|
|
14149
13894
|
id: string;
|
|
14150
13895
|
approved: false;
|
|
13896
|
+
descriptor?: unknown;
|
|
14151
13897
|
reason?: string;
|
|
14152
13898
|
signature?: string;
|
|
13899
|
+
inputSchemaInput?: unknown;
|
|
14153
13900
|
};
|
|
14154
13901
|
});
|
|
14155
13902
|
|
|
@@ -14287,7 +14034,7 @@ declare function validateDownloadUrl(url: string): void;
|
|
|
14287
14034
|
declare function validateTypes<OBJECT>({ value, schema, context, }: {
|
|
14288
14035
|
value: unknown;
|
|
14289
14036
|
schema: FlexibleSchema<OBJECT>;
|
|
14290
|
-
context?:
|
|
14037
|
+
context?: TypeValidationContext;
|
|
14291
14038
|
}): Promise<OBJECT>;
|
|
14292
14039
|
|
|
14293
14040
|
/**
|
|
@@ -14297,7 +14044,9 @@ declare function validateTypes<OBJECT>({ value, schema, context, }: {
|
|
|
14297
14044
|
* the corresponding schemas are provided. Otherwise, they are assumed to be
|
|
14298
14045
|
* valid.
|
|
14299
14046
|
*/
|
|
14300
|
-
export declare function validateUIMessages<UI_MESSAGE extends UIMessage>(
|
|
14047
|
+
export declare function validateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<Array<UI_MESSAGE>>;
|
|
14048
|
+
|
|
14049
|
+
declare type ValidateUIMessagesOptions<UI_MESSAGE extends UIMessage> = {
|
|
14301
14050
|
messages: unknown;
|
|
14302
14051
|
metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
|
|
14303
14052
|
dataSchemas?: {
|
|
@@ -14306,7 +14055,7 @@ export declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messa
|
|
|
14306
14055
|
tools?: {
|
|
14307
14056
|
[NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
|
|
14308
14057
|
};
|
|
14309
|
-
}
|
|
14058
|
+
};
|
|
14310
14059
|
|
|
14311
14060
|
declare type ValidationResult<OBJECT> = {
|
|
14312
14061
|
success: true;
|
|
@@ -14490,11 +14239,12 @@ declare type VideoModelV3CallOptions = {
|
|
|
14490
14239
|
n: number;
|
|
14491
14240
|
/**
|
|
14492
14241
|
* Aspect ratio of the videos to generate.
|
|
14493
|
-
* Must have the format `{width}:{height}
|
|
14242
|
+
* Must have the format `{width}:{height}`, or `'adaptive'` to inherit the
|
|
14243
|
+
* ratio from the input media.
|
|
14494
14244
|
* `undefined` will use the provider's default aspect ratio.
|
|
14495
14245
|
* Common values: '16:9', '9:16', '1:1', '21:9', '4:3'
|
|
14496
14246
|
*/
|
|
14497
|
-
aspectRatio: `${number}:${number}` | undefined;
|
|
14247
|
+
aspectRatio: `${number}:${number}` | 'adaptive' | undefined;
|
|
14498
14248
|
/**
|
|
14499
14249
|
* Resolution of the video to generate.
|
|
14500
14250
|
* Format: `{width}x{height}` (e.g., '1280x720', '1920x1080')
|
|
@@ -14759,5 +14509,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
|
|
|
14759
14509
|
}): Schema<OBJECT>;
|
|
14760
14510
|
|
|
14761
14511
|
export { }
|
|
14762
|
-
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider,
|
|
14763
|
-
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, schemaSymbol, symbol$1, symbol$1_2, symbol$
|
|
14512
|
+
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, ToolResultOutput as ToolResultOutput, ToolNeedsApprovalFunction as ToolNeedsApprovalFunction, TypeValidationContext as TypeValidationContext, EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, PrepareStepCallSettings as PrepareStepCallSettings, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, StreamTextIncludeSettings as StreamTextIncludeSettings, StreamTextOnAbortCallback as StreamTextOnAbortCallback, EnrichedStreamPart as EnrichedStreamPart, CallbackModelInfo as CallbackModelInfo, LanguageModelV3ToolChoice as LanguageModelV3ToolChoice, Listener as Listener, MaybePromiseLike as MaybePromiseLike, InferAgentTools as InferAgentTools, UIMessageStreamResponseInit as UIMessageStreamResponseInit, getOriginalFetch as getOriginalFetch, InferUIMessageTools as InferUIMessageTools, InferUIMessageToolCall as InferUIMessageToolCall, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, Resolvable as Resolvable, FetchFunction as FetchFunction, ValidateUIMessagesOptions as ValidateUIMessagesOptions, SingleRequestTextStreamPart as SingleRequestTextStreamPart, EnforcedToolChoice as EnforcedToolChoice, LanguageModelV3Content as LanguageModelV3Content, RetryErrorReason_2 as RetryErrorReason_2, GenerateImagePrompt as GenerateImagePrompt, JSONValue_2 as JSONValue_2, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, VideoModelResponseMetadata as VideoModelResponseMetadata, VideoModelProviderMetadata as VideoModelProviderMetadata, VideoModel as VideoModel, VideoModelV3FrameType as VideoModelV3FrameType, EmbeddingModelV3CallOptions as EmbeddingModelV3CallOptions, LanguageModelV3CallOptions as LanguageModelV3CallOptions, JSONObject as JSONObject, LanguageModelV3 as LanguageModelV3, EmbeddingModelV3 as EmbeddingModelV3, ImageModelV3 as ImageModelV3, TranscriptionModelV3 as TranscriptionModelV3, SpeechModelV3 as SpeechModelV3, RerankingModelV3 as RerankingModelV3, VideoModelV3 as VideoModelV3, ProviderV2 as ProviderV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV3 as ProviderV3 };
|
|
14513
|
+
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol$g, symbol$h, symbol$i, symbol$j, symbol$k, symbol$l, symbol, symbol_2, symbol_3 };
|