@mastra/ai-sdk 1.11.2 → 1.11.3
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 +209 -55
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +161 -47
- package/dist/_types/@internal_ai-v7/dist/index.d.ts +1049 -274
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.cjs +837 -841
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +836 -839
- package/dist/index.js.map +1 -1
- package/dist/middleware.d.ts.map +1 -1
- package/dist/ui.cjs +1 -2
- package/dist/ui.js +1 -2
- package/package.json +17 -17
|
@@ -20,6 +20,7 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
20
20
|
private sendAutomaticallyWhen?;
|
|
21
21
|
private pendingMessagePreparations;
|
|
22
22
|
private pendingApprovalMessageId;
|
|
23
|
+
private interruptedMessageIds;
|
|
23
24
|
private activeResponse;
|
|
24
25
|
private activeResumeRequest;
|
|
25
26
|
private resumableStreamState;
|
|
@@ -1310,6 +1311,7 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1310
1311
|
* @param abortSignal - The abort signal. Optional.
|
|
1311
1312
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1312
1313
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
1314
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
1313
1315
|
* @param options - The options for the agent.
|
|
1314
1316
|
* @param experimental_transform - The stream transformations. Optional.
|
|
1315
1317
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -1318,7 +1320,7 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1318
1320
|
*
|
|
1319
1321
|
* @returns The UI message stream.
|
|
1320
1322
|
*/
|
|
1321
|
-
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown, UI_MESSAGE extends UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>> = UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>>>({ agent, uiMessages, convertDataPart, options, abortSignal, timeout, experimental_sandbox: sandbox, experimental_transform, onStepEnd, onStepFinish, onUIMessageStepEnd, ...uiMessageStreamOptions }: {
|
|
1323
|
+
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown, UI_MESSAGE extends UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>> = UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>>>({ agent, uiMessages, convertDataPart, options, abortSignal, timeout, experimental_sandbox: sandbox, experimental_steering: steering, experimental_transform, onStepEnd, onStepFinish, onUIMessageStepEnd, ...uiMessageStreamOptions }: {
|
|
1322
1324
|
agent: Agent<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
1323
1325
|
uiMessages: unknown[];
|
|
1324
1326
|
/**
|
|
@@ -1329,6 +1331,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1329
1331
|
abortSignal?: AbortSignal;
|
|
1330
1332
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
1331
1333
|
experimental_sandbox?: Experimental_SandboxSession;
|
|
1334
|
+
experimental_steering?: Experimental_Steering;
|
|
1332
1335
|
options?: CALL_OPTIONS;
|
|
1333
1336
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
1334
1337
|
} & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>>;
|
|
@@ -1342,6 +1345,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1342
1345
|
* @param abortSignal - Abort signal. Optional.
|
|
1343
1346
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1344
1347
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
1348
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
1345
1349
|
* @param options - The options for the agent. Optional.
|
|
1346
1350
|
* @param experimental_transform - Stream transformations. Optional.
|
|
1347
1351
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -1366,6 +1370,7 @@ export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS
|
|
|
1366
1370
|
abortSignal?: AbortSignal;
|
|
1367
1371
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
1368
1372
|
experimental_sandbox?: Experimental_SandboxSession;
|
|
1373
|
+
experimental_steering?: Experimental_Steering;
|
|
1369
1374
|
options?: CALL_OPTIONS;
|
|
1370
1375
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
1371
1376
|
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<Response>;
|
|
@@ -1671,6 +1676,9 @@ declare type DecisionModelV4Answer = {
|
|
|
1671
1676
|
declare type DecisionModelV4CallOptions = {
|
|
1672
1677
|
state: DecisionModelV4State;
|
|
1673
1678
|
questions: Readonly<Record<string, Experimental_DecisionQuestion>>;
|
|
1679
|
+
maxOutputTokens?: number;
|
|
1680
|
+
/** Reasoning effort for supported models. Language-model adapters default to none. */
|
|
1681
|
+
reasoning?: LanguageModelV4CallOptions['reasoning'];
|
|
1674
1682
|
abortSignal?: AbortSignal;
|
|
1675
1683
|
headers?: SharedV4Headers;
|
|
1676
1684
|
providerOptions?: SharedV4ProviderOptions;
|
|
@@ -2920,6 +2928,8 @@ export declare class EmptyResponseBodyError extends AISDKError {
|
|
|
2920
2928
|
}
|
|
2921
2929
|
|
|
2922
2930
|
declare type EnforcedToolChoice = Extract<LanguageModelV4ToolChoice, {
|
|
2931
|
+
type: 'none';
|
|
2932
|
+
} | {
|
|
2923
2933
|
type: 'required';
|
|
2924
2934
|
} | {
|
|
2925
2935
|
type: 'tool';
|
|
@@ -3213,12 +3223,35 @@ export declare type Experimental_CancelBatchResult = {
|
|
|
3213
3223
|
*/
|
|
3214
3224
|
export declare const experimental_createProviderRegistry: typeof createProviderRegistry;
|
|
3215
3225
|
|
|
3226
|
+
/**
|
|
3227
|
+
* Creates a steering object that sends user messages to a running generation.
|
|
3228
|
+
*
|
|
3229
|
+
* @example
|
|
3230
|
+
* ```ts
|
|
3231
|
+
* const steering = experimental_createSteering();
|
|
3232
|
+
*
|
|
3233
|
+
* const result = streamText({
|
|
3234
|
+
* model,
|
|
3235
|
+
* tools,
|
|
3236
|
+
* stopWhen: isStepCount(20),
|
|
3237
|
+
* experimental_steering: steering,
|
|
3238
|
+
* });
|
|
3239
|
+
*
|
|
3240
|
+
* const outcome = await steering.steer('Use Paris, Texas instead.');
|
|
3241
|
+
* ```
|
|
3242
|
+
*/
|
|
3243
|
+
export declare function experimental_createSteering(): Experimental_Steering;
|
|
3244
|
+
|
|
3216
3245
|
/** Decide answers to typed questions against one shared state. Experimental. */
|
|
3217
|
-
export declare function experimental_decide<const QUESTIONS extends Record<string, Experimental_DecisionQuestion>, RUNTIME_CONTEXT extends Context = Context>({ model: modelArg, state, questions, maxRetries, abortSignal, headers, providerOptions, telemetry, runtimeContext, onStart, onEnd, _internal: { generateCallId } }: {
|
|
3246
|
+
export declare function experimental_decide<const QUESTIONS extends Record<string, Experimental_DecisionQuestion>, RUNTIME_CONTEXT extends Context = Context>({ model: modelArg, state, questions, maxOutputTokens, reasoning, maxRetries, abortSignal, headers, providerOptions, telemetry, runtimeContext, onStart, onEnd, _internal: { generateCallId } }: {
|
|
3218
3247
|
/** A decision model instance or an ID resolved by the configured default provider. */
|
|
3219
3248
|
model: Experimental_DecisionModel;
|
|
3220
3249
|
state: Experimental_DecisionState;
|
|
3221
3250
|
questions: QUESTIONS;
|
|
3251
|
+
/** Maximum output tokens for supported models. Must be an integer >= 1. */
|
|
3252
|
+
maxOutputTokens?: number;
|
|
3253
|
+
/** Reasoning effort for supported models. Language-model adapters default to none. */
|
|
3254
|
+
reasoning?: DecisionModelV4CallOptions['reasoning'];
|
|
3222
3255
|
/** Maximum retries for transient provider failures. Defaults to 2. */
|
|
3223
3256
|
maxRetries?: number;
|
|
3224
3257
|
abortSignal?: AbortSignal;
|
|
@@ -3278,6 +3311,10 @@ export declare type Experimental_DecideStartEvent<RUNTIME_CONTEXT extends Contex
|
|
|
3278
3311
|
readonly state: Experimental_DecisionState;
|
|
3279
3312
|
/** The questions to decide against the shared state. */
|
|
3280
3313
|
readonly questions: Readonly<Record<string, Experimental_DecisionQuestion>>;
|
|
3314
|
+
/** Maximum output tokens requested for the decision. */
|
|
3315
|
+
readonly maxOutputTokens?: number;
|
|
3316
|
+
/** Reasoning effort requested for the decision. */
|
|
3317
|
+
readonly reasoning?: DecisionModelV4CallOptions['reasoning'];
|
|
3281
3318
|
/** Maximum number of retries for the decision model call. */
|
|
3282
3319
|
readonly maxRetries: number;
|
|
3283
3320
|
/** Additional HTTP headers sent with the request. */
|
|
@@ -3373,20 +3410,24 @@ export declare type Experimental_DecisionProviderRegistry<PROVIDERS extends Reco
|
|
|
3373
3410
|
/** A judgment to make about the shared state. */
|
|
3374
3411
|
export declare type Experimental_DecisionQuestion = {
|
|
3375
3412
|
readonly type: 'choice';
|
|
3376
|
-
|
|
3413
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
3414
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
3377
3415
|
/** Nonempty map of option names to descriptions. Null means no description. */
|
|
3378
3416
|
readonly criteria: Readonly<Record<string, DecisionModelV4Input | null>>;
|
|
3379
3417
|
} | {
|
|
3380
3418
|
readonly type: 'score';
|
|
3381
|
-
|
|
3382
|
-
|
|
3419
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
3420
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
3421
|
+
/** At least one ordered level, indexed from zero. Providers may require more. */
|
|
3383
3422
|
readonly criteria: readonly (DecisionModelV4Input | null)[];
|
|
3384
3423
|
} | {
|
|
3385
3424
|
readonly type: 'box';
|
|
3386
3425
|
readonly instructions: DecisionModelV4Input;
|
|
3387
3426
|
} | {
|
|
3388
3427
|
readonly type: 'boolean';
|
|
3389
|
-
|
|
3428
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
3429
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
3430
|
+
/** At least one non-null description is required when instructions are absent. */
|
|
3390
3431
|
readonly criteria?: {
|
|
3391
3432
|
readonly true?: DecisionModelV4Input | null;
|
|
3392
3433
|
readonly false?: DecisionModelV4Input | null;
|
|
@@ -4012,12 +4053,12 @@ export declare type Experimental_SandboxSession = {
|
|
|
4012
4053
|
* read primitive; prefer `readBinaryFile` or `readTextFile` unless you need
|
|
4013
4054
|
* to stream bytes.
|
|
4014
4055
|
*/
|
|
4015
|
-
readonly readFile: (options:
|
|
4056
|
+
readonly readFile: (options: SandboxReadFileOptions) => PromiseLike<ReadableStream<Uint8Array> | null>;
|
|
4016
4057
|
/**
|
|
4017
4058
|
* Read one file from the sandbox as raw bytes. Resolves to `null` when the
|
|
4018
4059
|
* file does not exist.
|
|
4019
4060
|
*/
|
|
4020
|
-
readonly readBinaryFile: (options:
|
|
4061
|
+
readonly readBinaryFile: (options: SandboxReadBinaryFileOptions) => PromiseLike<Uint8Array | null>;
|
|
4021
4062
|
/**
|
|
4022
4063
|
* Read one text file from the sandbox, decoded using the requested encoding.
|
|
4023
4064
|
* Resolves to `null` when the file does not exist.
|
|
@@ -4025,21 +4066,7 @@ export declare type Experimental_SandboxSession = {
|
|
|
4025
4066
|
* Line ranges are 1-based and inclusive. When `endLine` is past EOF the read
|
|
4026
4067
|
* returns through EOF without error.
|
|
4027
4068
|
*/
|
|
4028
|
-
readonly readTextFile: (options:
|
|
4029
|
-
/**
|
|
4030
|
-
* Text encoding used to decode the file bytes. Defaults to `"utf-8"`.
|
|
4031
|
-
*/
|
|
4032
|
-
encoding?: string;
|
|
4033
|
-
/**
|
|
4034
|
-
* 1-based inclusive start line. Defaults to 1.
|
|
4035
|
-
*/
|
|
4036
|
-
startLine?: number;
|
|
4037
|
-
/**
|
|
4038
|
-
* 1-based inclusive end line. When past the file's line count, the read
|
|
4039
|
-
* returns through EOF without error.
|
|
4040
|
-
*/
|
|
4041
|
-
endLine?: number;
|
|
4042
|
-
}) => PromiseLike<string | null>;
|
|
4069
|
+
readonly readTextFile: (options: SandboxReadTextFileOptions) => PromiseLike<string | null>;
|
|
4043
4070
|
/**
|
|
4044
4071
|
* Write one file to the sandbox from a stream of bytes. Creates parent
|
|
4045
4072
|
* directories recursively and overwrites any existing file.
|
|
@@ -4047,35 +4074,39 @@ export declare type Experimental_SandboxSession = {
|
|
|
4047
4074
|
* This is the lowest-level write primitive; prefer `writeBinaryFile` or
|
|
4048
4075
|
* `writeTextFile` when the full content is already materialized in memory.
|
|
4049
4076
|
*/
|
|
4050
|
-
readonly writeFile: (options:
|
|
4077
|
+
readonly writeFile: (options: SandboxWriteFileOptions) => PromiseLike<void>;
|
|
4051
4078
|
/**
|
|
4052
4079
|
* Write one file to the sandbox from raw bytes. Creates parent directories
|
|
4053
4080
|
* recursively and overwrites any existing file.
|
|
4054
4081
|
*/
|
|
4055
|
-
readonly writeBinaryFile: (options:
|
|
4082
|
+
readonly writeBinaryFile: (options: SandboxWriteBinaryFileOptions) => PromiseLike<void>;
|
|
4056
4083
|
/**
|
|
4057
4084
|
* Write one file to the sandbox from a string, encoded using the requested
|
|
4058
4085
|
* encoding. Creates parent directories recursively and overwrites any
|
|
4059
4086
|
* existing file.
|
|
4060
4087
|
*/
|
|
4061
|
-
readonly writeTextFile: (options:
|
|
4062
|
-
/**
|
|
4063
|
-
* Text encoding used to encode the string to bytes. Defaults to `"utf-8"`.
|
|
4064
|
-
*/
|
|
4065
|
-
encoding?: string;
|
|
4066
|
-
}) => PromiseLike<void>;
|
|
4088
|
+
readonly writeTextFile: (options: SandboxWriteTextFileOptions) => PromiseLike<void>;
|
|
4067
4089
|
/**
|
|
4068
4090
|
* Spawn a long-running process in the sandbox. Returns immediately with a
|
|
4069
4091
|
* handle that streams stdout/stderr, can be waited on, and can be killed.
|
|
4070
4092
|
*
|
|
4071
4093
|
* `run` is conceptually a thin wrapper over this primitive: spawn,
|
|
4072
4094
|
* collect both streams to strings, await `wait()`, return the result.
|
|
4095
|
+
*
|
|
4096
|
+
* Set `stdin` to `true` to keep standard input open and expose a writable
|
|
4097
|
+
* stream on the returned handle. Implementations that do not support writable
|
|
4098
|
+
* stdin must reject before starting the command. When omitted or `false`,
|
|
4099
|
+
* standard input is closed and the handle has no `stdin` property.
|
|
4073
4100
|
*/
|
|
4074
|
-
readonly spawn:
|
|
4101
|
+
readonly spawn: {
|
|
4102
|
+
(options: SandboxSpawnOptionsWithStdin): PromiseLike<WritableSandboxProcess>;
|
|
4103
|
+
(options: SandboxSpawnOptionsWithoutStdin): PromiseLike<Experimental_SandboxProcess>;
|
|
4104
|
+
(options: SandboxSpawnOptions): PromiseLike<Experimental_SandboxProcess | WritableSandboxProcess>;
|
|
4105
|
+
};
|
|
4075
4106
|
/**
|
|
4076
4107
|
* Run a command in the sandbox.
|
|
4077
4108
|
*/
|
|
4078
|
-
readonly run: (options:
|
|
4109
|
+
readonly run: (options: SandboxRunOptions) => PromiseLike<{
|
|
4079
4110
|
/**
|
|
4080
4111
|
* Exit code returned by the command.
|
|
4081
4112
|
*/
|
|
@@ -4096,6 +4127,46 @@ export declare type Experimental_SandboxSession = {
|
|
|
4096
4127
|
*/
|
|
4097
4128
|
export declare type Experimental_SpeechResult = SpeechResult;
|
|
4098
4129
|
|
|
4130
|
+
export declare type Experimental_SpeechStreamPart = {
|
|
4131
|
+
/**
|
|
4132
|
+
* Audio chunk in generation order. Chunks are not necessarily
|
|
4133
|
+
* standalone files; concatenate them to reconstruct the audio. A chunk
|
|
4134
|
+
* is empty only when it carries `providerMetadata` (e.g. a turn marker).
|
|
4135
|
+
*/
|
|
4136
|
+
type: 'audio';
|
|
4137
|
+
id?: string;
|
|
4138
|
+
audio: Uint8Array;
|
|
4139
|
+
audioFormat: SharedV4AudioFormat;
|
|
4140
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
4141
|
+
} | {
|
|
4142
|
+
type: 'raw';
|
|
4143
|
+
rawValue: unknown;
|
|
4144
|
+
} | {
|
|
4145
|
+
type: 'error';
|
|
4146
|
+
error: unknown;
|
|
4147
|
+
};
|
|
4148
|
+
|
|
4149
|
+
export declare type Experimental_SpeechStreamUsage = SpeechModelV4StreamUsage;
|
|
4150
|
+
|
|
4151
|
+
/**
|
|
4152
|
+
* A piece of text to synthesize. Pass a stream of these (or mix them with
|
|
4153
|
+
* plain strings) to give parts their own voice, e.g. for dialogue.
|
|
4154
|
+
*/
|
|
4155
|
+
export declare type Experimental_SpeechTextPart = {
|
|
4156
|
+
type: 'text';
|
|
4157
|
+
text: string;
|
|
4158
|
+
/**
|
|
4159
|
+
* The voice that speaks this part (provider-specific, like the call's
|
|
4160
|
+
* `voice`). Single-voice providers reject a voice that differs from the
|
|
4161
|
+
* call's voice.
|
|
4162
|
+
*/
|
|
4163
|
+
voice?: string;
|
|
4164
|
+
/**
|
|
4165
|
+
* Additional provider-specific options for this part.
|
|
4166
|
+
*/
|
|
4167
|
+
providerOptions?: ProviderOptions;
|
|
4168
|
+
};
|
|
4169
|
+
|
|
4099
4170
|
/**
|
|
4100
4171
|
* Starts a batch.
|
|
4101
4172
|
*/
|
|
@@ -4187,6 +4258,65 @@ export declare function experimental_startVideo({ model: modelArg, prompt: promp
|
|
|
4187
4258
|
webhookUrl?: string;
|
|
4188
4259
|
}): Promise<StartVideoResult>;
|
|
4189
4260
|
|
|
4261
|
+
/**
|
|
4262
|
+
* Sends user messages to a running generation. Pass it to `generateText`,
|
|
4263
|
+
* `streamText`, or an agent call with the `experimental_steering` option.
|
|
4264
|
+
*/
|
|
4265
|
+
export declare interface Experimental_Steering {
|
|
4266
|
+
/**
|
|
4267
|
+
* Adds a user message to the run at the next step boundary, after the
|
|
4268
|
+
* current step and its tool calls are done. If the run would end because the
|
|
4269
|
+
* model finished its answer, it continues for another step unless a stop
|
|
4270
|
+
* condition is met.
|
|
4271
|
+
*
|
|
4272
|
+
* Messages that are sent before the run starts are delivered in the first
|
|
4273
|
+
* step. A steering object can only be used for one generation.
|
|
4274
|
+
*
|
|
4275
|
+
* @param message - The user message, or its text.
|
|
4276
|
+
* @param options.id - The id of the message. Sending a message again with
|
|
4277
|
+
* the same id returns the outcome of the first message.
|
|
4278
|
+
*
|
|
4279
|
+
* @returns The outcome of the message. It never rejects.
|
|
4280
|
+
*/
|
|
4281
|
+
steer(message: string | UserModelMessage, options?: {
|
|
4282
|
+
id?: string;
|
|
4283
|
+
}): Promise<Experimental_SteeringOutcome>;
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
/**
|
|
4287
|
+
* Why a steering message was not delivered:
|
|
4288
|
+
*
|
|
4289
|
+
* - `finished`: the run ended before the message could be delivered.
|
|
4290
|
+
* - `removed-by-prepare-step`: `prepareStep` returned messages without it.
|
|
4291
|
+
* - `stop-condition`: a stop condition ended the run.
|
|
4292
|
+
* - `waiting-for-tool-results`: the run ended to wait for tool results,
|
|
4293
|
+
* e.g. a tool approval or a tool without an `execute` function.
|
|
4294
|
+
* - `aborted`: the run was aborted.
|
|
4295
|
+
* - `error`: the run failed.
|
|
4296
|
+
*/
|
|
4297
|
+
export declare type Experimental_SteeringNotDeliveredReason = 'finished' | 'removed-by-prepare-step' | 'stop-condition' | 'waiting-for-tool-results' | 'aborted' | 'error';
|
|
4298
|
+
|
|
4299
|
+
/**
|
|
4300
|
+
* The outcome of a steering message.
|
|
4301
|
+
*/
|
|
4302
|
+
export declare type Experimental_SteeringOutcome = {
|
|
4303
|
+
readonly type: 'delivered';
|
|
4304
|
+
/** The id of the steering message. */
|
|
4305
|
+
readonly id: string;
|
|
4306
|
+
/** The user message that was added to the run. */
|
|
4307
|
+
readonly message: UserModelMessage;
|
|
4308
|
+
/** The number of the step whose model call received the message. */
|
|
4309
|
+
readonly stepNumber: number;
|
|
4310
|
+
} | {
|
|
4311
|
+
readonly type: 'not-delivered';
|
|
4312
|
+
/** The id of the steering message. */
|
|
4313
|
+
readonly id: string;
|
|
4314
|
+
/** The user message that was not added to the run. */
|
|
4315
|
+
readonly message: UserModelMessage;
|
|
4316
|
+
/** Why the message was not delivered. */
|
|
4317
|
+
readonly reason: Experimental_SteeringNotDeliveredReason;
|
|
4318
|
+
};
|
|
4319
|
+
|
|
4190
4320
|
/**
|
|
4191
4321
|
* Streams a single language model call after standardizing the prompt and tools.
|
|
4192
4322
|
*
|
|
@@ -4288,6 +4418,133 @@ export declare function experimental_streamLanguageModelCall<TOOLS extends ToolS
|
|
|
4288
4418
|
};
|
|
4289
4419
|
}>;
|
|
4290
4420
|
|
|
4421
|
+
/**
|
|
4422
|
+
* Streams speech audio using a speech model.
|
|
4423
|
+
*
|
|
4424
|
+
* @param model - The speech model to use. It must support streaming speech.
|
|
4425
|
+
* @param text - The text to convert to speech: a complete string, or a stream of text deltas
|
|
4426
|
+
* (e.g. the text stream of `streamText`) or text parts that is synthesized as it arrives.
|
|
4427
|
+
* A text part can set its own `voice` on providers that support several voices per stream.
|
|
4428
|
+
* @param voice - The voice to use for speech generation.
|
|
4429
|
+
* @param outputFormat - The format of the output audio chunks, e.g. `{ type: 'audio/pcm', rate: 24000 }`.
|
|
4430
|
+
* @param instructions - Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
4431
|
+
* @param speed - The speed of the speech generation.
|
|
4432
|
+
* @param language - The language for speech generation (ISO 639-1 code e.g. "en", "es", "fr") or "auto" for automatic detection.
|
|
4433
|
+
* @param providerOptions - Additional provider-specific options.
|
|
4434
|
+
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
4435
|
+
* @param headers - Additional HTTP/WebSocket headers to send when supported by the provider.
|
|
4436
|
+
* @param includeRawChunks - When true, raw provider chunks are included in `fullStream`.
|
|
4437
|
+
* @param onError - Called for each provider error part; defaults to `console.error`.
|
|
4438
|
+
*
|
|
4439
|
+
* @returns A result object with the audio stream and the final usage and metadata.
|
|
4440
|
+
*/
|
|
4441
|
+
export declare function experimental_streamSpeech({ model, text, voice, outputFormat, instructions, speed, language, providerOptions, abortSignal, headers, includeRawChunks, onError, _internal: { currentDate } }: {
|
|
4442
|
+
/**
|
|
4443
|
+
* The speech model to use.
|
|
4444
|
+
*/
|
|
4445
|
+
model: SpeechModel;
|
|
4446
|
+
/**
|
|
4447
|
+
* The text to convert to speech: a complete string, or an array, iterable,
|
|
4448
|
+
* or stream of text deltas and/or text parts.
|
|
4449
|
+
*/
|
|
4450
|
+
text: string | Iterable<string | Experimental_SpeechTextPart> | AsyncIterable<string | Experimental_SpeechTextPart> | ReadableStream<string | Experimental_SpeechTextPart>;
|
|
4451
|
+
/**
|
|
4452
|
+
* The voice to use for speech generation.
|
|
4453
|
+
*/
|
|
4454
|
+
voice?: string;
|
|
4455
|
+
/**
|
|
4456
|
+
* The desired format of the output audio chunks, e.g.
|
|
4457
|
+
* `{ type: 'audio/pcm', rate: 24000 }` or `{ type: 'audio/mpeg' }`.
|
|
4458
|
+
* Supported formats are provider-specific.
|
|
4459
|
+
*/
|
|
4460
|
+
outputFormat?: SharedV4AudioFormat;
|
|
4461
|
+
/**
|
|
4462
|
+
* Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
4463
|
+
*/
|
|
4464
|
+
instructions?: string;
|
|
4465
|
+
/**
|
|
4466
|
+
* The speed of the speech generation.
|
|
4467
|
+
*/
|
|
4468
|
+
speed?: number;
|
|
4469
|
+
/**
|
|
4470
|
+
* The language for speech generation. This should be an ISO 639-1 language code (e.g. "en", "es", "fr")
|
|
4471
|
+
* or "auto" for automatic language detection. Provider support varies.
|
|
4472
|
+
*/
|
|
4473
|
+
language?: string;
|
|
4474
|
+
/**
|
|
4475
|
+
* Additional provider-specific options.
|
|
4476
|
+
*/
|
|
4477
|
+
providerOptions?: ProviderOptions;
|
|
4478
|
+
/**
|
|
4479
|
+
* Abort signal.
|
|
4480
|
+
*/
|
|
4481
|
+
abortSignal?: AbortSignal;
|
|
4482
|
+
/**
|
|
4483
|
+
* Additional headers to include in the request, if supported by the provider.
|
|
4484
|
+
*/
|
|
4485
|
+
headers?: Record<string, string>;
|
|
4486
|
+
/**
|
|
4487
|
+
* When true, providers should include raw provider chunks in the stream.
|
|
4488
|
+
*/
|
|
4489
|
+
includeRawChunks?: boolean;
|
|
4490
|
+
/**
|
|
4491
|
+
* Called for each error part the provider reports. Error parts are not
|
|
4492
|
+
* fatal: `fullStream` includes them and `audioStream` skips them. The
|
|
4493
|
+
* callback is not awaited, and errors it throws are ignored.
|
|
4494
|
+
* Defaults to logging the error with `console.error`.
|
|
4495
|
+
*/
|
|
4496
|
+
onError?: (event: {
|
|
4497
|
+
error: unknown;
|
|
4498
|
+
}) => void | PromiseLike<void>;
|
|
4499
|
+
/**
|
|
4500
|
+
* Internal test hooks.
|
|
4501
|
+
*/
|
|
4502
|
+
_internal?: {
|
|
4503
|
+
currentDate?: () => Date;
|
|
4504
|
+
};
|
|
4505
|
+
}): Experimental_StreamSpeechResult;
|
|
4506
|
+
|
|
4507
|
+
export declare interface Experimental_StreamSpeechResult {
|
|
4508
|
+
/**
|
|
4509
|
+
* Usage information reported for the call, if available.
|
|
4510
|
+
*/
|
|
4511
|
+
readonly usage: PromiseLike<Experimental_SpeechStreamUsage>;
|
|
4512
|
+
/**
|
|
4513
|
+
* Warnings for the call, e.g. unsupported settings.
|
|
4514
|
+
*/
|
|
4515
|
+
readonly warnings: PromiseLike<Array<Warning>>;
|
|
4516
|
+
/**
|
|
4517
|
+
* Response metadata.
|
|
4518
|
+
*/
|
|
4519
|
+
readonly responses: PromiseLike<Array<SpeechModelResponseMetadata>>;
|
|
4520
|
+
/**
|
|
4521
|
+
* Additional provider-specific metadata.
|
|
4522
|
+
*/
|
|
4523
|
+
readonly providerMetadata: PromiseLike<Record<string, JSONObject>>;
|
|
4524
|
+
/**
|
|
4525
|
+
* Stream of audio bytes in generation order.
|
|
4526
|
+
*
|
|
4527
|
+
* `audioStream` and `fullStream` share one live stream: only one of them
|
|
4528
|
+
* can be accessed, and only once. Access it before any result promise;
|
|
4529
|
+
* accessing a result promise first consumes the stream internally.
|
|
4530
|
+
*/
|
|
4531
|
+
readonly audioStream: AsyncIterableStream<Uint8Array>;
|
|
4532
|
+
/**
|
|
4533
|
+
* Full stream of speech parts (audio, raw, and error parts).
|
|
4534
|
+
*
|
|
4535
|
+
* `audioStream` and `fullStream` share one live stream: only one of them
|
|
4536
|
+
* can be accessed, and only once. Access it before any result promise;
|
|
4537
|
+
* accessing a result promise first consumes the stream internally.
|
|
4538
|
+
*/
|
|
4539
|
+
readonly fullStream: AsyncIterableStream<Experimental_SpeechStreamPart>;
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
/**
|
|
4543
|
+
* Stream text with a single consumer, without replay or final-content getters.
|
|
4544
|
+
* Accepts the same options as streamText and uses the same execution engine.
|
|
4545
|
+
*/
|
|
4546
|
+
export declare function experimental_streamTextLowMemory<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextSingleConsumerResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
4547
|
+
|
|
4291
4548
|
/**
|
|
4292
4549
|
* Streams transcripts using a transcription model.
|
|
4293
4550
|
*
|
|
@@ -5102,9 +5359,10 @@ export declare function fingerprintTools(tools: ToolSet): Promise<Record<string,
|
|
|
5102
5359
|
* - `content-filter`: content filter violation stopped the model
|
|
5103
5360
|
* - `tool-calls`: model triggered tool calls
|
|
5104
5361
|
* - `error`: model stopped because of an error
|
|
5362
|
+
* - `interrupted`: provider stream ended without a completion signal; output may be incomplete
|
|
5105
5363
|
* - `other`: model stopped for other reasons
|
|
5106
5364
|
*/
|
|
5107
|
-
export declare type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
5365
|
+
export declare type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'interrupted' | 'other';
|
|
5108
5366
|
|
|
5109
5367
|
export declare type FlexibleSchema<SCHEMA = any> = Schema<SCHEMA> | LazySchema<SCHEMA> | ZodSchema<SCHEMA> | StandardSchema<SCHEMA>;
|
|
5110
5368
|
|
|
@@ -5138,7 +5396,7 @@ declare interface GatewayCreditsResponse {
|
|
|
5138
5396
|
totalUsed: string;
|
|
5139
5397
|
}
|
|
5140
5398
|
|
|
5141
|
-
declare type GatewayDecisionModelId = 'convaiinnovations/laya' | 'convaiinnovations/laya-free' | 'liquid/d1' | 'microsoft/microsoft-decision-1' | 'openai/gpt-6-luna-decisions' | 'perplexity/pplx-decider-v1.
|
|
5399
|
+
declare type GatewayDecisionModelId = 'baseten/elephant-1' | 'baseten/mammoth-1' | 'convaiinnovations/laya' | 'convaiinnovations/laya-free' | 'liquid/d1' | 'liquid/d1-ultra' | 'microsoft/microsoft-decision-1' | 'openai/gpt-6-luna-decisions' | 'perplexity/pplx-decider-flash-v1.2' | 'perplexity/pplx-decider-v1.2' | 'scaledown/scaledown-classify-1' | 'typesafe-ai/jev' | 'typesafe-ai/jev-1.13.0' | 'typesafe-ai/jev-1.14.0' | (string & {});
|
|
5142
5400
|
|
|
5143
5401
|
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 & {});
|
|
5144
5402
|
|
|
@@ -5190,7 +5448,7 @@ declare interface GatewayGenerationInfoParams {
|
|
|
5190
5448
|
id: string;
|
|
5191
5449
|
}
|
|
5192
5450
|
|
|
5193
|
-
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-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
|
|
5451
|
+
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-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 & {});
|
|
5194
5452
|
|
|
5195
5453
|
declare interface GatewayLanguageModelEntry {
|
|
5196
5454
|
/**
|
|
@@ -5241,7 +5499,7 @@ declare interface GatewayLanguageModelEntry {
|
|
|
5241
5499
|
|
|
5242
5500
|
declare type GatewayLanguageModelSpecification = Pick<LanguageModelV4, 'specificationVersion' | 'provider' | 'modelId'>;
|
|
5243
5501
|
|
|
5244
|
-
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
|
|
5502
|
+
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-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-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-6.1-terra' | 'openai/gpt-6.1-terra-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' | '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.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 & {});
|
|
5245
5503
|
|
|
5246
5504
|
declare interface GatewayProvider extends ProviderV4 {
|
|
5247
5505
|
(modelId: GatewayModelId): LanguageModelV4;
|
|
@@ -5353,6 +5611,13 @@ declare interface GatewayProvider extends ProviderV4 {
|
|
|
5353
5611
|
* transcription WebSocket without holding the Gateway credential.
|
|
5354
5612
|
*/
|
|
5355
5613
|
experimental_transcription: GatewayTranscriptionFactory;
|
|
5614
|
+
/**
|
|
5615
|
+
* Experimental streaming-speech entry point. Callable like
|
|
5616
|
+
* `speech(modelId)`, plus `getToken` for minting a short-lived client
|
|
5617
|
+
* secret (`vcst_`) a browser can use to open the streaming speech
|
|
5618
|
+
* WebSocket without holding the Gateway credential.
|
|
5619
|
+
*/
|
|
5620
|
+
experimental_speech: GatewaySpeechFactory;
|
|
5356
5621
|
/**
|
|
5357
5622
|
* Gateway-specific tools executed server-side.
|
|
5358
5623
|
*/
|
|
@@ -5400,10 +5665,10 @@ declare interface GatewayProviderSettings {
|
|
|
5400
5665
|
*/
|
|
5401
5666
|
fetch?: FetchFunction;
|
|
5402
5667
|
/**
|
|
5403
|
-
* Custom WebSocket implementation used for streaming transcription
|
|
5404
|
-
* useful for testing or for runtimes without a
|
|
5405
|
-
* header-capable implementation is not required —
|
|
5406
|
-
* carried in the subprotocols.
|
|
5668
|
+
* Custom WebSocket implementation used for streaming transcription and
|
|
5669
|
+
* streaming speech. This is useful for testing or for runtimes without a
|
|
5670
|
+
* global WebSocket. A header-capable implementation is not required —
|
|
5671
|
+
* Gateway WebSocket auth is carried in the subprotocols.
|
|
5407
5672
|
*/
|
|
5408
5673
|
webSocket?: WebSocketConstructor;
|
|
5409
5674
|
/**
|
|
@@ -5412,9 +5677,36 @@ declare interface GatewayProviderSettings {
|
|
|
5412
5677
|
metadataCacheRefreshMillis?: number;
|
|
5413
5678
|
}
|
|
5414
5679
|
|
|
5415
|
-
declare type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | 'voyage/rerank-3' | 'voyage/rerank-3-lite' | (string & {});
|
|
5680
|
+
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 & {});
|
|
5416
5681
|
|
|
5417
|
-
|
|
5682
|
+
/**
|
|
5683
|
+
* Streaming-speech factory: callable like `speech(modelId)`, plus a
|
|
5684
|
+
* server-side `getToken` that mints a speech-bound short-lived client secret
|
|
5685
|
+
* (`vcst_`). The browser connects with
|
|
5686
|
+
* `createGateway({ apiKey: token }).speech(modelId)`; the token rides the
|
|
5687
|
+
* same auth subprotocol an API key does, without exposing the credential.
|
|
5688
|
+
*/
|
|
5689
|
+
declare interface GatewaySpeechFactory {
|
|
5690
|
+
(modelId: GatewaySpeechModelId): StreamingSpeechModelV4;
|
|
5691
|
+
getToken(options: GatewaySpeechFactoryGetTokenOptions): Promise<GatewaySpeechFactoryGetTokenResult>;
|
|
5692
|
+
}
|
|
5693
|
+
|
|
5694
|
+
declare type GatewaySpeechFactoryGetTokenOptions = {
|
|
5695
|
+
model: GatewaySpeechModelId;
|
|
5696
|
+
/** Token lifetime in seconds. Gateway default is 60s (max 300s). */
|
|
5697
|
+
expiresAfterSeconds?: number;
|
|
5698
|
+
};
|
|
5699
|
+
|
|
5700
|
+
declare type GatewaySpeechFactoryGetTokenResult = {
|
|
5701
|
+
/** The minted `vcst_` client secret. */
|
|
5702
|
+
token: string;
|
|
5703
|
+
/** WebSocket URL of the streaming speech surface for this model. */
|
|
5704
|
+
url: string;
|
|
5705
|
+
/** Token expiry, epoch seconds. */
|
|
5706
|
+
expiresAt?: number;
|
|
5707
|
+
};
|
|
5708
|
+
|
|
5709
|
+
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 & {});
|
|
5418
5710
|
|
|
5419
5711
|
declare interface GatewaySpendReportParams {
|
|
5420
5712
|
/** Start date in YYYY-MM-DD format (inclusive) */
|
|
@@ -5555,7 +5847,7 @@ declare type GatewayTranscriptionFactoryGetTokenResult = {
|
|
|
5555
5847
|
expiresAt?: number;
|
|
5556
5848
|
};
|
|
5557
5849
|
|
|
5558
|
-
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' | 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | 'spacexai/grok-stt' | (string & {});
|
|
5850
|
+
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 & {});
|
|
5559
5851
|
|
|
5560
5852
|
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 & {});
|
|
5561
5853
|
|
|
@@ -6341,6 +6633,7 @@ export declare type GenerateSpeechStartEvent = {
|
|
|
6341
6633
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
6342
6634
|
*
|
|
6343
6635
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
6636
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
6344
6637
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
6345
6638
|
* @param experimental_refineToolInput - Optional mapping of tool names to functions that refine parsed tool inputs before tools are executed and before outputs, callbacks, and telemetry are recorded.
|
|
6346
6639
|
* @param onStart - Callback invoked when generation begins, before any LLM calls.
|
|
@@ -6359,13 +6652,151 @@ export declare type GenerateSpeechStartEvent = {
|
|
|
6359
6652
|
* Uses a discriminated union: check `success` to determine if `output` or `error` is present.
|
|
6360
6653
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
6361
6654
|
* @param onStepFinish - Callback that is called when each step (LLM call) is finished, including intermediate steps.
|
|
6655
|
+
* @param onStepError - Callback that is called when a step that started fails before it produces a step result, i.e. when the provider call throws or rejects, or when the call is aborted or times out.
|
|
6362
6656
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
6363
6657
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
6364
6658
|
*
|
|
6365
6659
|
* @returns
|
|
6366
6660
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
6367
6661
|
*/
|
|
6368
|
-
export declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string>>(
|
|
6662
|
+
export declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string>>(options: GenerateTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
6663
|
+
|
|
6664
|
+
/**
|
|
6665
|
+
* Event passed to an `onAbort` callback for text generation.
|
|
6666
|
+
*
|
|
6667
|
+
* Called when a streaming text generation operation is aborted before it
|
|
6668
|
+
* completes.
|
|
6669
|
+
*/
|
|
6670
|
+
export declare type GenerateTextAbortEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = {
|
|
6671
|
+
/** Unique identifier for this generation call, used to correlate events. */
|
|
6672
|
+
readonly callId: string;
|
|
6673
|
+
/** Details for all previously finished steps. */
|
|
6674
|
+
readonly steps: StepResult<TOOLS, RUNTIME_CONTEXT>[];
|
|
6675
|
+
/** The abort reason from the AbortSignal, when one is available. */
|
|
6676
|
+
readonly reason?: unknown;
|
|
6677
|
+
};
|
|
6678
|
+
|
|
6679
|
+
/**
|
|
6680
|
+
* Event passed to the `onEnd` callback.
|
|
6681
|
+
*
|
|
6682
|
+
* Called when the entire generation completes (all steps finished).
|
|
6683
|
+
* Includes the final step's result along with aggregated data from all steps.
|
|
6684
|
+
*/
|
|
6685
|
+
export declare type GenerateTextEndEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = {
|
|
6686
|
+
/** Unique identifier for this generation call, used to correlate events. */
|
|
6687
|
+
readonly callId: string;
|
|
6688
|
+
/** Zero-based index of the final step. */
|
|
6689
|
+
readonly stepNumber: number;
|
|
6690
|
+
/** Information about the model that produced the final step. */
|
|
6691
|
+
readonly model: StepResult<TOOLS, RUNTIME_CONTEXT>['model'];
|
|
6692
|
+
/**
|
|
6693
|
+
* Tool context from the final step.
|
|
6694
|
+
*
|
|
6695
|
+
* @deprecated Use `finalStep.toolsContext` instead.
|
|
6696
|
+
*/
|
|
6697
|
+
readonly toolsContext: InferToolSetContext<TOOLS>;
|
|
6698
|
+
/**
|
|
6699
|
+
* Runtime context from the final step.
|
|
6700
|
+
*
|
|
6701
|
+
* @deprecated Use `finalStep.runtimeContext` instead.
|
|
6702
|
+
*/
|
|
6703
|
+
readonly runtimeContext: RUNTIME_CONTEXT;
|
|
6704
|
+
/** The content that was generated in all steps. */
|
|
6705
|
+
readonly content: StepResult<TOOLS, RUNTIME_CONTEXT>['content'];
|
|
6706
|
+
/** The text that was generated in the final step. */
|
|
6707
|
+
readonly text: StepResult<TOOLS, RUNTIME_CONTEXT>['text'];
|
|
6708
|
+
/**
|
|
6709
|
+
* The reasoning that was generated in the final step.
|
|
6710
|
+
*
|
|
6711
|
+
* @deprecated Use `finalStep.reasoning` instead.
|
|
6712
|
+
*/
|
|
6713
|
+
readonly reasoning: StepResult<TOOLS, RUNTIME_CONTEXT>['reasoning'];
|
|
6714
|
+
/**
|
|
6715
|
+
* The reasoning text that was generated in the final step.
|
|
6716
|
+
*
|
|
6717
|
+
* @deprecated Use `finalStep.reasoningText` instead.
|
|
6718
|
+
*/
|
|
6719
|
+
readonly reasoningText: StepResult<TOOLS, RUNTIME_CONTEXT>['reasoningText'];
|
|
6720
|
+
/** Files that were generated in all steps. */
|
|
6721
|
+
readonly files: StepResult<TOOLS, RUNTIME_CONTEXT>['files'];
|
|
6722
|
+
/** Sources that were used as references in all steps. */
|
|
6723
|
+
readonly sources: StepResult<TOOLS, RUNTIME_CONTEXT>['sources'];
|
|
6724
|
+
/** Tool calls that were made in all steps. */
|
|
6725
|
+
readonly toolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['toolCalls'];
|
|
6726
|
+
/** Static tool calls that were made in all steps. */
|
|
6727
|
+
readonly staticToolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['staticToolCalls'];
|
|
6728
|
+
/** Dynamic tool calls that were made in all steps. */
|
|
6729
|
+
readonly dynamicToolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['dynamicToolCalls'];
|
|
6730
|
+
/** Tool results that were generated in all steps. */
|
|
6731
|
+
readonly toolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['toolResults'];
|
|
6732
|
+
/** Static tool results that were generated in all steps. */
|
|
6733
|
+
readonly staticToolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['staticToolResults'];
|
|
6734
|
+
/** Dynamic tool results that were generated in all steps. */
|
|
6735
|
+
readonly dynamicToolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['dynamicToolResults'];
|
|
6736
|
+
/** The unified reason why the generation finished. Taken from the final step. */
|
|
6737
|
+
readonly finishReason: StepResult<TOOLS, RUNTIME_CONTEXT>['finishReason'];
|
|
6738
|
+
/** The raw reason why the generation finished. Taken from the final step. */
|
|
6739
|
+
readonly rawFinishReason: StepResult<TOOLS, RUNTIME_CONTEXT>['rawFinishReason'];
|
|
6740
|
+
/** Aggregated token usage across all steps. */
|
|
6741
|
+
readonly usage: LanguageModelUsage;
|
|
6742
|
+
/**
|
|
6743
|
+
* Aggregated token usage across all steps.
|
|
6744
|
+
*
|
|
6745
|
+
* @deprecated Use `usage` instead.
|
|
6746
|
+
*/
|
|
6747
|
+
readonly totalUsage: LanguageModelUsage;
|
|
6748
|
+
/** Warnings from the model provider in all steps. */
|
|
6749
|
+
readonly warnings: StepResult<TOOLS, RUNTIME_CONTEXT>['warnings'];
|
|
6750
|
+
/**
|
|
6751
|
+
* Additional request information from the final step.
|
|
6752
|
+
*
|
|
6753
|
+
* @deprecated Use `finalStep.request` instead.
|
|
6754
|
+
*/
|
|
6755
|
+
readonly request: StepResult<TOOLS, RUNTIME_CONTEXT>['request'];
|
|
6756
|
+
/**
|
|
6757
|
+
* Additional response information from the final step.
|
|
6758
|
+
*
|
|
6759
|
+
* @deprecated Use `finalStep.response` instead.
|
|
6760
|
+
*/
|
|
6761
|
+
readonly response: StepResult<TOOLS, RUNTIME_CONTEXT>['response'];
|
|
6762
|
+
/**
|
|
6763
|
+
* Additional provider-specific metadata from the final step.
|
|
6764
|
+
*
|
|
6765
|
+
* @deprecated Use `finalStep.providerMetadata` instead.
|
|
6766
|
+
*/
|
|
6767
|
+
readonly providerMetadata: StepResult<TOOLS, RUNTIME_CONTEXT>['providerMetadata'];
|
|
6768
|
+
/** The response messages that were generated during the call. */
|
|
6769
|
+
readonly responseMessages: ResponseMessage[];
|
|
6770
|
+
/** Array containing results from all steps in the generation. */
|
|
6771
|
+
readonly steps: StepResult<TOOLS, RUNTIME_CONTEXT>[];
|
|
6772
|
+
/** The final step. This is a shortcut for `steps.at(-1)`. */
|
|
6773
|
+
readonly finalStep: StepResult<TOOLS, RUNTIME_CONTEXT>;
|
|
6774
|
+
};
|
|
6775
|
+
|
|
6776
|
+
export declare type GenerateTextInclude = {
|
|
6777
|
+
/**
|
|
6778
|
+
* Whether to retain the request body in step results.
|
|
6779
|
+
* The request body can be large when sending images or files.
|
|
6780
|
+
*
|
|
6781
|
+
* @default false
|
|
6782
|
+
*/
|
|
6783
|
+
requestBody?: boolean;
|
|
6784
|
+
/**
|
|
6785
|
+
* Whether to retain the request messages in step results.
|
|
6786
|
+
* The request messages can be large when sending images or files.
|
|
6787
|
+
*
|
|
6788
|
+
* @default false
|
|
6789
|
+
*/
|
|
6790
|
+
requestMessages?: boolean;
|
|
6791
|
+
/**
|
|
6792
|
+
* Whether to retain the response body in step results.
|
|
6793
|
+
*
|
|
6794
|
+
* @default false
|
|
6795
|
+
*/
|
|
6796
|
+
responseBody?: boolean;
|
|
6797
|
+
};
|
|
6798
|
+
|
|
6799
|
+
declare function generateTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string>>({ model: modelArg, tools, toolChoice, instructions, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_sandbox: sandbox, output, toolApproval, experimental_toolCallers, experimental_toolApprovalSecret, experimental_telemetry, telemetry, providerOptions, activeTools, toolOrder, toolCallConcurrency, prepareStep, experimental_repairToolCall, repairToolCall, experimental_refineToolInput: refineToolInput, experimental_download: download, runtimeContext, toolsContext, experimental_include, include, _internal: { generateId, generateCallId, now }, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onLanguageModelCallStart, experimental_onLanguageModelCallStart, onLanguageModelCallEnd, experimental_onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, experimental_onToolCallStart, experimental_onToolCallFinish, onStepEnd, onStepError, onStepFinish, onFinish, onEnd, ...settings }: LanguageModelCallOptions & RequestOptions<TOOLS> & Prompt & ToolsContextParameter<TOOLS> & {
|
|
6369
6800
|
/**
|
|
6370
6801
|
* The language model to use.
|
|
6371
6802
|
*/
|
|
@@ -6401,6 +6832,12 @@ export declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT exte
|
|
|
6401
6832
|
* The sandbox environment that is passed through to tool execution.
|
|
6402
6833
|
*/
|
|
6403
6834
|
experimental_sandbox?: Experimental_SandboxSession;
|
|
6835
|
+
/**
|
|
6836
|
+
* A steering object created with `experimental_createSteering()`.
|
|
6837
|
+
* Messages sent with it are added to the generation at the next step
|
|
6838
|
+
* boundary.
|
|
6839
|
+
*/
|
|
6840
|
+
experimental_steering?: Experimental_Steering;
|
|
6404
6841
|
/**
|
|
6405
6842
|
* Runtime context. Treat runtime context as immutable.
|
|
6406
6843
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -6543,6 +6980,11 @@ export declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT exte
|
|
|
6543
6980
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
6544
6981
|
*/
|
|
6545
6982
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
6983
|
+
/**
|
|
6984
|
+
* Callback that is called when a step that started fails before it
|
|
6985
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
6986
|
+
*/
|
|
6987
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
6546
6988
|
/**
|
|
6547
6989
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
6548
6990
|
*
|
|
@@ -6582,142 +7024,7 @@ export declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT exte
|
|
|
6582
7024
|
generateCallId?: IdGenerator;
|
|
6583
7025
|
now?: () => number;
|
|
6584
7026
|
};
|
|
6585
|
-
}): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
6586
|
-
|
|
6587
|
-
/**
|
|
6588
|
-
* Event passed to an `onAbort` callback for text generation.
|
|
6589
|
-
*
|
|
6590
|
-
* Called when a streaming text generation operation is aborted before it
|
|
6591
|
-
* completes.
|
|
6592
|
-
*/
|
|
6593
|
-
export declare type GenerateTextAbortEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = {
|
|
6594
|
-
/** Unique identifier for this generation call, used to correlate events. */
|
|
6595
|
-
readonly callId: string;
|
|
6596
|
-
/** Details for all previously finished steps. */
|
|
6597
|
-
readonly steps: StepResult<TOOLS, RUNTIME_CONTEXT>[];
|
|
6598
|
-
/** The abort reason from the AbortSignal, when one is available. */
|
|
6599
|
-
readonly reason?: unknown;
|
|
6600
|
-
};
|
|
6601
|
-
|
|
6602
|
-
/**
|
|
6603
|
-
* Event passed to the `onEnd` callback.
|
|
6604
|
-
*
|
|
6605
|
-
* Called when the entire generation completes (all steps finished).
|
|
6606
|
-
* Includes the final step's result along with aggregated data from all steps.
|
|
6607
|
-
*/
|
|
6608
|
-
export declare type GenerateTextEndEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = {
|
|
6609
|
-
/** Unique identifier for this generation call, used to correlate events. */
|
|
6610
|
-
readonly callId: string;
|
|
6611
|
-
/** Zero-based index of the final step. */
|
|
6612
|
-
readonly stepNumber: number;
|
|
6613
|
-
/** Information about the model that produced the final step. */
|
|
6614
|
-
readonly model: StepResult<TOOLS, RUNTIME_CONTEXT>['model'];
|
|
6615
|
-
/**
|
|
6616
|
-
* Tool context from the final step.
|
|
6617
|
-
*
|
|
6618
|
-
* @deprecated Use `finalStep.toolsContext` instead.
|
|
6619
|
-
*/
|
|
6620
|
-
readonly toolsContext: InferToolSetContext<TOOLS>;
|
|
6621
|
-
/**
|
|
6622
|
-
* Runtime context from the final step.
|
|
6623
|
-
*
|
|
6624
|
-
* @deprecated Use `finalStep.runtimeContext` instead.
|
|
6625
|
-
*/
|
|
6626
|
-
readonly runtimeContext: RUNTIME_CONTEXT;
|
|
6627
|
-
/** The content that was generated in all steps. */
|
|
6628
|
-
readonly content: StepResult<TOOLS, RUNTIME_CONTEXT>['content'];
|
|
6629
|
-
/** The text that was generated in the final step. */
|
|
6630
|
-
readonly text: StepResult<TOOLS, RUNTIME_CONTEXT>['text'];
|
|
6631
|
-
/**
|
|
6632
|
-
* The reasoning that was generated in the final step.
|
|
6633
|
-
*
|
|
6634
|
-
* @deprecated Use `finalStep.reasoning` instead.
|
|
6635
|
-
*/
|
|
6636
|
-
readonly reasoning: StepResult<TOOLS, RUNTIME_CONTEXT>['reasoning'];
|
|
6637
|
-
/**
|
|
6638
|
-
* The reasoning text that was generated in the final step.
|
|
6639
|
-
*
|
|
6640
|
-
* @deprecated Use `finalStep.reasoningText` instead.
|
|
6641
|
-
*/
|
|
6642
|
-
readonly reasoningText: StepResult<TOOLS, RUNTIME_CONTEXT>['reasoningText'];
|
|
6643
|
-
/** Files that were generated in all steps. */
|
|
6644
|
-
readonly files: StepResult<TOOLS, RUNTIME_CONTEXT>['files'];
|
|
6645
|
-
/** Sources that were used as references in all steps. */
|
|
6646
|
-
readonly sources: StepResult<TOOLS, RUNTIME_CONTEXT>['sources'];
|
|
6647
|
-
/** Tool calls that were made in all steps. */
|
|
6648
|
-
readonly toolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['toolCalls'];
|
|
6649
|
-
/** Static tool calls that were made in all steps. */
|
|
6650
|
-
readonly staticToolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['staticToolCalls'];
|
|
6651
|
-
/** Dynamic tool calls that were made in all steps. */
|
|
6652
|
-
readonly dynamicToolCalls: StepResult<TOOLS, RUNTIME_CONTEXT>['dynamicToolCalls'];
|
|
6653
|
-
/** Tool results that were generated in all steps. */
|
|
6654
|
-
readonly toolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['toolResults'];
|
|
6655
|
-
/** Static tool results that were generated in all steps. */
|
|
6656
|
-
readonly staticToolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['staticToolResults'];
|
|
6657
|
-
/** Dynamic tool results that were generated in all steps. */
|
|
6658
|
-
readonly dynamicToolResults: StepResult<TOOLS, RUNTIME_CONTEXT>['dynamicToolResults'];
|
|
6659
|
-
/** The unified reason why the generation finished. Taken from the final step. */
|
|
6660
|
-
readonly finishReason: StepResult<TOOLS, RUNTIME_CONTEXT>['finishReason'];
|
|
6661
|
-
/** The raw reason why the generation finished. Taken from the final step. */
|
|
6662
|
-
readonly rawFinishReason: StepResult<TOOLS, RUNTIME_CONTEXT>['rawFinishReason'];
|
|
6663
|
-
/** Aggregated token usage across all steps. */
|
|
6664
|
-
readonly usage: LanguageModelUsage;
|
|
6665
|
-
/**
|
|
6666
|
-
* Aggregated token usage across all steps.
|
|
6667
|
-
*
|
|
6668
|
-
* @deprecated Use `usage` instead.
|
|
6669
|
-
*/
|
|
6670
|
-
readonly totalUsage: LanguageModelUsage;
|
|
6671
|
-
/** Warnings from the model provider in all steps. */
|
|
6672
|
-
readonly warnings: StepResult<TOOLS, RUNTIME_CONTEXT>['warnings'];
|
|
6673
|
-
/**
|
|
6674
|
-
* Additional request information from the final step.
|
|
6675
|
-
*
|
|
6676
|
-
* @deprecated Use `finalStep.request` instead.
|
|
6677
|
-
*/
|
|
6678
|
-
readonly request: StepResult<TOOLS, RUNTIME_CONTEXT>['request'];
|
|
6679
|
-
/**
|
|
6680
|
-
* Additional response information from the final step.
|
|
6681
|
-
*
|
|
6682
|
-
* @deprecated Use `finalStep.response` instead.
|
|
6683
|
-
*/
|
|
6684
|
-
readonly response: StepResult<TOOLS, RUNTIME_CONTEXT>['response'];
|
|
6685
|
-
/**
|
|
6686
|
-
* Additional provider-specific metadata from the final step.
|
|
6687
|
-
*
|
|
6688
|
-
* @deprecated Use `finalStep.providerMetadata` instead.
|
|
6689
|
-
*/
|
|
6690
|
-
readonly providerMetadata: StepResult<TOOLS, RUNTIME_CONTEXT>['providerMetadata'];
|
|
6691
|
-
/** The response messages that were generated during the call. */
|
|
6692
|
-
readonly responseMessages: ResponseMessage[];
|
|
6693
|
-
/** Array containing results from all steps in the generation. */
|
|
6694
|
-
readonly steps: StepResult<TOOLS, RUNTIME_CONTEXT>[];
|
|
6695
|
-
/** The final step. This is a shortcut for `steps.at(-1)`. */
|
|
6696
|
-
readonly finalStep: StepResult<TOOLS, RUNTIME_CONTEXT>;
|
|
6697
|
-
};
|
|
6698
|
-
|
|
6699
|
-
export declare type GenerateTextInclude = {
|
|
6700
|
-
/**
|
|
6701
|
-
* Whether to retain the request body in step results.
|
|
6702
|
-
* The request body can be large when sending images or files.
|
|
6703
|
-
*
|
|
6704
|
-
* @default false
|
|
6705
|
-
*/
|
|
6706
|
-
requestBody?: boolean;
|
|
6707
|
-
/**
|
|
6708
|
-
* Whether to retain the request messages in step results.
|
|
6709
|
-
* The request messages can be large when sending images or files.
|
|
6710
|
-
*
|
|
6711
|
-
* @default false
|
|
6712
|
-
*/
|
|
6713
|
-
requestMessages?: boolean;
|
|
6714
|
-
/**
|
|
6715
|
-
* Whether to retain the response body in step results.
|
|
6716
|
-
*
|
|
6717
|
-
* @default false
|
|
6718
|
-
*/
|
|
6719
|
-
responseBody?: boolean;
|
|
6720
|
-
};
|
|
7027
|
+
}, steeringRun: SteeringRun | undefined): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
6721
7028
|
|
|
6722
7029
|
/**
|
|
6723
7030
|
* Callback that is set using the telemetry `onAbort` option.
|
|
@@ -6768,6 +7075,24 @@ export declare type GenerateTextOnStartCallback<TOOLS extends ToolSet = ToolSet,
|
|
|
6768
7075
|
*/
|
|
6769
7076
|
export declare type GenerateTextOnStepEndCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = Callback<GenerateTextStepEndEvent<TOOLS, RUNTIME_CONTEXT>>;
|
|
6770
7077
|
|
|
7078
|
+
/**
|
|
7079
|
+
* Callback that is set using the `onStepError` option.
|
|
7080
|
+
*
|
|
7081
|
+
* Called when a step that started fails before it produces a step result:
|
|
7082
|
+
* when the provider call throws or rejects, or when the model stream ends
|
|
7083
|
+
* without output. `onStepEnd` is not called for such a step. A provider
|
|
7084
|
+
* `error` chunk does not fail the step, it still ends with `onStepEnd` and
|
|
7085
|
+
* `finishReason: 'error'`.
|
|
7086
|
+
*
|
|
7087
|
+
* In `generateText`, an abort or timeout also ends the step here. The error
|
|
7088
|
+
* is the abort or timeout error, or a provider error that has it as its
|
|
7089
|
+
* `cause`. In `streamText`, an abort or timeout ends the step
|
|
7090
|
+
* with `onAbort` instead.
|
|
7091
|
+
*
|
|
7092
|
+
* @param event - The step that failed and the error.
|
|
7093
|
+
*/
|
|
7094
|
+
export declare type GenerateTextOnStepErrorCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface> = Callback<GenerateTextStepErrorEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
7095
|
+
|
|
6771
7096
|
/**
|
|
6772
7097
|
* Callback that is set using the `onStepFinish` option.
|
|
6773
7098
|
*
|
|
@@ -6786,6 +7111,8 @@ export declare type GenerateTextOnStepFinishCallback<TOOLS extends ToolSet = Too
|
|
|
6786
7111
|
*/
|
|
6787
7112
|
export declare type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface> = Callback<GenerateTextStepStartEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
6788
7113
|
|
|
7114
|
+
declare type GenerateTextOptions<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context, OUTPUT extends OutputInterface> = Parameters<typeof generateTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0];
|
|
7115
|
+
|
|
6789
7116
|
/**
|
|
6790
7117
|
* The result of a `generateText` call.
|
|
6791
7118
|
* It contains the generated text, the tool calls that were made during the generation, and the results of the tool calls.
|
|
@@ -6969,6 +7296,17 @@ export declare type GenerateTextStartEvent<TOOLS extends ToolSet = ToolSet, RUNT
|
|
|
6969
7296
|
*/
|
|
6970
7297
|
export declare type GenerateTextStepEndEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context> = StepResult<TOOLS, RUNTIME_CONTEXT>;
|
|
6971
7298
|
|
|
7299
|
+
/**
|
|
7300
|
+
* Event passed to the `onStepError` callback.
|
|
7301
|
+
*
|
|
7302
|
+
* Contains the step start event of the step that failed before it produced
|
|
7303
|
+
* a step result, along with the error.
|
|
7304
|
+
*/
|
|
7305
|
+
export declare type GenerateTextStepErrorEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface> = GenerateTextStepStartEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT> & {
|
|
7306
|
+
/** The error that ended the step. */
|
|
7307
|
+
readonly error: unknown;
|
|
7308
|
+
};
|
|
7309
|
+
|
|
6972
7310
|
/**
|
|
6973
7311
|
* Event passed to the `onStepStart` callback.
|
|
6974
7312
|
*
|
|
@@ -8080,7 +8418,13 @@ export declare type InferSchema<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T
|
|
|
8080
8418
|
*/
|
|
8081
8419
|
export declare type InferStreamOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<any, infer PARTIAL_OUTPUT, any> ? PARTIAL_OUTPUT : never;
|
|
8082
8420
|
|
|
8083
|
-
export declare type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'
|
|
8421
|
+
export declare type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'> & {
|
|
8422
|
+
/**
|
|
8423
|
+
* The version of the `ai` package that emitted this event.
|
|
8424
|
+
* Absent in older releases.
|
|
8425
|
+
*/
|
|
8426
|
+
readonly aiVersion?: string;
|
|
8427
|
+
};
|
|
8084
8428
|
|
|
8085
8429
|
/**
|
|
8086
8430
|
* Infer the context type of a tool.
|
|
@@ -10745,9 +11089,10 @@ declare type LanguageModelV4FinishReason = {
|
|
|
10745
11089
|
* - `content-filter`: content filter violation stopped the model
|
|
10746
11090
|
* - `tool-calls`: model triggered tool calls
|
|
10747
11091
|
* - `error`: model stopped because of an error
|
|
11092
|
+
* - `interrupted`: provider stream ended without a completion signal; output may be incomplete
|
|
10748
11093
|
* - `other`: model stopped for other reasons
|
|
10749
11094
|
*/
|
|
10750
|
-
unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
11095
|
+
unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'interrupted' | 'other';
|
|
10751
11096
|
/**
|
|
10752
11097
|
* Raw finish reason from the provider.
|
|
10753
11098
|
* This is the original finish reason from the provider.
|
|
@@ -10809,6 +11154,15 @@ declare type LanguageModelV4GenerateResult = {
|
|
|
10809
11154
|
* Ordered content that the model has generated.
|
|
10810
11155
|
*/
|
|
10811
11156
|
content: Array<LanguageModelV4Content>;
|
|
11157
|
+
/**
|
|
11158
|
+
* Text to parse for structured JSON output when it differs from the
|
|
11159
|
+
* concatenation of all text parts in `content` (e.g. drafts followed by a
|
|
11160
|
+
* final answer). This does not replace or remove any generated content.
|
|
11161
|
+
*
|
|
11162
|
+
* When omitted, consumers concatenate all text parts. An empty string is
|
|
11163
|
+
* an explicit selection and must not fall back to the other text parts.
|
|
11164
|
+
*/
|
|
11165
|
+
structuredOutputText?: string;
|
|
10812
11166
|
/**
|
|
10813
11167
|
* The finish reason.
|
|
10814
11168
|
*/
|
|
@@ -11829,6 +12183,7 @@ export declare class NoSpeechGeneratedError extends AISDKError {
|
|
|
11829
12183
|
readonly responses: Array<SpeechModelResponseMetadata>;
|
|
11830
12184
|
constructor(options: {
|
|
11831
12185
|
responses: Array<SpeechModelResponseMetadata>;
|
|
12186
|
+
cause?: unknown;
|
|
11832
12187
|
});
|
|
11833
12188
|
static isInstance(error: unknown): error is NoSpeechGeneratedError;
|
|
11834
12189
|
}
|
|
@@ -12090,11 +12445,9 @@ export declare interface OutputInterface<OUTPUT = any, PARTIAL = any, ELEMENT =
|
|
|
12090
12445
|
|
|
12091
12446
|
declare interface ParallelSearchConfig {
|
|
12092
12447
|
/**
|
|
12093
|
-
*
|
|
12094
|
-
* - "one-shot": Comprehensive results with longer excerpts for single-response answers (default)
|
|
12095
|
-
* - "agentic": Concise, token-efficient results for multi-step agentic workflows
|
|
12448
|
+
* Search mode. Defaults to `basic`.
|
|
12096
12449
|
*/
|
|
12097
|
-
mode?:
|
|
12450
|
+
mode?: ParallelSearchMode;
|
|
12098
12451
|
/**
|
|
12099
12452
|
* Default maximum number of results to return (1-20).
|
|
12100
12453
|
* Defaults to 10 if not specified.
|
|
@@ -12108,15 +12461,24 @@ declare interface ParallelSearchConfig {
|
|
|
12108
12461
|
* Default excerpt configuration for controlling result length.
|
|
12109
12462
|
*/
|
|
12110
12463
|
excerpts?: ParallelSearchExcerpts;
|
|
12464
|
+
/**
|
|
12465
|
+
* Maximum total characters across all result excerpts.
|
|
12466
|
+
*/
|
|
12467
|
+
maxCharsTotal?: number;
|
|
12111
12468
|
/**
|
|
12112
12469
|
* Default fetch policy for controlling content freshness.
|
|
12113
12470
|
*/
|
|
12114
12471
|
fetchPolicy?: ParallelSearchFetchPolicy;
|
|
12472
|
+
/**
|
|
12473
|
+
* ISO 3166-1 alpha-2 country code to localize results, e.g. 'us'.
|
|
12474
|
+
* Invalid codes are ignored with a warning.
|
|
12475
|
+
*/
|
|
12476
|
+
location?: string;
|
|
12115
12477
|
}
|
|
12116
12478
|
|
|
12117
12479
|
declare interface ParallelSearchError {
|
|
12118
12480
|
/** Error type */
|
|
12119
|
-
error: 'api_error' | '
|
|
12481
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'gateway_rate_limit' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown' | 'unknown_tool';
|
|
12120
12482
|
/** HTTP status code if applicable */
|
|
12121
12483
|
statusCode?: number;
|
|
12122
12484
|
/** Human-readable error message */
|
|
@@ -12130,16 +12492,27 @@ declare interface ParallelSearchExcerpts {
|
|
|
12130
12492
|
maxCharsPerResult?: number;
|
|
12131
12493
|
/**
|
|
12132
12494
|
* Maximum total characters across all results.
|
|
12495
|
+
* @deprecated Use the top-level `maxCharsTotal` option instead.
|
|
12133
12496
|
*/
|
|
12134
12497
|
maxCharsTotal?: number;
|
|
12135
12498
|
}
|
|
12136
12499
|
|
|
12137
12500
|
declare interface ParallelSearchFetchPolicy {
|
|
12138
12501
|
/**
|
|
12139
|
-
* Maximum age in seconds
|
|
12140
|
-
*
|
|
12502
|
+
* Maximum age in seconds of cached content before a live fetch is attempted.
|
|
12503
|
+
* Minimum 600; lower values are raised to 600.
|
|
12141
12504
|
*/
|
|
12142
12505
|
maxAgeSeconds?: number;
|
|
12506
|
+
/**
|
|
12507
|
+
* Timeout in seconds for a live fetch when content is not cached.
|
|
12508
|
+
* The gateway caps it to stay within its own tool timeout.
|
|
12509
|
+
*/
|
|
12510
|
+
timeoutSeconds?: number;
|
|
12511
|
+
/**
|
|
12512
|
+
* Return an error instead of falling back to older cached content when a
|
|
12513
|
+
* live fetch fails or times out. Defaults to false.
|
|
12514
|
+
*/
|
|
12515
|
+
disableCacheFallback?: boolean;
|
|
12143
12516
|
}
|
|
12144
12517
|
|
|
12145
12518
|
declare interface ParallelSearchInput {
|
|
@@ -12150,16 +12523,13 @@ declare interface ParallelSearchInput {
|
|
|
12150
12523
|
*/
|
|
12151
12524
|
objective: string;
|
|
12152
12525
|
/**
|
|
12153
|
-
*
|
|
12154
|
-
* Maximum 200 characters per query.
|
|
12526
|
+
* 2-3 concise keyword queries, 3-6 words each (max 5, 200 characters each).
|
|
12155
12527
|
*/
|
|
12156
12528
|
search_queries?: string[];
|
|
12157
12529
|
/**
|
|
12158
|
-
*
|
|
12159
|
-
* - "one-shot": Comprehensive results with longer excerpts
|
|
12160
|
-
* - "agentic": Concise, token-efficient results for multi-step workflows
|
|
12530
|
+
* Search mode. Defaults to `basic`.
|
|
12161
12531
|
*/
|
|
12162
|
-
mode?:
|
|
12532
|
+
mode?: ParallelSearchMode;
|
|
12163
12533
|
/**
|
|
12164
12534
|
* Maximum number of results to return (1-20).
|
|
12165
12535
|
* Defaults to 10 if not specified.
|
|
@@ -12178,51 +12548,75 @@ declare interface ParallelSearchInput {
|
|
|
12178
12548
|
*/
|
|
12179
12549
|
excerpts?: {
|
|
12180
12550
|
max_chars_per_result?: number;
|
|
12551
|
+
/** @deprecated Use the top-level `max_chars_total` instead. */
|
|
12181
12552
|
max_chars_total?: number;
|
|
12182
12553
|
};
|
|
12554
|
+
/**
|
|
12555
|
+
* Maximum total characters across all result excerpts.
|
|
12556
|
+
*/
|
|
12557
|
+
max_chars_total?: number;
|
|
12183
12558
|
/**
|
|
12184
12559
|
* Fetch policy for controlling content freshness.
|
|
12185
12560
|
*/
|
|
12186
12561
|
fetch_policy?: {
|
|
12187
12562
|
max_age_seconds?: number;
|
|
12563
|
+
timeout_seconds?: number;
|
|
12564
|
+
disable_cache_fallback?: boolean;
|
|
12188
12565
|
};
|
|
12566
|
+
/**
|
|
12567
|
+
* ISO 3166-1 alpha-2 country code to localize results.
|
|
12568
|
+
*/
|
|
12569
|
+
location?: string;
|
|
12189
12570
|
}
|
|
12190
12571
|
|
|
12572
|
+
/**
|
|
12573
|
+
* Search mode. `turbo` and `fast` trade excerpt depth for latency (`turbo` is
|
|
12574
|
+
* English and Japanese only), `basic` is balanced, `advanced` is the most thorough.
|
|
12575
|
+
* Deprecated: `one-shot` (runs as `basic`) and `agentic` (runs as `advanced`).
|
|
12576
|
+
*/
|
|
12577
|
+
declare type ParallelSearchMode = (typeof parallelSearchModes)[number];
|
|
12578
|
+
|
|
12579
|
+
declare const parallelSearchModes: readonly ["turbo", "fast", "basic", "advanced", "one-shot", "agentic"];
|
|
12580
|
+
|
|
12191
12581
|
declare type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
12192
12582
|
|
|
12193
12583
|
declare interface ParallelSearchResponse {
|
|
12194
12584
|
/** Unique identifier for this search request */
|
|
12195
|
-
|
|
12196
|
-
/**
|
|
12585
|
+
search_id: string;
|
|
12586
|
+
/** Search results, ordered by decreasing relevance */
|
|
12197
12587
|
results: ParallelSearchResult[];
|
|
12588
|
+
/** Non-fatal issues with the request, such as an ignored `location` */
|
|
12589
|
+
warnings?: ParallelSearchWarning[] | null;
|
|
12590
|
+
/** Usage reported by Parallel for this search */
|
|
12591
|
+
usage?: ParallelSearchUsage[] | null;
|
|
12592
|
+
/** Session identifier shared by the searches made during one request */
|
|
12593
|
+
session_id?: string;
|
|
12198
12594
|
}
|
|
12199
12595
|
|
|
12200
12596
|
declare interface ParallelSearchResult {
|
|
12201
12597
|
/** URL of the search result */
|
|
12202
12598
|
url: string;
|
|
12203
|
-
/** Title of the
|
|
12204
|
-
title
|
|
12205
|
-
/**
|
|
12206
|
-
|
|
12207
|
-
/**
|
|
12208
|
-
|
|
12209
|
-
/** Relevance score for the result */
|
|
12210
|
-
relevanceScore?: number;
|
|
12599
|
+
/** Title of the page, if available */
|
|
12600
|
+
title?: string | null;
|
|
12601
|
+
/** Publication date of the page (YYYY-MM-DD), if available */
|
|
12602
|
+
publish_date?: string | null;
|
|
12603
|
+
/** Relevant excerpts from the page, formatted as markdown */
|
|
12604
|
+
excerpts: string[];
|
|
12211
12605
|
}
|
|
12212
12606
|
|
|
12213
12607
|
declare interface ParallelSearchSourcePolicy {
|
|
12214
12608
|
/**
|
|
12215
|
-
*
|
|
12216
|
-
* Example: ['wikipedia.org', '
|
|
12609
|
+
* Domains or domain/path prefixes to restrict results to. When set,
|
|
12610
|
+
* `excludeDomains` is ignored. Example: ['wikipedia.org', 'docs.python.org/3']
|
|
12217
12611
|
*/
|
|
12218
12612
|
includeDomains?: string[];
|
|
12219
12613
|
/**
|
|
12220
|
-
*
|
|
12221
|
-
* Example: ['reddit.com'
|
|
12614
|
+
* Domains or domain/path prefixes to exclude from results.
|
|
12615
|
+
* Example: ['reddit.com']
|
|
12222
12616
|
*/
|
|
12223
12617
|
excludeDomains?: string[];
|
|
12224
12618
|
/**
|
|
12225
|
-
* Only include results published after this date (
|
|
12619
|
+
* Only include results published on or after this date (YYYY-MM-DD).
|
|
12226
12620
|
* Example: '2024-01-01'
|
|
12227
12621
|
*/
|
|
12228
12622
|
afterDate?: string;
|
|
@@ -12230,6 +12624,22 @@ declare interface ParallelSearchSourcePolicy {
|
|
|
12230
12624
|
|
|
12231
12625
|
declare const parallelSearchToolFactory: ProviderExecutedToolFactory<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig, {}>;
|
|
12232
12626
|
|
|
12627
|
+
declare interface ParallelSearchUsage {
|
|
12628
|
+
/** Usage item name, e.g. 'sku_search' */
|
|
12629
|
+
name: string;
|
|
12630
|
+
/** Count for the usage item */
|
|
12631
|
+
count?: number;
|
|
12632
|
+
}
|
|
12633
|
+
|
|
12634
|
+
declare interface ParallelSearchWarning {
|
|
12635
|
+
/** Warning type, e.g. 'input_validation_warning'. New types may be added. */
|
|
12636
|
+
type: string;
|
|
12637
|
+
/** Human-readable message */
|
|
12638
|
+
message: string;
|
|
12639
|
+
/** Optional detail supporting the warning */
|
|
12640
|
+
detail?: Record<string, unknown> | null;
|
|
12641
|
+
}
|
|
12642
|
+
|
|
12233
12643
|
/**
|
|
12234
12644
|
* Parses a JSON event stream into a stream of parsed JSON objects.
|
|
12235
12645
|
*/
|
|
@@ -12407,6 +12817,7 @@ declare const perplexitySearchToolFactory: ProviderExecutedToolFactory<Perplexit
|
|
|
12407
12817
|
* @param abortSignal - Abort signal. Optional.
|
|
12408
12818
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
12409
12819
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
12820
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
12410
12821
|
* @param options - The options for the agent. Optional.
|
|
12411
12822
|
* @param experimental_transform - Stream transformations. Optional.
|
|
12412
12823
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -12430,6 +12841,7 @@ export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS
|
|
|
12430
12841
|
abortSignal?: AbortSignal;
|
|
12431
12842
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
12432
12843
|
experimental_sandbox?: Experimental_SandboxSession;
|
|
12844
|
+
experimental_steering?: Experimental_Steering;
|
|
12433
12845
|
options?: CALL_OPTIONS;
|
|
12434
12846
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
12435
12847
|
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<void>;
|
|
@@ -12522,6 +12934,7 @@ export declare type PrepareSendMessagesRequest<UI_MESSAGE extends UIMessage> = (
|
|
|
12522
12934
|
* @param options.messages - The messages that will be sent to the model for the current step. If you return a `messages` override, those messages carry forward to later steps.
|
|
12523
12935
|
* @param options.initialMessages - The initial messages that were passed into generateText or streamText.
|
|
12524
12936
|
* @param options.responseMessages - The response messages that have been accumulated from previous steps.
|
|
12937
|
+
* @param options.experimental_steeringMessages - The steering messages that were added to `messages` for the current step.
|
|
12525
12938
|
* @param options.runtimeContext - The user-defined runtime context.
|
|
12526
12939
|
*
|
|
12527
12940
|
* @returns An object that contains the settings for the step.
|
|
@@ -12561,6 +12974,15 @@ export declare type PrepareStepFunction<TOOLS extends ToolSet, RUNTIME_CONTEXT e
|
|
|
12561
12974
|
* The response messages that have been accumulated from all previous steps.
|
|
12562
12975
|
*/
|
|
12563
12976
|
responseMessages: Array<ResponseMessage>;
|
|
12977
|
+
/**
|
|
12978
|
+
* The user messages that were sent with `experimental_steering` and added to
|
|
12979
|
+
* `messages` for the current step. Undefined when the step received no
|
|
12980
|
+
* steering messages. `messages` already contains them. If you return a
|
|
12981
|
+
* `messages` override that is rebuilt from other fields, e.g.
|
|
12982
|
+
* `initialMessages` and `responseMessages`, add them back together with the
|
|
12983
|
+
* steering messages of previous steps from `steps`.
|
|
12984
|
+
*/
|
|
12985
|
+
experimental_steeringMessages?: Array<UserModelMessage>;
|
|
12564
12986
|
/**
|
|
12565
12987
|
* Tool context.
|
|
12566
12988
|
*/
|
|
@@ -13120,20 +13542,6 @@ export declare function pruneMessages({ messages, reasoning, toolCalls, emptyMes
|
|
|
13120
13542
|
emptyMessages?: 'keep' | 'remove';
|
|
13121
13543
|
}): ModelMessage[];
|
|
13122
13544
|
|
|
13123
|
-
/**
|
|
13124
|
-
* Options for reading a file from the sandbox.
|
|
13125
|
-
*/
|
|
13126
|
-
declare type ReadFileOptions = {
|
|
13127
|
-
/**
|
|
13128
|
-
* Path of the file to read.
|
|
13129
|
-
*/
|
|
13130
|
-
path: string;
|
|
13131
|
-
/**
|
|
13132
|
-
* Signal that can be used to abort the read.
|
|
13133
|
-
*/
|
|
13134
|
-
abortSignal?: AbortSignal;
|
|
13135
|
-
};
|
|
13136
|
-
|
|
13137
13545
|
/**
|
|
13138
13546
|
* Transforms a stream of `UIMessageChunk`s into an `AsyncIterableStream` of `UIMessage`s.
|
|
13139
13547
|
*
|
|
@@ -14498,30 +14906,87 @@ export declare type SafeValidateWebSocketChatTransportRequestResult<UI_MESSAGE e
|
|
|
14498
14906
|
error: Error;
|
|
14499
14907
|
};
|
|
14500
14908
|
|
|
14501
|
-
/**
|
|
14502
|
-
* Options for executing a command in the sandbox via `run` or `spawn`.
|
|
14503
|
-
*/
|
|
14504
|
-
declare type SandboxProcessOptions = {
|
|
14909
|
+
/**
|
|
14910
|
+
* Options for executing a command in the sandbox via `run` or `spawn`.
|
|
14911
|
+
*/
|
|
14912
|
+
declare type SandboxProcessOptions = {
|
|
14913
|
+
/**
|
|
14914
|
+
* Command to execute in the sandbox.
|
|
14915
|
+
*/
|
|
14916
|
+
command: string;
|
|
14917
|
+
/**
|
|
14918
|
+
* Working directory to execute the command in.
|
|
14919
|
+
*/
|
|
14920
|
+
workingDirectory?: string;
|
|
14921
|
+
/**
|
|
14922
|
+
* Environment variables to set for this command. Merged with the
|
|
14923
|
+
* sandbox's default environment; values here take precedence.
|
|
14924
|
+
* Supporting environment variables as an option is preferable from a
|
|
14925
|
+
* security perspective, e.g. to avoid them leaking in logs.
|
|
14926
|
+
*/
|
|
14927
|
+
env?: Record<string, string>;
|
|
14928
|
+
/**
|
|
14929
|
+
* Signal that can be used to abort the command. When aborted, the running
|
|
14930
|
+
* process is killed; for `spawn`, `wait()` rejects with the abort reason.
|
|
14931
|
+
*/
|
|
14932
|
+
abortSignal?: AbortSignal;
|
|
14933
|
+
};
|
|
14934
|
+
|
|
14935
|
+
declare type SandboxReadBinaryFileOptions = SandboxReadFileOptions;
|
|
14936
|
+
|
|
14937
|
+
/**
|
|
14938
|
+
* Options for reading a file from the sandbox.
|
|
14939
|
+
*/
|
|
14940
|
+
declare type SandboxReadFileOptions = {
|
|
14941
|
+
/**
|
|
14942
|
+
* Path of the file to read.
|
|
14943
|
+
*/
|
|
14944
|
+
path: string;
|
|
14945
|
+
/**
|
|
14946
|
+
* Signal that can be used to abort the read.
|
|
14947
|
+
*/
|
|
14948
|
+
abortSignal?: AbortSignal;
|
|
14949
|
+
};
|
|
14950
|
+
|
|
14951
|
+
declare type SandboxReadTextFileOptions = SandboxReadFileOptions & {
|
|
14505
14952
|
/**
|
|
14506
|
-
*
|
|
14953
|
+
* Text encoding used to decode the file bytes. Defaults to `"utf-8"`.
|
|
14507
14954
|
*/
|
|
14508
|
-
|
|
14955
|
+
encoding?: string;
|
|
14509
14956
|
/**
|
|
14510
|
-
*
|
|
14957
|
+
* 1-based inclusive start line. Defaults to 1.
|
|
14511
14958
|
*/
|
|
14512
|
-
|
|
14959
|
+
startLine?: number;
|
|
14513
14960
|
/**
|
|
14514
|
-
*
|
|
14515
|
-
*
|
|
14516
|
-
* Supporting environment variables as an option is preferable from a
|
|
14517
|
-
* security perspective, e.g. to avoid them leaking in logs.
|
|
14961
|
+
* 1-based inclusive end line. When past the file's line count, the read
|
|
14962
|
+
* returns through EOF without error.
|
|
14518
14963
|
*/
|
|
14519
|
-
|
|
14964
|
+
endLine?: number;
|
|
14965
|
+
};
|
|
14966
|
+
|
|
14967
|
+
declare type SandboxRunOptions = SandboxProcessOptions;
|
|
14968
|
+
|
|
14969
|
+
declare type SandboxSpawnOptions = SandboxProcessOptions & {
|
|
14970
|
+
stdin?: boolean;
|
|
14971
|
+
};
|
|
14972
|
+
|
|
14973
|
+
declare type SandboxSpawnOptionsWithoutStdin = SandboxProcessOptions & {
|
|
14974
|
+
stdin?: false;
|
|
14975
|
+
};
|
|
14976
|
+
|
|
14977
|
+
declare type SandboxSpawnOptionsWithStdin = SandboxProcessOptions & {
|
|
14978
|
+
stdin: true;
|
|
14979
|
+
};
|
|
14980
|
+
|
|
14981
|
+
declare type SandboxWriteBinaryFileOptions = WriteFileOptions<Uint8Array>;
|
|
14982
|
+
|
|
14983
|
+
declare type SandboxWriteFileOptions = WriteFileOptions<ReadableStream<Uint8Array>>;
|
|
14984
|
+
|
|
14985
|
+
declare type SandboxWriteTextFileOptions = WriteFileOptions<string> & {
|
|
14520
14986
|
/**
|
|
14521
|
-
*
|
|
14522
|
-
* process is killed; for `spawn`, `wait()` rejects with the abort reason.
|
|
14987
|
+
* Text encoding used to encode the string to bytes. Defaults to `"utf-8"`.
|
|
14523
14988
|
*/
|
|
14524
|
-
|
|
14989
|
+
encoding?: string;
|
|
14525
14990
|
};
|
|
14526
14991
|
|
|
14527
14992
|
export declare type Schema<OBJECT = unknown> = {
|
|
@@ -15411,7 +15876,7 @@ declare type SpeechModelV4CallOptions = {
|
|
|
15411
15876
|
* }
|
|
15412
15877
|
* ```
|
|
15413
15878
|
*/
|
|
15414
|
-
providerOptions?: SpeechModelV4ProviderOptions;
|
|
15879
|
+
providerOptions?: SpeechModelV4ProviderOptions$1;
|
|
15415
15880
|
/**
|
|
15416
15881
|
* Abort signal for cancelling the operation.
|
|
15417
15882
|
*/
|
|
@@ -15423,6 +15888,8 @@ declare type SpeechModelV4CallOptions = {
|
|
|
15423
15888
|
headers?: Record<string, string | undefined>;
|
|
15424
15889
|
};
|
|
15425
15890
|
|
|
15891
|
+
declare type SpeechModelV4ProviderOptions$1 = Record<string, JSONObject>;
|
|
15892
|
+
|
|
15426
15893
|
declare type SpeechModelV4ProviderOptions = Record<string, JSONObject>;
|
|
15427
15894
|
|
|
15428
15895
|
/**
|
|
@@ -15484,6 +15951,234 @@ declare type SpeechModelV4Result = {
|
|
|
15484
15951
|
providerMetadata?: Record<string, JSONObject>;
|
|
15485
15952
|
};
|
|
15486
15953
|
|
|
15954
|
+
/**
|
|
15955
|
+
* Options for a speech model stream call.
|
|
15956
|
+
*/
|
|
15957
|
+
declare type SpeechModelV4StreamOptions = {
|
|
15958
|
+
/**
|
|
15959
|
+
* Text to convert to speech, as a stream of text parts.
|
|
15960
|
+
*
|
|
15961
|
+
* Parts are synthesized in order. Providers with an incremental text
|
|
15962
|
+
* input transport forward text as it arrives; providers that only accept
|
|
15963
|
+
* complete text read the stream to completion before synthesis. The end of
|
|
15964
|
+
* the stream signals the end of the input text. A part's optional `voice`
|
|
15965
|
+
* selects its speaker on providers that support several voices.
|
|
15966
|
+
*
|
|
15967
|
+
* The provider owns the stream once `doStream` is called. It must release
|
|
15968
|
+
* it in every terminal path: cancel it (or its locked reader) when the
|
|
15969
|
+
* abort signal fires, when the consumer cancels the returned stream, when
|
|
15970
|
+
* setup fails before or after the stream is locked, and when the provider
|
|
15971
|
+
* fails. Leaving it unread and uncancelled keeps the caller's text producer
|
|
15972
|
+
* running indefinitely. After a normal finish the stream is fully read.
|
|
15973
|
+
*/
|
|
15974
|
+
text: ReadableStream<SpeechModelV4StreamTextPart>;
|
|
15975
|
+
/**
|
|
15976
|
+
* The voice to use for speech synthesis.
|
|
15977
|
+
* This is provider-specific and may be a voice ID, name, or other identifier.
|
|
15978
|
+
*/
|
|
15979
|
+
voice?: string;
|
|
15980
|
+
/**
|
|
15981
|
+
* The desired format of the output audio chunks, e.g.
|
|
15982
|
+
* `{ type: 'audio/pcm', rate: 24000 }` or `{ type: 'audio/mpeg' }`.
|
|
15983
|
+
* When absent, the provider default format is used.
|
|
15984
|
+
*/
|
|
15985
|
+
outputFormat?: SharedV4AudioFormat;
|
|
15986
|
+
/**
|
|
15987
|
+
* Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
15988
|
+
*/
|
|
15989
|
+
instructions?: string;
|
|
15990
|
+
/**
|
|
15991
|
+
* The speed of the speech generation.
|
|
15992
|
+
*/
|
|
15993
|
+
speed?: number;
|
|
15994
|
+
/**
|
|
15995
|
+
* The language for speech generation. This should be an ISO 639-1 language code (e.g. "en", "es", "fr")
|
|
15996
|
+
* or "auto" for automatic language detection. Provider support varies.
|
|
15997
|
+
*/
|
|
15998
|
+
language?: string;
|
|
15999
|
+
/**
|
|
16000
|
+
* Additional provider-specific options that are passed through to the provider.
|
|
16001
|
+
*
|
|
16002
|
+
* The outer record is keyed by the provider name, and the inner record is keyed
|
|
16003
|
+
* by provider-specific option names.
|
|
16004
|
+
*/
|
|
16005
|
+
providerOptions?: SpeechModelV4ProviderOptions;
|
|
16006
|
+
/**
|
|
16007
|
+
* Abort signal for cancelling the operation.
|
|
16008
|
+
*/
|
|
16009
|
+
abortSignal?: AbortSignal;
|
|
16010
|
+
/**
|
|
16011
|
+
* Additional HTTP headers to be sent with the request.
|
|
16012
|
+
* Only applicable for HTTP/WebSocket-based providers that support headers.
|
|
16013
|
+
*/
|
|
16014
|
+
headers?: Record<string, string | undefined>;
|
|
16015
|
+
/**
|
|
16016
|
+
* When true, providers should include raw provider chunks in the stream.
|
|
16017
|
+
*/
|
|
16018
|
+
includeRawChunks?: boolean;
|
|
16019
|
+
};
|
|
16020
|
+
|
|
16021
|
+
declare type SpeechModelV4StreamPart = {
|
|
16022
|
+
/**
|
|
16023
|
+
* Stream start event with warnings for the call, e.g. unsupported settings.
|
|
16024
|
+
*/
|
|
16025
|
+
type: 'stream-start';
|
|
16026
|
+
warnings: Array<SharedV4Warning>;
|
|
16027
|
+
} | {
|
|
16028
|
+
/**
|
|
16029
|
+
* Output audio chunk, in generation order. Chunks are not necessarily
|
|
16030
|
+
* standalone files; concatenate them to reconstruct the audio.
|
|
16031
|
+
*
|
|
16032
|
+
* `Uint8Array` chunks contain raw audio bytes. `string` chunks contain
|
|
16033
|
+
* base64-encoded raw audio bytes.
|
|
16034
|
+
*
|
|
16035
|
+
* A chunk may be empty when it only carries `providerMetadata` for a
|
|
16036
|
+
* point in the audio, e.g. a provider's end-of-turn marker.
|
|
16037
|
+
*/
|
|
16038
|
+
type: 'audio';
|
|
16039
|
+
/**
|
|
16040
|
+
* Optional provider identifier for the chunk.
|
|
16041
|
+
*/
|
|
16042
|
+
id?: string;
|
|
16043
|
+
audio: Uint8Array | string;
|
|
16044
|
+
/**
|
|
16045
|
+
* Format of the audio chunk, e.g. `{ type: 'audio/mpeg' }` or
|
|
16046
|
+
* `{ type: 'audio/pcm', rate: 24000 }`.
|
|
16047
|
+
*/
|
|
16048
|
+
audioFormat: SharedV4AudioFormat;
|
|
16049
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
16050
|
+
} | {
|
|
16051
|
+
/**
|
|
16052
|
+
* Metadata for the response, emitted once available.
|
|
16053
|
+
*/
|
|
16054
|
+
type: 'response-metadata';
|
|
16055
|
+
timestamp?: Date;
|
|
16056
|
+
modelId?: string;
|
|
16057
|
+
headers?: SharedV4Headers;
|
|
16058
|
+
body?: unknown;
|
|
16059
|
+
} | {
|
|
16060
|
+
/**
|
|
16061
|
+
* Metadata that is available after the stream is finished. Emitted
|
|
16062
|
+
* exactly once, after all audio chunks.
|
|
16063
|
+
*/
|
|
16064
|
+
type: 'finish';
|
|
16065
|
+
/**
|
|
16066
|
+
* Usage information for the call, if known.
|
|
16067
|
+
*/
|
|
16068
|
+
usage?: SpeechModelV4StreamUsage;
|
|
16069
|
+
/**
|
|
16070
|
+
* Additional provider-specific metadata.
|
|
16071
|
+
*/
|
|
16072
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
16073
|
+
} | {
|
|
16074
|
+
/**
|
|
16075
|
+
* Raw provider chunks if enabled.
|
|
16076
|
+
*/
|
|
16077
|
+
type: 'raw';
|
|
16078
|
+
rawValue: unknown;
|
|
16079
|
+
} | {
|
|
16080
|
+
/**
|
|
16081
|
+
* A non-fatal error; the stream continues and may carry more of them.
|
|
16082
|
+
* Providers signal an unrecoverable failure by erroring the stream, or
|
|
16083
|
+
* by closing it without a `finish` part.
|
|
16084
|
+
*/
|
|
16085
|
+
type: 'error';
|
|
16086
|
+
error: unknown;
|
|
16087
|
+
};
|
|
16088
|
+
|
|
16089
|
+
/**
|
|
16090
|
+
* The result of a speech model doStream call.
|
|
16091
|
+
*/
|
|
16092
|
+
declare type SpeechModelV4StreamResult = {
|
|
16093
|
+
/**
|
|
16094
|
+
* The stream.
|
|
16095
|
+
*/
|
|
16096
|
+
stream: ReadableStream<SpeechModelV4StreamPart>;
|
|
16097
|
+
/**
|
|
16098
|
+
* Optional request information for telemetry and debugging purposes.
|
|
16099
|
+
*/
|
|
16100
|
+
request?: {
|
|
16101
|
+
/**
|
|
16102
|
+
* Request body or setup payload that was sent to the provider API.
|
|
16103
|
+
*/
|
|
16104
|
+
body?: unknown;
|
|
16105
|
+
};
|
|
16106
|
+
/**
|
|
16107
|
+
* Optional response data.
|
|
16108
|
+
*/
|
|
16109
|
+
response?: {
|
|
16110
|
+
/**
|
|
16111
|
+
* Timestamp for the start of the streamed response.
|
|
16112
|
+
*/
|
|
16113
|
+
timestamp?: Date;
|
|
16114
|
+
/**
|
|
16115
|
+
* The ID of the response model that was used to generate the response.
|
|
16116
|
+
*/
|
|
16117
|
+
modelId?: string;
|
|
16118
|
+
/**
|
|
16119
|
+
* Response headers.
|
|
16120
|
+
*/
|
|
16121
|
+
headers?: SharedV4Headers;
|
|
16122
|
+
/**
|
|
16123
|
+
* Response body.
|
|
16124
|
+
*/
|
|
16125
|
+
body?: unknown;
|
|
16126
|
+
};
|
|
16127
|
+
};
|
|
16128
|
+
|
|
16129
|
+
/**
|
|
16130
|
+
* One piece of streamed input text. Consecutive parts are synthesized in
|
|
16131
|
+
* order as one continuous script.
|
|
16132
|
+
*/
|
|
16133
|
+
declare type SpeechModelV4StreamTextPart = {
|
|
16134
|
+
type: 'text';
|
|
16135
|
+
/**
|
|
16136
|
+
* The text to synthesize. Parts may split anywhere, including mid-word.
|
|
16137
|
+
*/
|
|
16138
|
+
text: string;
|
|
16139
|
+
/**
|
|
16140
|
+
* The voice that speaks this part. Like the call's `voice`, the value is
|
|
16141
|
+
* provider-specific (a voice ID, name, or other identifier). Defaults to the
|
|
16142
|
+
* call's `voice` (or the provider's default voice). Providers that support
|
|
16143
|
+
* several voices per stream (e.g. dialogue) switch speakers when it changes.
|
|
16144
|
+
* Single-voice providers fail the stream (error it) when a part's voice
|
|
16145
|
+
* differs from the voice of the call.
|
|
16146
|
+
*/
|
|
16147
|
+
voice?: string;
|
|
16148
|
+
/**
|
|
16149
|
+
* Additional provider-specific options for this part, keyed by provider
|
|
16150
|
+
* name (e.g. to start a new speaker turn without changing the voice).
|
|
16151
|
+
*/
|
|
16152
|
+
providerOptions?: SharedV4ProviderOptions;
|
|
16153
|
+
};
|
|
16154
|
+
|
|
16155
|
+
/**
|
|
16156
|
+
* Usage information for a speech stream call.
|
|
16157
|
+
*
|
|
16158
|
+
* All fields are optional because providers bill speech with different
|
|
16159
|
+
* units (input characters, text tokens, and/or audio tokens).
|
|
16160
|
+
*/
|
|
16161
|
+
declare type SpeechModelV4StreamUsage = {
|
|
16162
|
+
/**
|
|
16163
|
+
* Number of input text characters (Unicode code points) that were sent
|
|
16164
|
+
* for synthesis, if known. Character-billed providers report this.
|
|
16165
|
+
*/
|
|
16166
|
+
inputCharacters?: number;
|
|
16167
|
+
/**
|
|
16168
|
+
* Number of input text tokens, if reported.
|
|
16169
|
+
*/
|
|
16170
|
+
inputTokens?: number;
|
|
16171
|
+
/**
|
|
16172
|
+
* Number of output audio tokens, if reported.
|
|
16173
|
+
*/
|
|
16174
|
+
outputTokens?: number;
|
|
16175
|
+
/**
|
|
16176
|
+
* Raw usage information from the provider, in the shape the provider
|
|
16177
|
+
* returns it.
|
|
16178
|
+
*/
|
|
16179
|
+
raw?: JSONObject;
|
|
16180
|
+
};
|
|
16181
|
+
|
|
15487
16182
|
/**
|
|
15488
16183
|
* The result of a `generateSpeech` call.
|
|
15489
16184
|
* It contains the audio data and additional information.
|
|
@@ -15984,7 +16679,7 @@ export declare interface StartVideoResult {
|
|
|
15984
16679
|
* A tool call whose `toolName` maps to a tool in the declared tool set,
|
|
15985
16680
|
* with an `input` type inferred from that tool's input schema.
|
|
15986
16681
|
*/
|
|
15987
|
-
export declare type StaticToolCall<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16682
|
+
export declare type StaticToolCall<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolCall & {
|
|
15988
16683
|
toolName: NAME & string;
|
|
15989
16684
|
input: InferToolInput<TOOLS[NAME]>;
|
|
15990
16685
|
dynamic?: false | undefined;
|
|
@@ -15993,7 +16688,7 @@ export declare type StaticToolCall<TOOLS extends ToolSet> = ValueOf<{ [NAME in k
|
|
|
15993
16688
|
title?: string;
|
|
15994
16689
|
}; }>;
|
|
15995
16690
|
|
|
15996
|
-
export declare type StaticToolError<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16691
|
+
export declare type StaticToolError<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
15997
16692
|
type: 'tool-error';
|
|
15998
16693
|
toolCallId: string;
|
|
15999
16694
|
toolName: NAME & string;
|
|
@@ -16012,7 +16707,7 @@ export declare type StaticToolError<TOOLS extends ToolSet> = ValueOf<{ [NAME in
|
|
|
16012
16707
|
* Each union member preserves the link between `toolCall.toolName`, the
|
|
16013
16708
|
* corresponding validated `toolContext`, and the tool execution result.
|
|
16014
16709
|
*/
|
|
16015
|
-
declare type StaticToolExecutionEndEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16710
|
+
declare type StaticToolExecutionEndEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolExecutionEndFields & {
|
|
16016
16711
|
readonly toolCall: Extract<StaticToolCall<TOOLS>, {
|
|
16017
16712
|
toolName: NAME;
|
|
16018
16713
|
}>;
|
|
@@ -16026,7 +16721,7 @@ declare type StaticToolExecutionEndEvent<TOOLS extends ToolSet> = ValueOf<{ [NAM
|
|
|
16026
16721
|
* Each union member ties a specific `toolCall.toolName` to that tool's
|
|
16027
16722
|
* validated `toolContext` type.
|
|
16028
16723
|
*/
|
|
16029
|
-
declare type StaticToolExecutionStartEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16724
|
+
declare type StaticToolExecutionStartEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolExecutionStartFields & {
|
|
16030
16725
|
readonly toolCall: Extract<StaticToolCall<TOOLS>, {
|
|
16031
16726
|
toolName: NAME;
|
|
16032
16727
|
}>;
|
|
@@ -16036,7 +16731,7 @@ declare type StaticToolExecutionStartEvent<TOOLS extends ToolSet> = ValueOf<{ [N
|
|
|
16036
16731
|
/**
|
|
16037
16732
|
* Tool output when the tool execution has been denied (for static tools).
|
|
16038
16733
|
*/
|
|
16039
|
-
export declare type StaticToolOutputDenied<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16734
|
+
export declare type StaticToolOutputDenied<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
16040
16735
|
type: 'tool-output-denied';
|
|
16041
16736
|
toolCallId: string;
|
|
16042
16737
|
toolName: NAME & string;
|
|
@@ -16044,7 +16739,7 @@ export declare type StaticToolOutputDenied<TOOLS extends ToolSet> = ValueOf<{ [N
|
|
|
16044
16739
|
dynamic?: false | undefined;
|
|
16045
16740
|
}; }>;
|
|
16046
16741
|
|
|
16047
|
-
export declare type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16742
|
+
export declare type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
16048
16743
|
type: 'tool-result';
|
|
16049
16744
|
toolCallId: string;
|
|
16050
16745
|
toolName: NAME & string;
|
|
@@ -16058,6 +16753,27 @@ export declare type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{ [NAME in
|
|
|
16058
16753
|
title?: string;
|
|
16059
16754
|
}; }>;
|
|
16060
16755
|
|
|
16756
|
+
/**
|
|
16757
|
+
* The run side of a steering object.
|
|
16758
|
+
*/
|
|
16759
|
+
declare type SteeringRun = {
|
|
16760
|
+
hasPendingMessages(): boolean;
|
|
16761
|
+
/**
|
|
16762
|
+
* Takes the waiting messages for the next step. They are resolved by
|
|
16763
|
+
* `resolveTakenMessages` once the prompt of the step is known.
|
|
16764
|
+
*/
|
|
16765
|
+
takeMessages(): Array<UserModelMessage>;
|
|
16766
|
+
/**
|
|
16767
|
+
* Resolves the taken messages as delivered when they are part of the
|
|
16768
|
+
* messages that are sent to the model, and returns the delivered messages.
|
|
16769
|
+
*/
|
|
16770
|
+
resolveTakenMessages(options: {
|
|
16771
|
+
stepNumber: number;
|
|
16772
|
+
sentMessages: ReadonlyArray<ModelMessage>;
|
|
16773
|
+
}): Array<UserModelMessage>;
|
|
16774
|
+
end(reason: Experimental_SteeringNotDeliveredReason): void;
|
|
16775
|
+
};
|
|
16776
|
+
|
|
16061
16777
|
/**
|
|
16062
16778
|
* The result of a single step in the generation process.
|
|
16063
16779
|
*/
|
|
@@ -16173,6 +16889,12 @@ export declare type StepResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Co
|
|
|
16173
16889
|
* results that can be fully encapsulated in the provider.
|
|
16174
16890
|
*/
|
|
16175
16891
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
16892
|
+
/**
|
|
16893
|
+
* The user messages that were sent with `experimental_steering` and added
|
|
16894
|
+
* to the input of this step. Undefined when the step received no steering
|
|
16895
|
+
* messages.
|
|
16896
|
+
*/
|
|
16897
|
+
readonly experimental_steeringMessages?: Array<UserModelMessage>;
|
|
16176
16898
|
};
|
|
16177
16899
|
|
|
16178
16900
|
/**
|
|
@@ -16264,6 +16986,20 @@ export declare type StopCondition<TOOLS extends ToolSet, RUNTIME_CONTEXT extends
|
|
|
16264
16986
|
steps: Array<StepResult<TOOLS, RUNTIME_CONTEXT>>;
|
|
16265
16987
|
}) => PromiseLike<boolean> | boolean;
|
|
16266
16988
|
|
|
16989
|
+
/**
|
|
16990
|
+
* A speech model that can also stream speech audio for streamed text input.
|
|
16991
|
+
*
|
|
16992
|
+
* Experimental: kept separate from the stable `SpeechModelV4` contract while
|
|
16993
|
+
* `experimental_streamSpeech` is experimental, and may change in patch
|
|
16994
|
+
* releases. Exported with an `Experimental_` prefix.
|
|
16995
|
+
*/
|
|
16996
|
+
declare type StreamingSpeechModelV4 = SpeechModelV4 & {
|
|
16997
|
+
/**
|
|
16998
|
+
* Streams speech audio for streamed text input.
|
|
16999
|
+
*/
|
|
17000
|
+
doStream(options: SpeechModelV4StreamOptions): PromiseLike<SpeechModelV4StreamResult>;
|
|
17001
|
+
};
|
|
17002
|
+
|
|
16267
17003
|
/**
|
|
16268
17004
|
* Generate a structured, typed object for a given prompt and schema using a language model.
|
|
16269
17005
|
*
|
|
@@ -16651,11 +17387,10 @@ export declare class StreamProviderError extends AISDKError {
|
|
|
16651
17387
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
16652
17388
|
*
|
|
16653
17389
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
17390
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
16654
17391
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
16655
17392
|
* @param experimental_refineToolInput - Optional mapping of tool names to functions that refine parsed tool inputs before tools are executed and before outputs, callbacks, and telemetry are recorded.
|
|
16656
17393
|
*
|
|
16657
|
-
* @param experimental_lowMemory - Consume the stream once without replay or final-content getters. Default: false.
|
|
16658
|
-
*
|
|
16659
17394
|
* @param onChunk - Callback that is called for each chunk of the stream. The stream processing will pause until the callback promise is resolved.
|
|
16660
17395
|
* @param onError - Callback that is called when an error occurs during streaming. You can use it to log errors.
|
|
16661
17396
|
* @param onStart - Callback invoked when generation begins, before any LLM calls.
|
|
@@ -16671,6 +17406,7 @@ export declare class StreamProviderError extends AISDKError {
|
|
|
16671
17406
|
* @param onToolExecutionEnd - Callback invoked after each tool execution completes.
|
|
16672
17407
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
16673
17408
|
* @param onStepEnd - Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
17409
|
+
* @param onStepError - Callback that is called when a step that started fails before it produces a step result, i.e. when the provider call throws or rejects, or when the model stream ends without output. A provider `error` chunk still ends the step with `onStepEnd`, and an abort or timeout ends it with `onAbort`.
|
|
16674
17410
|
* @param onStepFinish - Deprecated alias for `onStepEnd`.
|
|
16675
17411
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
16676
17412
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
@@ -16678,15 +17414,7 @@ export declare class StreamProviderError extends AISDKError {
|
|
|
16678
17414
|
* @returns
|
|
16679
17415
|
* A result object for accessing different stream types and additional information.
|
|
16680
17416
|
*/
|
|
16681
|
-
export declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>
|
|
16682
|
-
experimental_lowMemory?: false;
|
|
16683
|
-
}): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
16684
|
-
|
|
16685
|
-
export declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT> & {
|
|
16686
|
-
experimental_lowMemory: true;
|
|
16687
|
-
}): StreamTextSingleConsumerResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
16688
|
-
|
|
16689
|
-
export declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT> | StreamTextSingleConsumerResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
17417
|
+
export declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
16690
17418
|
|
|
16691
17419
|
export declare type StreamTextEndEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface> = GenerateTextEndEvent<TOOLS, RUNTIME_CONTEXT> & {
|
|
16692
17420
|
/**
|
|
@@ -16725,7 +17453,7 @@ export declare type StreamTextInclude = {
|
|
|
16725
17453
|
rawChunks?: boolean;
|
|
16726
17454
|
};
|
|
16727
17455
|
|
|
16728
|
-
declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>({ model, tools, toolChoice, instructions, system, prompt, messages, allowSystemInMessages, maxRetries, streamRetries, abortSignal, timeout, headers, stopWhen, experimental_sandbox: sandbox, output, toolApproval, experimental_toolCallers, experimental_toolApprovalSecret, experimental_telemetry, telemetry, prepareStep, providerOptions, activeTools, toolOrder, toolCallConcurrency, experimental_repairToolCall, repairToolCall, experimental_refineToolInput: refineToolInput, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError: onErrorArg, onFinish, onEnd, onAbort, onStepEnd, onStepFinish, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onLanguageModelCallStart, experimental_onLanguageModelCallStart, onLanguageModelCallEnd, experimental_onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, experimental_onToolCallStart, experimental_onToolCallFinish, runtimeContext, toolsContext, experimental_include, include, _internal: { now, generateId, generateCallId, retention }, ...settings }: LanguageModelCallOptions & RequestOptions<TOOLS> & Prompt & ToolsContextParameter<TOOLS> & {
|
|
17456
|
+
declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>({ model, tools, toolChoice, instructions, system, prompt, messages, allowSystemInMessages, maxRetries, streamRetries, abortSignal, timeout, headers, stopWhen, experimental_sandbox: sandbox, output, toolApproval, experimental_toolCallers, experimental_toolApprovalSecret, experimental_telemetry, telemetry, prepareStep, providerOptions, activeTools, toolOrder, toolCallConcurrency, experimental_repairToolCall, repairToolCall, experimental_refineToolInput: refineToolInput, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError: onErrorArg, onFinish, onEnd, onAbort, onStepEnd, onStepError, onStepFinish, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onLanguageModelCallStart, experimental_onLanguageModelCallStart, onLanguageModelCallEnd, experimental_onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, experimental_onToolCallStart, experimental_onToolCallFinish, runtimeContext, toolsContext, experimental_include, include, _internal: { now, generateId, generateCallId, retention }, ...settings }: LanguageModelCallOptions & RequestOptions<TOOLS> & Prompt & ToolsContextParameter<TOOLS> & {
|
|
16729
17457
|
/**
|
|
16730
17458
|
* The language model to use.
|
|
16731
17459
|
*/
|
|
@@ -16761,6 +17489,12 @@ declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT exten
|
|
|
16761
17489
|
* The sandbox environment that is passed through to tool execution.
|
|
16762
17490
|
*/
|
|
16763
17491
|
experimental_sandbox?: Experimental_SandboxSession;
|
|
17492
|
+
/**
|
|
17493
|
+
* A steering object created with `experimental_createSteering()`.
|
|
17494
|
+
* Messages sent with it are added to the generation at the next step
|
|
17495
|
+
* boundary.
|
|
17496
|
+
*/
|
|
17497
|
+
experimental_steering?: Experimental_Steering;
|
|
16764
17498
|
/**
|
|
16765
17499
|
* Runtime context. Treat runtime context as immutable.
|
|
16766
17500
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -16910,6 +17644,11 @@ declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT exten
|
|
|
16910
17644
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
16911
17645
|
*/
|
|
16912
17646
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
17647
|
+
/**
|
|
17648
|
+
* Callback that is called when a step that started fails before it
|
|
17649
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
17650
|
+
*/
|
|
17651
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
16913
17652
|
/**
|
|
16914
17653
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
16915
17654
|
*
|
|
@@ -17006,7 +17745,7 @@ declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT exten
|
|
|
17006
17745
|
/** Internal policy used by the streaming-only facade. */
|
|
17007
17746
|
retention?: StreamTextRetention;
|
|
17008
17747
|
};
|
|
17009
|
-
}): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
17748
|
+
}, steeringRun: SteeringRun | undefined): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
17010
17749
|
|
|
17011
17750
|
/**
|
|
17012
17751
|
* Callback that is set using the `onAbort` option.
|
|
@@ -17053,16 +17792,7 @@ export declare type StreamTextOnErrorRetryCallback = (event: {
|
|
|
17053
17792
|
error: unknown;
|
|
17054
17793
|
}) => PromiseLike<void | StreamTextOnErrorResult> | void | StreamTextOnErrorResult;
|
|
17055
17794
|
|
|
17056
|
-
declare type StreamTextOptions<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context, OUTPUT extends OutputInterface> = Parameters<typeof streamTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0]
|
|
17057
|
-
/**
|
|
17058
|
-
* Consume the stream once without replay or final-content getters.
|
|
17059
|
-
* Content is collected only when required by tools, output parsing,
|
|
17060
|
-
* full-content callbacks, or telemetry integrations.
|
|
17061
|
-
*
|
|
17062
|
-
* @default false
|
|
17063
|
-
*/
|
|
17064
|
-
experimental_lowMemory?: boolean;
|
|
17065
|
-
};
|
|
17795
|
+
declare type StreamTextOptions<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context, OUTPUT extends OutputInterface> = Parameters<typeof streamTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0];
|
|
17066
17796
|
|
|
17067
17797
|
/**
|
|
17068
17798
|
* A result object for accessing different stream types and additional information.
|
|
@@ -17803,6 +18533,11 @@ export declare interface Telemetry {
|
|
|
17803
18533
|
* @deprecated Use `onStepEnd` instead.
|
|
17804
18534
|
*/
|
|
17805
18535
|
onStepFinish?: Callback<InferTelemetryEvent<GenerateTextStepEndEvent>>;
|
|
18536
|
+
/**
|
|
18537
|
+
* Called when a step that started fails before it produces a step result.
|
|
18538
|
+
* Use it to close step-level spans. The call then ends with `onError`.
|
|
18539
|
+
*/
|
|
18540
|
+
onStepError?: Callback<InferTelemetryEvent<GenerateTextStepErrorEvent>>;
|
|
17806
18541
|
/**
|
|
17807
18542
|
* Called when an object generation step (single LLM invocation) begins.
|
|
17808
18543
|
* For generateObject/streamObject there is always exactly one step.
|
|
@@ -18692,15 +19427,26 @@ declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RU
|
|
|
18692
19427
|
/**
|
|
18693
19428
|
* Generates an output from the agent (non-streaming).
|
|
18694
19429
|
*/
|
|
18695
|
-
generate({ abortSignal, timeout, experimental_sandbox: sandbox, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd, ...options }: AgentCallParameters<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT>): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
19430
|
+
generate({ abortSignal, timeout, experimental_sandbox: sandbox, experimental_steering: steering, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd, ...options }: AgentCallParameters<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT> & ToolLoopAgentCallExtensions): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
18696
19431
|
/**
|
|
18697
19432
|
* Streams an output from the agent (streaming).
|
|
18698
19433
|
*/
|
|
18699
|
-
stream({ abortSignal, timeout, experimental_sandbox: sandbox, experimental_transform, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd, ...options }: AgentStreamParameters<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT>): Promise<StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
19434
|
+
stream({ abortSignal, timeout, experimental_sandbox: sandbox, experimental_steering: steering, experimental_transform, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd, ...options }: AgentStreamParameters<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT> & ToolLoopAgentCallExtensions): Promise<StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
18700
19435
|
}
|
|
18701
19436
|
export { ToolLoopAgent as Experimental_Agent }
|
|
18702
19437
|
export { ToolLoopAgent }
|
|
18703
19438
|
|
|
19439
|
+
/**
|
|
19440
|
+
* Call parameters that only `ToolLoopAgent` supports.
|
|
19441
|
+
*/
|
|
19442
|
+
declare interface ToolLoopAgentCallExtensions {
|
|
19443
|
+
/**
|
|
19444
|
+
* A steering object created with `experimental_createSteering()`.
|
|
19445
|
+
* Messages sent with it are added to the run at the next step boundary.
|
|
19446
|
+
*/
|
|
19447
|
+
experimental_steering?: Experimental_Steering;
|
|
19448
|
+
}
|
|
19449
|
+
|
|
18704
19450
|
/**
|
|
18705
19451
|
* Configuration options for an agent.
|
|
18706
19452
|
*/
|
|
@@ -18856,6 +19602,27 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
18856
19602
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
18857
19603
|
*/
|
|
18858
19604
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
19605
|
+
/**
|
|
19606
|
+
* Callback that is called when a step that started fails before it
|
|
19607
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
19608
|
+
*
|
|
19609
|
+
* Unlike `onStepStart` and `onStepEnd`, it can only be set here and not
|
|
19610
|
+
* per call, because the per-call callbacks are shared with other `Agent`
|
|
19611
|
+
* implementations that do not report step errors.
|
|
19612
|
+
*/
|
|
19613
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
19614
|
+
/**
|
|
19615
|
+
* Callback that is called when an error occurs. For `stream()` it receives
|
|
19616
|
+
* the errors of the stream, for `generate()` it receives the error before
|
|
19617
|
+
* it is thrown. Aborts and timeouts are not reported.
|
|
19618
|
+
*/
|
|
19619
|
+
onError?: StreamTextOnErrorCallback;
|
|
19620
|
+
/**
|
|
19621
|
+
* Callback that is called when `stream()` is aborted or times out.
|
|
19622
|
+
* `generate()` does not call it: an aborted or timed out `generate()` call
|
|
19623
|
+
* rejects, and its step ends with `onStepError`.
|
|
19624
|
+
*/
|
|
19625
|
+
onAbort?: StreamTextOnAbortCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
18859
19626
|
/**
|
|
18860
19627
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
18861
19628
|
*
|
|
@@ -22185,6 +22952,14 @@ export declare function wrapProvider({ provider, languageModelMiddleware, imageM
|
|
|
22185
22952
|
imageModelMiddleware?: ImageModelMiddleware | ImageModelMiddleware[];
|
|
22186
22953
|
}): ProviderV4;
|
|
22187
22954
|
|
|
22955
|
+
declare type WritableSandboxProcess = Experimental_SandboxProcess & {
|
|
22956
|
+
/**
|
|
22957
|
+
* Stream of bytes written to the process's standard input. Closing the stream
|
|
22958
|
+
* delivers EOF after pending writes without terminating the process.
|
|
22959
|
+
*/
|
|
22960
|
+
readonly stdin: WritableStream<Uint8Array>;
|
|
22961
|
+
};
|
|
22962
|
+
|
|
22188
22963
|
/**
|
|
22189
22964
|
* Options for writing a file to the sandbox. `CONTENT` is the payload written
|
|
22190
22965
|
* to the file: a byte stream, raw bytes, or a string.
|
|
@@ -22217,5 +22992,5 @@ export declare function zodSchema<OBJECT>(zodSchema: $ZodType<OBJECT, any> | z3.
|
|
|
22217
22992
|
}): Schema<OBJECT>;
|
|
22218
22993
|
|
|
22219
22994
|
export { }
|
|
22220
|
-
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ProviderOptions as ProviderOptions, CustomPart as CustomPart, ReasoningPart as ReasoningPart, ReasoningFilePart as ReasoningFilePart, FileData as FileData, ProviderReference_2 as ProviderReference_2, ToolResultOutput as ToolResultOutput,
|
|
22995
|
+
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, ParseResult as ParseResult, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ProviderOptions as ProviderOptions, CustomPart as CustomPart, ReasoningPart as ReasoningPart, ReasoningFilePart as ReasoningFilePart, FileData as FileData, ProviderReference_2 as ProviderReference_2, ToolResultOutput as ToolResultOutput, SandboxReadFileOptions as SandboxReadFileOptions, SandboxReadBinaryFileOptions as SandboxReadBinaryFileOptions, SandboxReadTextFileOptions as SandboxReadTextFileOptions, SandboxWriteFileOptions as SandboxWriteFileOptions, SandboxWriteBinaryFileOptions as SandboxWriteBinaryFileOptions, SandboxWriteTextFileOptions as SandboxWriteTextFileOptions, SandboxSpawnOptionsWithStdin as SandboxSpawnOptionsWithStdin, WritableSandboxProcess as WritableSandboxProcess, SandboxSpawnOptionsWithoutStdin as SandboxSpawnOptionsWithoutStdin, SandboxSpawnOptions as SandboxSpawnOptions, SandboxRunOptions as SandboxRunOptions, ToolCallerDefinition as ToolCallerDefinition, FunctionTool as FunctionTool, ProviderDefinedTool as ProviderDefinedTool, ProviderExecutedTool as ProviderExecutedTool, ExecutableTool as ExecutableTool, DynamicTool as DynamicTool, DecisionModelV4Input as DecisionModelV4Input, SharedV4ProviderReference as SharedV4ProviderReference, TypeValidationContext as TypeValidationContext, LanguageModelV4Citation as LanguageModelV4Citation, EmbeddingModelV3 as EmbeddingModelV3, EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV4Embedding as EmbeddingModelV4Embedding, EmbeddingModelV4Middleware as EmbeddingModelV4Middleware, ImageModelV3 as ImageModelV3, ImageModelV2 as ImageModelV2, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV4Middleware as ImageModelV4Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV3 as LanguageModelV3, LanguageModelV2 as LanguageModelV2, SharedV4Warning as SharedV4Warning, LanguageModelV4Middleware as LanguageModelV4Middleware, RerankingModelV3 as RerankingModelV3, SpeechModelV3 as SpeechModelV3, SpeechModelV2 as SpeechModelV2, TranscriptionModelV3 as TranscriptionModelV3, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV4Usage as ImageModelV4Usage, JSONValue_2 as JSONValue_2, Experimental_EvaluationModelV4 as Experimental_EvaluationModelV4, DecisionModelV4Result as DecisionModelV4Result, DeepPartialInternal as DeepPartialInternal, IncludedContext as IncludedContext, IncludedToolsContext as IncludedToolsContext, BaseToolCall as BaseToolCall, Source as Source, ValueOf as ValueOf, asUITool as asUITool, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, TextStreamTextStartPart as TextStreamTextStartPart, TextStreamTextEndPart as TextStreamTextEndPart, TextStreamReasoningStartPart as TextStreamReasoningStartPart, TextStreamReasoningEndPart as TextStreamReasoningEndPart, TextStreamCustomPart as TextStreamCustomPart, TextStreamToolInputStartPart as TextStreamToolInputStartPart, TextStreamToolInputEndPart as TextStreamToolInputEndPart, TextStreamToolInputDeltaPart as TextStreamToolInputDeltaPart, TextStreamSourcePart as TextStreamSourcePart, TextStreamToolOutputDeniedPart as TextStreamToolOutputDeniedPart, TextStreamStartStepPart as TextStreamStartStepPart, TextStreamFinishStepPart as TextStreamFinishStepPart, TextStreamStartPart as TextStreamStartPart, TextStreamFinishPart as TextStreamFinishPart, TextStreamAbortPart as TextStreamAbortPart, TextStreamErrorPart as TextStreamErrorPart, TextStreamRawPart as TextStreamRawPart, MaybePromiseLike as MaybePromiseLike, InferToolContext as InferToolContext, ToolCallerName as ToolCallerName, LanguageModelV4ToolCall as LanguageModelV4ToolCall, WidenedToolExecutionStartEvent as WidenedToolExecutionStartEvent, StaticToolExecutionStartEvent as StaticToolExecutionStartEvent, DynamicToolExecutionStartEvent as DynamicToolExecutionStartEvent, WidenedToolExecutionEndEvent as WidenedToolExecutionEndEvent, StaticToolExecutionEndEvent as StaticToolExecutionEndEvent, DynamicToolExecutionEndEvent as DynamicToolExecutionEndEvent, StreamTextOptions as StreamTextOptions, StreamTextSingleConsumerResult as StreamTextSingleConsumerResult, EnrichedStreamPart as EnrichedStreamPart, StandardizedPrompt as StandardizedPrompt, ResponseMessage as ResponseMessage, TranscriptionStartEventFor as TranscriptionStartEventFor, TranscriptionEndEventFor as TranscriptionEndEventFor, BivariantCallback as BivariantCallback, OperationStartEvent as OperationStartEvent, OperationEndEvent as OperationEndEvent, Arrayable as Arrayable, Context as Context, GenerateTextOptions as GenerateTextOptions, ToolsContextParameter as ToolsContextParameter, StreamTextOnAbortCallback as StreamTextOnAbortCallback, ToolLoopAgentCallExtensions as ToolLoopAgentCallExtensions, InferAgentTools as InferAgentTools, getOriginalFetch as getOriginalFetch, InferUIMessageTools as InferUIMessageTools, InferUIMessageToolCall as InferUIMessageToolCall, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, Resolvable as Resolvable, FetchFunction as FetchFunction, WebSocketConstructor as WebSocketConstructor, ValidateUIMessagesOptions as ValidateUIMessagesOptions, AgentUIMessageStreamOptions as AgentUIMessageStreamOptions, UIMessageStreamResponseInit as UIMessageStreamResponseInit, ActiveToolSubset as ActiveToolSubset, TextStreamTextDeltaPart as TextStreamTextDeltaPart, TextStreamReasoningDeltaPart as TextStreamReasoningDeltaPart, TextStreamFilePart as TextStreamFilePart, TextStreamReasoningFilePart as TextStreamReasoningFilePart, TextStreamToolApprovalRequestPart as TextStreamToolApprovalRequestPart, TextStreamToolApprovalResponsePart as TextStreamToolApprovalResponsePart, TextStreamToolCallPart as TextStreamToolCallPart, TextStreamToolResultPart as TextStreamToolResultPart, TextStreamToolErrorPart as TextStreamToolErrorPart, LanguageModelV4Prompt as LanguageModelV4Prompt, SharedV4Headers as SharedV4Headers, BatchV4 as BatchV4, BatchV4Error as BatchV4Error, BatchV4Status as BatchV4Status, GenerateImagePrompt as GenerateImagePrompt, BatchV4ModelIds as BatchV4ModelIds, InferBatchModelIds as InferBatchModelIds, BatchV4StartResult as BatchV4StartResult, BatchCallOptions as BatchCallOptions, ImageModelV4ProviderMetadata as ImageModelV4ProviderMetadata, Callback as Callback, EnforcedToolChoice as EnforcedToolChoice, LanguageModelV4Content as LanguageModelV4Content, RetryErrorReason as RetryErrorReason, DecisionModelV4CallOptions as DecisionModelV4CallOptions, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, SharedV4AudioFormat as SharedV4AudioFormat, SharedV4ProviderMetadata as SharedV4ProviderMetadata, SpeechModelV4StreamUsage as SpeechModelV4StreamUsage, VideoModelResponseMetadata as VideoModelResponseMetadata, VideoModelProviderMetadata as VideoModelProviderMetadata, VideoModelV4FrameType as VideoModelV4FrameType, GenerateVideoPollOptions as GenerateVideoPollOptions, GenerateVideoWebhookFactory as GenerateVideoWebhookFactory, VideoModelV4OperationStatusResult as VideoModelV4OperationStatusResult, EmbeddingModelV4CallOptions as EmbeddingModelV4CallOptions, LanguageModelV4CallOptions as LanguageModelV4CallOptions, JSONObject as JSONObject, RealtimeFactoryV4 as RealtimeFactoryV4, RealtimeFactoryV4GetTokenOptions as RealtimeFactoryV4GetTokenOptions, RealtimeFactoryV4GetTokenResult as RealtimeFactoryV4GetTokenResult, RealtimeModelV4 as RealtimeModelV4, RealtimeModelV4ClientEvent as RealtimeModelV4ClientEvent, RealtimeModelV4ServerEvent as RealtimeModelV4ServerEvent, RealtimeModelV4SessionConfig as RealtimeModelV4SessionConfig, RealtimeModelV4ToolDefinition as RealtimeModelV4ToolDefinition, InferToolSetContext as InferToolSetContext, ProviderDecisionModelIdentifier as ProviderDecisionModelIdentifier, ExtractLiteralUnion as ExtractLiteralUnion, ProviderVideoModelIdentifier as ProviderVideoModelIdentifier, ProviderV4 as ProviderV4, ProviderV3 as ProviderV3, VideoModel as VideoModel, FilesV4 as FilesV4, SkillsV4 as SkillsV4, ProviderV2 as ProviderV2, ExtractModelId as ExtractModelId, LanguageModelV4 as LanguageModelV4, EmbeddingModelV4 as EmbeddingModelV4, ImageModelV4 as ImageModelV4, TranscriptionModelV4 as TranscriptionModelV4, RerankingModelV4 as RerankingModelV4, SpeechModelV4 as SpeechModelV4, VideoModelV4 as VideoModelV4, DecisionModelV4 as DecisionModelV4, ToolSearchInput as ToolSearchInput, ToolSearchOutput as ToolSearchOutput, ToolSearchFunction as ToolSearchFunction, SpeechTranslationModelV4Usage as SpeechTranslationModelV4Usage, SpeechTranslationModelResponseMetadata as SpeechTranslationModelResponseMetadata, SpeechTranslationModel as SpeechTranslationModel, FilesV4UploadFileCallOptions as FilesV4UploadFileCallOptions, SkillsV4UploadSkillResult as SkillsV4UploadSkillResult, SkillsV4UploadSkillCallOptions as SkillsV4UploadSkillCallOptions, UploadSkillFile as UploadSkillFile };
|
|
22221
22996
|
export { schemaSymbol, symbol$1, symbol$10, symbol$10_2, symbol$11, symbol$12, symbol$12_2, symbol$13, symbol$13_2, symbol$14, symbol$14_2, symbol$15, symbol$15_2, symbol$16, symbol$16_2, symbol$17, symbol$18, symbol$19, symbol$1_2, symbol$1_3, symbol$2, symbol$20, symbol$21, symbol$22, symbol$23, 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, symbol_2 };
|