ai 7.0.153 → 7.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.d.ts +224 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +399 -96
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +52 -4
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +26 -20
- package/dist/internal/index.js.map +1 -1
- package/docs/02-getting-started/02-nextjs-app-router.mdx +2 -2
- package/docs/02-getting-started/08-angular.mdx +327 -0
- package/docs/02-getting-started/{03-nextjs-pages-router.mdx → 10-nextjs-pages-router.mdx} +12 -20
- package/docs/02-getting-started/index.mdx +2 -0
- package/docs/03-agents/01-overview.mdx +1 -0
- package/docs/03-agents/04-loop-control.mdx +117 -0
- package/docs/03-agents/06-tool-approvals.mdx +1 -0
- package/docs/03-agents/09-chat-platforms.mdx +164 -0
- package/docs/03-agents/index.mdx +6 -0
- package/docs/03-ai-sdk-core/60-telemetry.mdx +16 -3
- package/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +10 -0
- package/docs/04-ai-sdk-ui/21-transport.mdx +86 -0
- package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +46 -0
- package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +46 -0
- package/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +35 -0
- package/package.json +11 -11
- package/src/agent/create-agent-ui-stream-response.ts +3 -0
- package/src/agent/create-agent-ui-stream.ts +16 -0
- package/src/agent/pipe-agent-ui-stream-to-response.ts +3 -0
- package/src/agent/tool-loop-agent-settings.ts +37 -1
- package/src/agent/tool-loop-agent.ts +43 -7
- package/src/generate-text/generate-text-events.ts +37 -0
- package/src/generate-text/generate-text.ts +521 -373
- package/src/generate-text/index.ts +8 -0
- package/src/generate-text/prepare-step.ts +12 -0
- package/src/generate-text/restricted-telemetry-dispatcher.ts +31 -18
- package/src/generate-text/steering.ts +293 -0
- package/src/generate-text/step-result.ts +18 -0
- package/src/generate-text/stream-text.ts +664 -473
- package/src/telemetry/create-telemetry-dispatcher.ts +3 -0
- package/src/telemetry/telemetry.ts +15 -1
- package/src/util/is-caused-by-abort.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.154
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 47236dd: add onStepError callback to generateText, streamText, ToolLoopAgent and telemetry integrations, and onError and onAbort to ToolLoopAgent
|
|
8
|
+
- c8e8866: Add `aiVersion` to telemetry events so tracing-channel subscribers and telemetry integrations can identify the emitting `ai` package version, including in bundled applications and applications with multiple SDK versions.
|
|
9
|
+
- 1cf95c6: add experimental steering to generateText, streamText and ToolLoopAgent
|
|
10
|
+
- Updated dependencies [e64ed82]
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.69
|
|
12
|
+
- @ai-sdk/gateway@4.0.127
|
|
13
|
+
|
|
3
14
|
## 7.0.153
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1704,6 +1704,12 @@ type StepResult<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Conte
|
|
|
1704
1704
|
* results that can be fully encapsulated in the provider.
|
|
1705
1705
|
*/
|
|
1706
1706
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
1707
|
+
/**
|
|
1708
|
+
* The user messages that were sent with `experimental_steering` and added
|
|
1709
|
+
* to the input of this step. Undefined when the step received no steering
|
|
1710
|
+
* messages.
|
|
1711
|
+
*/
|
|
1712
|
+
readonly experimental_steeringMessages?: Array<UserModelMessage$1>;
|
|
1707
1713
|
};
|
|
1708
1714
|
//#endregion
|
|
1709
1715
|
//#region src/generate-text/language-model-events.d.ts
|
|
@@ -3159,6 +3165,7 @@ type ToolOrder<TOOLS extends ToolSet$1> = ReadonlyArray<keyof TOOLS & string> |
|
|
|
3159
3165
|
* @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.
|
|
3160
3166
|
* @param options.initialMessages - The initial messages that were passed into generateText or streamText.
|
|
3161
3167
|
* @param options.responseMessages - The response messages that have been accumulated from previous steps.
|
|
3168
|
+
* @param options.experimental_steeringMessages - The steering messages that were added to `messages` for the current step.
|
|
3162
3169
|
* @param options.runtimeContext - The user-defined runtime context.
|
|
3163
3170
|
*
|
|
3164
3171
|
* @returns An object that contains the settings for the step.
|
|
@@ -3198,6 +3205,15 @@ type PrepareStepFunction<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Contex
|
|
|
3198
3205
|
* The response messages that have been accumulated from all previous steps.
|
|
3199
3206
|
*/
|
|
3200
3207
|
responseMessages: Array<ResponseMessage>;
|
|
3208
|
+
/**
|
|
3209
|
+
* The user messages that were sent with `experimental_steering` and added to
|
|
3210
|
+
* `messages` for the current step. Undefined when the step received no
|
|
3211
|
+
* steering messages. `messages` already contains them. If you return a
|
|
3212
|
+
* `messages` override that is rebuilt from other fields, e.g.
|
|
3213
|
+
* `initialMessages` and `responseMessages`, add them back together with the
|
|
3214
|
+
* steering messages of previous steps from `steps`.
|
|
3215
|
+
*/
|
|
3216
|
+
experimental_steeringMessages?: Array<UserModelMessage$1>;
|
|
3201
3217
|
/**
|
|
3202
3218
|
* Tool context.
|
|
3203
3219
|
*/
|
|
@@ -3285,6 +3301,102 @@ type PrepareStepResult<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context
|
|
|
3285
3301
|
providerOptions?: ProviderOptions;
|
|
3286
3302
|
} & LanguageModelCallOptions) | undefined;
|
|
3287
3303
|
//#endregion
|
|
3304
|
+
//#region src/generate-text/steering.d.ts
|
|
3305
|
+
/**
|
|
3306
|
+
* Why a steering message was not delivered:
|
|
3307
|
+
*
|
|
3308
|
+
* - `finished`: the run ended before the message could be delivered.
|
|
3309
|
+
* - `removed-by-prepare-step`: `prepareStep` returned messages without it.
|
|
3310
|
+
* - `stop-condition`: a stop condition ended the run.
|
|
3311
|
+
* - `waiting-for-tool-results`: the run ended to wait for tool results,
|
|
3312
|
+
* e.g. a tool approval or a tool without an `execute` function.
|
|
3313
|
+
* - `aborted`: the run was aborted.
|
|
3314
|
+
* - `error`: the run failed.
|
|
3315
|
+
*/
|
|
3316
|
+
type SteeringNotDeliveredReason = 'finished' | 'removed-by-prepare-step' | 'stop-condition' | 'waiting-for-tool-results' | 'aborted' | 'error';
|
|
3317
|
+
/**
|
|
3318
|
+
* The outcome of a steering message.
|
|
3319
|
+
*/
|
|
3320
|
+
type SteeringOutcome = {
|
|
3321
|
+
readonly type: 'delivered';
|
|
3322
|
+
/** The id of the steering message. */
|
|
3323
|
+
readonly id: string;
|
|
3324
|
+
/** The user message that was added to the run. */
|
|
3325
|
+
readonly message: UserModelMessage$1;
|
|
3326
|
+
/** The number of the step whose model call received the message. */
|
|
3327
|
+
readonly stepNumber: number;
|
|
3328
|
+
} | {
|
|
3329
|
+
readonly type: 'not-delivered';
|
|
3330
|
+
/** The id of the steering message. */
|
|
3331
|
+
readonly id: string;
|
|
3332
|
+
/** The user message that was not added to the run. */
|
|
3333
|
+
readonly message: UserModelMessage$1;
|
|
3334
|
+
/** Why the message was not delivered. */
|
|
3335
|
+
readonly reason: SteeringNotDeliveredReason;
|
|
3336
|
+
};
|
|
3337
|
+
/**
|
|
3338
|
+
* Sends user messages to a running generation. Pass it to `generateText`,
|
|
3339
|
+
* `streamText`, or an agent call with the `experimental_steering` option.
|
|
3340
|
+
*/
|
|
3341
|
+
interface Steering {
|
|
3342
|
+
/**
|
|
3343
|
+
* Adds a user message to the run at the next step boundary, after the
|
|
3344
|
+
* current step and its tool calls are done. If the run would end because the
|
|
3345
|
+
* model finished its answer, it continues for another step unless a stop
|
|
3346
|
+
* condition is met.
|
|
3347
|
+
*
|
|
3348
|
+
* Messages that are sent before the run starts are delivered in the first
|
|
3349
|
+
* step. A steering object can only be used for one generation.
|
|
3350
|
+
*
|
|
3351
|
+
* @param message - The user message, or its text.
|
|
3352
|
+
* @param options.id - The id of the message. Sending a message again with
|
|
3353
|
+
* the same id returns the outcome of the first message.
|
|
3354
|
+
*
|
|
3355
|
+
* @returns The outcome of the message. It never rejects.
|
|
3356
|
+
*/
|
|
3357
|
+
steer(message: string | UserModelMessage$1, options?: {
|
|
3358
|
+
id?: string;
|
|
3359
|
+
}): Promise<SteeringOutcome>;
|
|
3360
|
+
}
|
|
3361
|
+
/**
|
|
3362
|
+
* The run side of a steering object.
|
|
3363
|
+
*/
|
|
3364
|
+
type SteeringRun = {
|
|
3365
|
+
hasPendingMessages(): boolean;
|
|
3366
|
+
/**
|
|
3367
|
+
* Takes the waiting messages for the next step. They are resolved by
|
|
3368
|
+
* `resolveTakenMessages` once the prompt of the step is known.
|
|
3369
|
+
*/
|
|
3370
|
+
takeMessages(): Array<UserModelMessage$1>;
|
|
3371
|
+
/**
|
|
3372
|
+
* Resolves the taken messages as delivered when they are part of the
|
|
3373
|
+
* messages that are sent to the model, and returns the delivered messages.
|
|
3374
|
+
*/
|
|
3375
|
+
resolveTakenMessages(options: {
|
|
3376
|
+
stepNumber: number;
|
|
3377
|
+
sentMessages: ReadonlyArray<ModelMessage$1>;
|
|
3378
|
+
}): Array<UserModelMessage$1>;
|
|
3379
|
+
end(reason: SteeringNotDeliveredReason): void;
|
|
3380
|
+
};
|
|
3381
|
+
/**
|
|
3382
|
+
* Creates a steering object that sends user messages to a running generation.
|
|
3383
|
+
*
|
|
3384
|
+
* @example
|
|
3385
|
+
* ```ts
|
|
3386
|
+
* const steering = experimental_createSteering();
|
|
3387
|
+
*
|
|
3388
|
+
* const result = streamText({
|
|
3389
|
+
* model,
|
|
3390
|
+
* tools,
|
|
3391
|
+
* stopWhen: isStepCount(20),
|
|
3392
|
+
* experimental_steering: steering,
|
|
3393
|
+
* });
|
|
3394
|
+
*
|
|
3395
|
+
* const outcome = await steering.steer('Use Paris, Texas instead.');
|
|
3396
|
+
* ```
|
|
3397
|
+
*/
|
|
3398
|
+
declare function createSteering(): Steering;
|
|
3399
|
+
//#endregion
|
|
3288
3400
|
//#region src/generate-text/stop-condition.d.ts
|
|
3289
3401
|
/**
|
|
3290
3402
|
* A predicate that decides whether a tool-calling loop should stop after the
|
|
@@ -3770,6 +3882,7 @@ type StreamTextOptions<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context,
|
|
|
3770
3882
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
3771
3883
|
*
|
|
3772
3884
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
3885
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
3773
3886
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
3774
3887
|
* @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.
|
|
3775
3888
|
*
|
|
@@ -3788,6 +3901,7 @@ type StreamTextOptions<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context,
|
|
|
3788
3901
|
* @param onToolExecutionEnd - Callback invoked after each tool execution completes.
|
|
3789
3902
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
3790
3903
|
* @param onStepEnd - Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
3904
|
+
* @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`.
|
|
3791
3905
|
* @param onStepFinish - Deprecated alias for `onStepEnd`.
|
|
3792
3906
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
3793
3907
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
@@ -3801,7 +3915,7 @@ export declare function streamText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT exte
|
|
|
3801
3915
|
* Accepts the same options as streamText and uses the same execution engine.
|
|
3802
3916
|
*/
|
|
3803
3917
|
declare function streamTextLowMemory<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextSingleConsumerResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
3804
|
-
declare function streamTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<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> & {
|
|
3918
|
+
declare function streamTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<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> & {
|
|
3805
3919
|
/**
|
|
3806
3920
|
* The language model to use.
|
|
3807
3921
|
*/
|
|
@@ -3837,6 +3951,12 @@ declare function streamTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ext
|
|
|
3837
3951
|
* The sandbox environment that is passed through to tool execution.
|
|
3838
3952
|
*/
|
|
3839
3953
|
experimental_sandbox?: Experimental_SandboxSession$1;
|
|
3954
|
+
/**
|
|
3955
|
+
* A steering object created with `experimental_createSteering()`.
|
|
3956
|
+
* Messages sent with it are added to the generation at the next step
|
|
3957
|
+
* boundary.
|
|
3958
|
+
*/
|
|
3959
|
+
experimental_steering?: Steering;
|
|
3840
3960
|
/**
|
|
3841
3961
|
* Runtime context. Treat runtime context as immutable.
|
|
3842
3962
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -3986,6 +4106,11 @@ declare function streamTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ext
|
|
|
3986
4106
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
3987
4107
|
*/
|
|
3988
4108
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
4109
|
+
/**
|
|
4110
|
+
* Callback that is called when a step that started fails before it
|
|
4111
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
4112
|
+
*/
|
|
4113
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
3989
4114
|
/**
|
|
3990
4115
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
3991
4116
|
*
|
|
@@ -4082,7 +4207,7 @@ declare function streamTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ext
|
|
|
4082
4207
|
/** Internal policy used by the streaming-only facade. */
|
|
4083
4208
|
retention?: StreamTextRetention;
|
|
4084
4209
|
};
|
|
4085
|
-
}): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
4210
|
+
}, steeringRun: SteeringRun | undefined): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
4086
4211
|
type EnrichedStreamPart<TOOLS extends ToolSet$1, PARTIAL_OUTPUT> = {
|
|
4087
4212
|
part: TextStreamPart<TOOLS>;
|
|
4088
4213
|
partialOutput: PARTIAL_OUTPUT | undefined;
|
|
@@ -4474,6 +4599,33 @@ type GenerateTextOnStepEndCallback<TOOLS extends ToolSet$1 = ToolSet$1, RUNTIME_
|
|
|
4474
4599
|
* @deprecated Use `GenerateTextOnStepEndCallback` instead.
|
|
4475
4600
|
*/
|
|
4476
4601
|
type GenerateTextOnStepFinishCallback<TOOLS extends ToolSet$1 = ToolSet$1, RUNTIME_CONTEXT extends Context = Context> = GenerateTextOnStepEndCallback<TOOLS, RUNTIME_CONTEXT>;
|
|
4602
|
+
/**
|
|
4603
|
+
* Event passed to the `onStepError` callback.
|
|
4604
|
+
*
|
|
4605
|
+
* Contains the step start event of the step that failed before it produced
|
|
4606
|
+
* a step result, along with the error.
|
|
4607
|
+
*/
|
|
4608
|
+
type GenerateTextStepErrorEvent<TOOLS extends ToolSet$1 = ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output> = GenerateTextStepStartEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT> & {
|
|
4609
|
+
/** The error that ended the step. */
|
|
4610
|
+
readonly error: unknown;
|
|
4611
|
+
};
|
|
4612
|
+
/**
|
|
4613
|
+
* Callback that is set using the `onStepError` option.
|
|
4614
|
+
*
|
|
4615
|
+
* Called when a step that started fails before it produces a step result:
|
|
4616
|
+
* when the provider call throws or rejects, or when the model stream ends
|
|
4617
|
+
* without output. `onStepEnd` is not called for such a step. A provider
|
|
4618
|
+
* `error` chunk does not fail the step, it still ends with `onStepEnd` and
|
|
4619
|
+
* `finishReason: 'error'`.
|
|
4620
|
+
*
|
|
4621
|
+
* In `generateText`, an abort or timeout also ends the step here. The error
|
|
4622
|
+
* is the abort or timeout error, or a provider error that has it as its
|
|
4623
|
+
* `cause`. In `streamText`, an abort or timeout ends the step
|
|
4624
|
+
* with `onAbort` instead.
|
|
4625
|
+
*
|
|
4626
|
+
* @param event - The step that failed and the error.
|
|
4627
|
+
*/
|
|
4628
|
+
type GenerateTextOnStepErrorCallback<TOOLS extends ToolSet$1 = ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output> = Callback<GenerateTextStepErrorEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
4477
4629
|
/**
|
|
4478
4630
|
* Callback that is set using the `onEnd` option.
|
|
4479
4631
|
*
|
|
@@ -4764,7 +4916,13 @@ type TelemetryTracingChannelMessage<EVENT = unknown> = {
|
|
|
4764
4916
|
};
|
|
4765
4917
|
//#endregion
|
|
4766
4918
|
//#region src/telemetry/telemetry.d.ts
|
|
4767
|
-
type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'
|
|
4919
|
+
type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'> & {
|
|
4920
|
+
/**
|
|
4921
|
+
* The version of the `ai` package that emitted this event.
|
|
4922
|
+
* Absent in older releases.
|
|
4923
|
+
*/
|
|
4924
|
+
readonly aiVersion?: string;
|
|
4925
|
+
};
|
|
4768
4926
|
type BivariantCallback<EVENT> = {
|
|
4769
4927
|
bivarianceHack(event: EVENT): PromiseLike<void> | void;
|
|
4770
4928
|
}['bivarianceHack'];
|
|
@@ -4831,6 +4989,11 @@ interface Telemetry {
|
|
|
4831
4989
|
* @deprecated Use `onStepEnd` instead.
|
|
4832
4990
|
*/
|
|
4833
4991
|
onStepFinish?: Callback<InferTelemetryEvent<GenerateTextStepEndEvent>>;
|
|
4992
|
+
/**
|
|
4993
|
+
* Called when a step that started fails before it produces a step result.
|
|
4994
|
+
* Use it to close step-level spans. The call then ends with `onError`.
|
|
4995
|
+
*/
|
|
4996
|
+
onStepError?: Callback<InferTelemetryEvent<GenerateTextStepErrorEvent>>;
|
|
4834
4997
|
/**
|
|
4835
4998
|
* Called when an object generation step (single LLM invocation) begins.
|
|
4836
4999
|
* For generateObject/streamObject there is always exactly one step.
|
|
@@ -5334,6 +5497,7 @@ type GenerateTextInclude = {
|
|
|
5334
5497
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
5335
5498
|
*
|
|
5336
5499
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
5500
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
5337
5501
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
5338
5502
|
* @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.
|
|
5339
5503
|
* @param onStart - Callback invoked when generation begins, before any LLM calls.
|
|
@@ -5352,13 +5516,16 @@ type GenerateTextInclude = {
|
|
|
5352
5516
|
* Uses a discriminated union: check `success` to determine if `output` or `error` is present.
|
|
5353
5517
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
5354
5518
|
* @param onStepFinish - Callback that is called when each step (LLM call) is finished, including intermediate steps.
|
|
5519
|
+
* @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.
|
|
5355
5520
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
5356
5521
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
5357
5522
|
*
|
|
5358
5523
|
* @returns
|
|
5359
5524
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
5360
5525
|
*/
|
|
5361
|
-
export declare function generateText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string>>(
|
|
5526
|
+
export declare function generateText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string>>(options: GenerateTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
5527
|
+
type GenerateTextOptions<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context, OUTPUT extends Output> = Parameters<typeof generateTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0];
|
|
5528
|
+
declare function generateTextInternal<TOOLS extends ToolSet$1, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = Output<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> & {
|
|
5362
5529
|
/**
|
|
5363
5530
|
* The language model to use.
|
|
5364
5531
|
*/
|
|
@@ -5394,6 +5561,12 @@ export declare function generateText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ex
|
|
|
5394
5561
|
* The sandbox environment that is passed through to tool execution.
|
|
5395
5562
|
*/
|
|
5396
5563
|
experimental_sandbox?: Experimental_SandboxSession$1;
|
|
5564
|
+
/**
|
|
5565
|
+
* A steering object created with `experimental_createSteering()`.
|
|
5566
|
+
* Messages sent with it are added to the generation at the next step
|
|
5567
|
+
* boundary.
|
|
5568
|
+
*/
|
|
5569
|
+
experimental_steering?: Steering;
|
|
5397
5570
|
/**
|
|
5398
5571
|
* Runtime context. Treat runtime context as immutable.
|
|
5399
5572
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -5536,6 +5709,11 @@ export declare function generateText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ex
|
|
|
5536
5709
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
5537
5710
|
*/
|
|
5538
5711
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
5712
|
+
/**
|
|
5713
|
+
* Callback that is called when a step that started fails before it
|
|
5714
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
5715
|
+
*/
|
|
5716
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
5539
5717
|
/**
|
|
5540
5718
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
5541
5719
|
*
|
|
@@ -5575,7 +5753,7 @@ export declare function generateText<TOOLS extends ToolSet$1, RUNTIME_CONTEXT ex
|
|
|
5575
5753
|
generateCallId?: IdGenerator$1;
|
|
5576
5754
|
now?: () => number;
|
|
5577
5755
|
};
|
|
5578
|
-
}): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
5756
|
+
}, steeringRun: SteeringRun | undefined): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
5579
5757
|
//#endregion
|
|
5580
5758
|
//#region src/agent/tool-loop-agent-settings.d.ts
|
|
5581
5759
|
/**
|
|
@@ -5733,6 +5911,27 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, R
|
|
|
5733
5911
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
5734
5912
|
*/
|
|
5735
5913
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
5914
|
+
/**
|
|
5915
|
+
* Callback that is called when a step that started fails before it
|
|
5916
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
5917
|
+
*
|
|
5918
|
+
* Unlike `onStepStart` and `onStepEnd`, it can only be set here and not
|
|
5919
|
+
* per call, because the per-call callbacks are shared with other `Agent`
|
|
5920
|
+
* implementations that do not report step errors.
|
|
5921
|
+
*/
|
|
5922
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
5923
|
+
/**
|
|
5924
|
+
* Callback that is called when an error occurs. For `stream()` it receives
|
|
5925
|
+
* the errors of the stream, for `generate()` it receives the error before
|
|
5926
|
+
* it is thrown. Aborts and timeouts are not reported.
|
|
5927
|
+
*/
|
|
5928
|
+
onError?: StreamTextOnErrorCallback;
|
|
5929
|
+
/**
|
|
5930
|
+
* Callback that is called when `stream()` is aborted or times out.
|
|
5931
|
+
* `generate()` does not call it: an aborted or timed out `generate()` call
|
|
5932
|
+
* rejects, and its step ends with `onStepError`.
|
|
5933
|
+
*/
|
|
5934
|
+
onAbort?: StreamTextOnAbortCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
5736
5935
|
/**
|
|
5737
5936
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
5738
5937
|
*
|
|
@@ -5804,6 +6003,16 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, R
|
|
|
5804
6003
|
};
|
|
5805
6004
|
//#endregion
|
|
5806
6005
|
//#region src/agent/tool-loop-agent.d.ts
|
|
6006
|
+
/**
|
|
6007
|
+
* Call parameters that only `ToolLoopAgent` supports.
|
|
6008
|
+
*/
|
|
6009
|
+
interface ToolLoopAgentCallExtensions {
|
|
6010
|
+
/**
|
|
6011
|
+
* A steering object created with `experimental_createSteering()`.
|
|
6012
|
+
* Messages sent with it are added to the run at the next step boundary.
|
|
6013
|
+
*/
|
|
6014
|
+
experimental_steering?: Steering;
|
|
6015
|
+
}
|
|
5807
6016
|
/**
|
|
5808
6017
|
* A tool loop agent is an agent that runs tools in a loop. In each step,
|
|
5809
6018
|
* it calls the LLM, and if there are tool calls, it executes the tools
|
|
@@ -5837,11 +6046,11 @@ export declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet$1
|
|
|
5837
6046
|
/**
|
|
5838
6047
|
* Generates an output from the agent (non-streaming).
|
|
5839
6048
|
*/
|
|
5840
|
-
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>>;
|
|
6049
|
+
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>>;
|
|
5841
6050
|
/**
|
|
5842
6051
|
* Streams an output from the agent (streaming).
|
|
5843
6052
|
*/
|
|
5844
|
-
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>>;
|
|
6053
|
+
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>>;
|
|
5845
6054
|
}
|
|
5846
6055
|
//#endregion
|
|
5847
6056
|
//#region src/agent/infer-agent-tools.d.ts
|
|
@@ -6924,6 +7133,7 @@ type AgentUIMessageStreamOptions<TOOLS extends ToolSet$1, UI_MESSAGE extends UIM
|
|
|
6924
7133
|
* @param abortSignal - The abort signal. Optional.
|
|
6925
7134
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
6926
7135
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
7136
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
6927
7137
|
* @param options - The options for the agent.
|
|
6928
7138
|
* @param experimental_transform - The stream transformations. Optional.
|
|
6929
7139
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -6932,7 +7142,7 @@ type AgentUIMessageStreamOptions<TOOLS extends ToolSet$1, UI_MESSAGE extends UIM
|
|
|
6932
7142
|
*
|
|
6933
7143
|
* @returns The UI message stream.
|
|
6934
7144
|
*/
|
|
6935
|
-
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = 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 }: {
|
|
7145
|
+
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = 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 }: {
|
|
6936
7146
|
agent: Agent<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
6937
7147
|
uiMessages: unknown[];
|
|
6938
7148
|
/**
|
|
@@ -6943,6 +7153,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
6943
7153
|
abortSignal?: AbortSignal;
|
|
6944
7154
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
6945
7155
|
experimental_sandbox?: Experimental_SandboxSession$1;
|
|
7156
|
+
experimental_steering?: Steering;
|
|
6946
7157
|
options?: CALL_OPTIONS;
|
|
6947
7158
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
6948
7159
|
} & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>>;
|
|
@@ -6957,6 +7168,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
6957
7168
|
* @param abortSignal - Abort signal. Optional.
|
|
6958
7169
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
6959
7170
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
7171
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
6960
7172
|
* @param options - The options for the agent. Optional.
|
|
6961
7173
|
* @param experimental_transform - Stream transformations. Optional.
|
|
6962
7174
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -6981,6 +7193,7 @@ export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS
|
|
|
6981
7193
|
abortSignal?: AbortSignal;
|
|
6982
7194
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
6983
7195
|
experimental_sandbox?: Experimental_SandboxSession$1;
|
|
7196
|
+
experimental_steering?: Steering;
|
|
6984
7197
|
options?: CALL_OPTIONS;
|
|
6985
7198
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
6986
7199
|
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<Response>;
|
|
@@ -6996,6 +7209,7 @@ export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS
|
|
|
6996
7209
|
* @param abortSignal - Abort signal. Optional.
|
|
6997
7210
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
6998
7211
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
7212
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
6999
7213
|
* @param options - The options for the agent. Optional.
|
|
7000
7214
|
* @param experimental_transform - Stream transformations. Optional.
|
|
7001
7215
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
@@ -7019,6 +7233,7 @@ export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS
|
|
|
7019
7233
|
abortSignal?: AbortSignal;
|
|
7020
7234
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
7021
7235
|
experimental_sandbox?: Experimental_SandboxSession$1;
|
|
7236
|
+
experimental_steering?: Steering;
|
|
7022
7237
|
options?: CALL_OPTIONS;
|
|
7023
7238
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
7024
7239
|
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<void>;
|
|
@@ -11146,5 +11361,5 @@ export declare function uploadSkill({ api, files, displayTitle, providerOptions
|
|
|
11146
11361
|
files: UploadSkillFile[];
|
|
11147
11362
|
}): Promise<UploadSkillResult>;
|
|
11148
11363
|
//#endregion
|
|
11149
|
-
export { AISDKError, APICallError, type ActiveTools, type Agent, type AgentCallParameters, type AgentStreamParameters, type AssistantContent, type AssistantModelMessage, type AsyncIterableStream, type CallWarning, type CallWarningRegistry, type ChatAddToolApproveResponseFunction, type ChatAddToolOutputFunction, type ChatInit, type ChatOnDataCallback, type ChatOnErrorCallback, type ChatOnFinishCallback, type ChatOnToolCallCallback, type ChatRequestOptions, type ChatState, type ChatStatus, type ChatTransport, type ChunkDetector, type Citation, type CompletionRequestOptions, type ContentPart, type CreateUIMessage, type CustomContentUIPart, type DataContent, type DataUIPart, type DeepPartial, type DirectChatTransportOptions, DownloadError, type DynamicToolCall, type DynamicToolError, type DynamicToolResult, type DynamicToolUIPart, type Embedding, type EmbeddingModel, type EmbeddingModelMiddleware, type EmbeddingModelUsage, EmptyResponseBodyError, type ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, type ToolLoopAgentSettings as Experimental_AgentSettings, type ToolLoopAgentSettings, type Batch as Experimental_Batch, type BatchError as Experimental_BatchError, type BatchItemResult as Experimental_BatchItemResult, type BatchProvider as Experimental_BatchProvider, type BatchReference as Experimental_BatchReference, type BatchRequest as Experimental_BatchRequest, type BatchStatus as Experimental_BatchStatus, type CancelBatchOptions as Experimental_CancelBatchOptions, type CancelBatchResult as Experimental_CancelBatchResult, type DecideEndEvent as Experimental_DecideEndEvent, type DecideStartEvent as Experimental_DecideStartEvent, type DecisionAnswer as Experimental_DecisionAnswer, type DecisionModel as Experimental_DecisionModel, type DecisionModelCallEndEvent as Experimental_DecisionModelCallEndEvent, type DecisionModelCallStartEvent as Experimental_DecisionModelCallStartEvent, type DecisionProviderRegistry as Experimental_DecisionProviderRegistry, type Experimental_DecisionQuestion, Experimental_DecisionRefusalError, type DecisionResult as Experimental_DecisionResult, type DecisionState as Experimental_DecisionState, type DecisionStatePart as Experimental_DecisionStatePart, Experimental_DecisionUnsupportedQuestionTypeError, type DownloadFunction as Experimental_DownloadFunction, type Experimental_GeneratedImage, type GetBatchResultsOptions as Experimental_GetBatchResultsOptions, type GetBatchStatusOptions as Experimental_GetBatchStatusOptions, type ImageBatchGenerationResult as Experimental_ImageBatchGenerationResult, type ImageBatchItemResult as Experimental_ImageBatchItemResult, type ImageBatchRequest as Experimental_ImageBatchRequest, type InferAgentUIMessage as Experimental_InferAgentUIMessage, type InferAgentUIMessage, type LanguageModelStreamPart as Experimental_LanguageModelStreamPart, type ListBatchesOptions as Experimental_ListBatchesOptions, type ListBatchesResult as Experimental_ListBatchesResult, type LogWarningsFunction as Experimental_LogWarningsFunction, type LogWarningsFunction, type RealtimeClientEvent as Experimental_RealtimeClientEvent, type RealtimeFactory as Experimental_RealtimeFactory, type RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, type RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, type RealtimeModel as Experimental_RealtimeModel, type RealtimeServerEvent as Experimental_RealtimeServerEvent, type RealtimeSessionConfig as Experimental_RealtimeSessionConfig, type RealtimeSessionOptions as Experimental_RealtimeSessionOptions, type RealtimeSessionState as Experimental_RealtimeSessionState, type RealtimeSetupResponse as Experimental_RealtimeSetupResponse, type RealtimeState as Experimental_RealtimeState, type RealtimeStatus as Experimental_RealtimeStatus, type RealtimeToolDefinition as Experimental_RealtimeToolDefinition, type Experimental_SandboxProcess, type Experimental_SandboxSession, type Experimental_SpeechResult, type SpeechStreamPart as Experimental_SpeechStreamPart, type SpeechStreamUsage as Experimental_SpeechStreamUsage, type SpeechTextPart as Experimental_SpeechTextPart, type StartBatchOptions as Experimental_StartBatchOptions, type StartBatchResult as Experimental_StartBatchResult, type StreamSpeechResult as Experimental_StreamSpeechResult, type StreamTranscriptionEndEvent as Experimental_StreamTranscriptionEndEvent, type StreamTranscriptionStartEvent as Experimental_StreamTranscriptionStartEvent, type StreamTranslationResult as Experimental_StreamTranslationResult, type TextBatchGenerationResult as Experimental_TextBatchGenerationResult, type TextBatchItemResult as Experimental_TextBatchItemResult, type TextBatchRequest as Experimental_TextBatchRequest, type Experimental_ToolCallerTool, type Experimental_ToolCallers, type Experimental_TranscriptionResult, type TranslationStreamPart as Experimental_TranslationStreamPart, type FilePart, type FileUIPart, type FinishReason, type FlexibleSchema, type GatewayAsyncJobMetadata, type GatewayModelId, type GatewayProviderMetadata, type GenerateImageCall, type GenerateImageResult, type GenerateObjectEndEvent, type GenerateObjectResult, type GenerateObjectStartEvent, type GenerateObjectStepEndEvent, type GenerateObjectStepStartEvent, type GenerateSpeechEndEvent, type GenerateSpeechStartEvent, type GenerateTextAbortEvent, type GenerateTextEndEvent, type GenerateTextInclude, type GenerateTextOnAbortCallback, type GenerateTextOnEndCallback, type GenerateTextOnFinishCallback, type GenerateTextOnStartCallback, type GenerateTextOnStepEndCallback, type GenerateTextOnStepFinishCallback, type GenerateTextOnStepStartCallback, type GenerateTextResult, type GenerateTextStartEvent, type GenerateTextStepEndEvent, type GenerateTextStepStartEvent, type GenerateVideoPrompt, type GenerateVideoResult, type GeneratedAudioFile, type GeneratedFile, type GenericToolApprovalFunction, type GetVideoStatusResult, type HttpChatTransportInitOptions, type IdGenerator, type ImageModel, type ImageModelMiddleware, type ImageModelProviderMetadata, type ImageModelResponseMetadata, type ImageModelUsage, type ImagePart, type InferCompleteOutput as InferGenerateOutput, type InferSchema, type InferPartialOutput as InferStreamOutput, type InferTelemetryEvent, type InferToolInput, type InferToolOutput, type InferUIDataParts, type InferUIMessageChunk, type InferUITool, type InferUITools, type Instructions, InvalidPromptError, InvalidResponseDataError, JSONParseError, type JSONSchema7, type JSONValue, type LanguageModel, type LanguageModelCallEndEvent, type LanguageModelCallOptions, type LanguageModelCallStartEvent, type LanguageModelMiddleware, type LanguageModelRequestMetadata, type LanguageModelResponseMetadata, type LanguageModelUsage, LoadAPIKeyError, LoadSettingError, type ModelInfo, type ModelMessage, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, type ObjectStreamPart, type OnFinishEvent, type OnLanguageModelCallEndCallback, type OnLanguageModelCallStartCallback, type OnStartEvent, type OnStepFinishEvent, type OnStepStartEvent, type OnToolCallFinishEvent, type OnToolCallStartEvent, type OnToolExecutionEndCallback, type OnToolExecutionStartCallback, output_d_exports as Output, type OutputChunkTimingStats, type Output as OutputInterface, type PrepareReconnectToStreamRequest, type PrepareSendMessagesRequest, type PrepareStepFunction, type PrepareStepResult, type PrepareWebSocketChatTransportReconnectToStreamRequest, type PrepareWebSocketChatTransportSendMessagesRequest, type Prompt, type Provider, type ProviderMetadata, type ProviderReference, type ProviderRegistryProvider, type ReasoningFileOutput, type ReasoningFileUIPart, type ReasoningOutput, type ReasoningUIPart, type RepairTextFunction, type RequestOptions, type RerankEndEvent, type RerankResult, type RerankStartEvent, type RerankingModel, type RerankingModelCallEndEvent, type RerankingModelCallStartEvent, type SafeValidateUIMessagesResult, type SafeValidateWebSocketChatTransportRequestResult, type Schema, type SingleToolApprovalFunction, type SourceDocumentUIPart, type SourceUrlUIPart, type SpeechModel, type SpeechModelResponseMetadata, type SpeechResult, type StartVideoResult, type StaticToolCall, type StaticToolError, type StaticToolOutputDenied, type StaticToolResult, type StepResult, type StepResultPerformance, type StepStartUIPart, type StopCondition, type StreamObjectOnFinishCallback, type StreamObjectResult, type StreamTextEndEvent, type StreamTextInclude, type StreamTextOnChunkCallback, type StreamTextOnEndCallback, type StreamTextOnErrorCallback, type StreamTextOnErrorResult, type StreamTextOnErrorRetryCallback, type StreamTextResult, type StreamTextTransform, type StreamTranscriptionResult, type SystemModelMessage, type Telemetry, type TelemetryOptions, type TelemetryTracingChannelMessage, type TelemetryTracingEventType, type TextPart, type TextStreamPart, type TextUIPart, type TimeoutConfiguration, type ToUIMessageChunkOptions, TooManyEmbeddingValuesForCallError, type Tool, type ToolApprovalConfiguration, type ToolApprovalRequest, type ToolApprovalRequestOutput, type ToolApprovalResponse, type ToolApprovalResponseOutput, type ToolApprovalStatus, type ToolCallPart, type ToolCallRepairFunction, type ToolChoice, type ToolContent, type ToolExecuteFunction, type ToolExecutionEndEvent, type ToolExecutionOptions, type ToolExecutionStartEvent, type ToolInputRefinement, type ToolModelMessage, type ToolOrder, type ToolOutputErrorUIPart, type ToolResultPart, type ToolSet, type ToolUIPart, type TranscriptionEndEvent, type TranscriptionModel, type TranscriptionModelResponseMetadata, type TranscriptionResult, type TranscriptionStartEvent, type TranscriptionStreamPart, TypeValidationError, type TypedToolCall, type TypedToolError, type TypedToolOutputDenied, type TypedToolResult, type UIDataPartSchemas, type UIDataTypes, type UIMessage, type UIMessageChunk, type UIMessagePart, type UIMessageStreamOnEndCallback, type UIMessageStreamOnFinishCallback, type UIMessageStreamOnStepEndCallback, type UIMessageStreamOnStepFinishCallback, type UIMessageStreamOptions, type UIMessageStreamOutcome, type UIMessageStreamWriter, type UIMessageStreamWriterWithOutcome, type UITool, type UIToolInvocation, type UITools, UnsupportedFunctionalityError, type UploadFileResult, type UploadSkillResult, type UseCompletionOptions, type UserContent, type UserModelMessage, type Warning, type WebSocketChatTransportAbortRequest, type WebSocketChatTransportInitOptions, type WebSocketChatTransportRequest, type WebSocketChatTransportResponse, type WebSocketChatTransportResumeRequest, type WebSocketChatTransportSendRequest, asSchema, createGateway, createIdGenerator, dynamicTool, cancelBatch as experimental_cancelBatch, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, streamLanguageModelCall as experimental_streamLanguageModelCall, streamSpeech as experimental_streamSpeech, streamTextLowMemory as experimental_streamTextLowMemory, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_toolCaller, experimental_transcribe, gateway, generateId$1 as generateId, isStepCount as stepCountIs, jsonSchema, parseJsonEventStream, tool$1 as tool, zodSchema };
|
|
11364
|
+
export { AISDKError, APICallError, type ActiveTools, type Agent, type AgentCallParameters, type AgentStreamParameters, type AssistantContent, type AssistantModelMessage, type AsyncIterableStream, type CallWarning, type CallWarningRegistry, type ChatAddToolApproveResponseFunction, type ChatAddToolOutputFunction, type ChatInit, type ChatOnDataCallback, type ChatOnErrorCallback, type ChatOnFinishCallback, type ChatOnToolCallCallback, type ChatRequestOptions, type ChatState, type ChatStatus, type ChatTransport, type ChunkDetector, type Citation, type CompletionRequestOptions, type ContentPart, type CreateUIMessage, type CustomContentUIPart, type DataContent, type DataUIPart, type DeepPartial, type DirectChatTransportOptions, DownloadError, type DynamicToolCall, type DynamicToolError, type DynamicToolResult, type DynamicToolUIPart, type Embedding, type EmbeddingModel, type EmbeddingModelMiddleware, type EmbeddingModelUsage, EmptyResponseBodyError, type ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, type ToolLoopAgentSettings as Experimental_AgentSettings, type ToolLoopAgentSettings, type Batch as Experimental_Batch, type BatchError as Experimental_BatchError, type BatchItemResult as Experimental_BatchItemResult, type BatchProvider as Experimental_BatchProvider, type BatchReference as Experimental_BatchReference, type BatchRequest as Experimental_BatchRequest, type BatchStatus as Experimental_BatchStatus, type CancelBatchOptions as Experimental_CancelBatchOptions, type CancelBatchResult as Experimental_CancelBatchResult, type DecideEndEvent as Experimental_DecideEndEvent, type DecideStartEvent as Experimental_DecideStartEvent, type DecisionAnswer as Experimental_DecisionAnswer, type DecisionModel as Experimental_DecisionModel, type DecisionModelCallEndEvent as Experimental_DecisionModelCallEndEvent, type DecisionModelCallStartEvent as Experimental_DecisionModelCallStartEvent, type DecisionProviderRegistry as Experimental_DecisionProviderRegistry, type Experimental_DecisionQuestion, Experimental_DecisionRefusalError, type DecisionResult as Experimental_DecisionResult, type DecisionState as Experimental_DecisionState, type DecisionStatePart as Experimental_DecisionStatePart, Experimental_DecisionUnsupportedQuestionTypeError, type DownloadFunction as Experimental_DownloadFunction, type Experimental_GeneratedImage, type GetBatchResultsOptions as Experimental_GetBatchResultsOptions, type GetBatchStatusOptions as Experimental_GetBatchStatusOptions, type ImageBatchGenerationResult as Experimental_ImageBatchGenerationResult, type ImageBatchItemResult as Experimental_ImageBatchItemResult, type ImageBatchRequest as Experimental_ImageBatchRequest, type InferAgentUIMessage as Experimental_InferAgentUIMessage, type InferAgentUIMessage, type LanguageModelStreamPart as Experimental_LanguageModelStreamPart, type ListBatchesOptions as Experimental_ListBatchesOptions, type ListBatchesResult as Experimental_ListBatchesResult, type LogWarningsFunction as Experimental_LogWarningsFunction, type LogWarningsFunction, type RealtimeClientEvent as Experimental_RealtimeClientEvent, type RealtimeFactory as Experimental_RealtimeFactory, type RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, type RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, type RealtimeModel as Experimental_RealtimeModel, type RealtimeServerEvent as Experimental_RealtimeServerEvent, type RealtimeSessionConfig as Experimental_RealtimeSessionConfig, type RealtimeSessionOptions as Experimental_RealtimeSessionOptions, type RealtimeSessionState as Experimental_RealtimeSessionState, type RealtimeSetupResponse as Experimental_RealtimeSetupResponse, type RealtimeState as Experimental_RealtimeState, type RealtimeStatus as Experimental_RealtimeStatus, type RealtimeToolDefinition as Experimental_RealtimeToolDefinition, type Experimental_SandboxProcess, type Experimental_SandboxSession, type Experimental_SpeechResult, type SpeechStreamPart as Experimental_SpeechStreamPart, type SpeechStreamUsage as Experimental_SpeechStreamUsage, type SpeechTextPart as Experimental_SpeechTextPart, type StartBatchOptions as Experimental_StartBatchOptions, type StartBatchResult as Experimental_StartBatchResult, type Steering as Experimental_Steering, type SteeringNotDeliveredReason as Experimental_SteeringNotDeliveredReason, type SteeringOutcome as Experimental_SteeringOutcome, type StreamSpeechResult as Experimental_StreamSpeechResult, type StreamTranscriptionEndEvent as Experimental_StreamTranscriptionEndEvent, type StreamTranscriptionStartEvent as Experimental_StreamTranscriptionStartEvent, type StreamTranslationResult as Experimental_StreamTranslationResult, type TextBatchGenerationResult as Experimental_TextBatchGenerationResult, type TextBatchItemResult as Experimental_TextBatchItemResult, type TextBatchRequest as Experimental_TextBatchRequest, type Experimental_ToolCallerTool, type Experimental_ToolCallers, type Experimental_TranscriptionResult, type TranslationStreamPart as Experimental_TranslationStreamPart, type FilePart, type FileUIPart, type FinishReason, type FlexibleSchema, type GatewayAsyncJobMetadata, type GatewayModelId, type GatewayProviderMetadata, type GenerateImageCall, type GenerateImageResult, type GenerateObjectEndEvent, type GenerateObjectResult, type GenerateObjectStartEvent, type GenerateObjectStepEndEvent, type GenerateObjectStepStartEvent, type GenerateSpeechEndEvent, type GenerateSpeechStartEvent, type GenerateTextAbortEvent, type GenerateTextEndEvent, type GenerateTextInclude, type GenerateTextOnAbortCallback, type GenerateTextOnEndCallback, type GenerateTextOnFinishCallback, type GenerateTextOnStartCallback, type GenerateTextOnStepEndCallback, type GenerateTextOnStepErrorCallback, type GenerateTextOnStepFinishCallback, type GenerateTextOnStepStartCallback, type GenerateTextResult, type GenerateTextStartEvent, type GenerateTextStepEndEvent, type GenerateTextStepErrorEvent, type GenerateTextStepStartEvent, type GenerateVideoPrompt, type GenerateVideoResult, type GeneratedAudioFile, type GeneratedFile, type GenericToolApprovalFunction, type GetVideoStatusResult, type HttpChatTransportInitOptions, type IdGenerator, type ImageModel, type ImageModelMiddleware, type ImageModelProviderMetadata, type ImageModelResponseMetadata, type ImageModelUsage, type ImagePart, type InferCompleteOutput as InferGenerateOutput, type InferSchema, type InferPartialOutput as InferStreamOutput, type InferTelemetryEvent, type InferToolInput, type InferToolOutput, type InferUIDataParts, type InferUIMessageChunk, type InferUITool, type InferUITools, type Instructions, InvalidPromptError, InvalidResponseDataError, JSONParseError, type JSONSchema7, type JSONValue, type LanguageModel, type LanguageModelCallEndEvent, type LanguageModelCallOptions, type LanguageModelCallStartEvent, type LanguageModelMiddleware, type LanguageModelRequestMetadata, type LanguageModelResponseMetadata, type LanguageModelUsage, LoadAPIKeyError, LoadSettingError, type ModelInfo, type ModelMessage, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, type ObjectStreamPart, type OnFinishEvent, type OnLanguageModelCallEndCallback, type OnLanguageModelCallStartCallback, type OnStartEvent, type OnStepFinishEvent, type OnStepStartEvent, type OnToolCallFinishEvent, type OnToolCallStartEvent, type OnToolExecutionEndCallback, type OnToolExecutionStartCallback, output_d_exports as Output, type OutputChunkTimingStats, type Output as OutputInterface, type PrepareReconnectToStreamRequest, type PrepareSendMessagesRequest, type PrepareStepFunction, type PrepareStepResult, type PrepareWebSocketChatTransportReconnectToStreamRequest, type PrepareWebSocketChatTransportSendMessagesRequest, type Prompt, type Provider, type ProviderMetadata, type ProviderReference, type ProviderRegistryProvider, type ReasoningFileOutput, type ReasoningFileUIPart, type ReasoningOutput, type ReasoningUIPart, type RepairTextFunction, type RequestOptions, type RerankEndEvent, type RerankResult, type RerankStartEvent, type RerankingModel, type RerankingModelCallEndEvent, type RerankingModelCallStartEvent, type SafeValidateUIMessagesResult, type SafeValidateWebSocketChatTransportRequestResult, type Schema, type SingleToolApprovalFunction, type SourceDocumentUIPart, type SourceUrlUIPart, type SpeechModel, type SpeechModelResponseMetadata, type SpeechResult, type StartVideoResult, type StaticToolCall, type StaticToolError, type StaticToolOutputDenied, type StaticToolResult, type StepResult, type StepResultPerformance, type StepStartUIPart, type StopCondition, type StreamObjectOnFinishCallback, type StreamObjectResult, type StreamTextEndEvent, type StreamTextInclude, type StreamTextOnChunkCallback, type StreamTextOnEndCallback, type StreamTextOnErrorCallback, type StreamTextOnErrorResult, type StreamTextOnErrorRetryCallback, type StreamTextResult, type StreamTextTransform, type StreamTranscriptionResult, type SystemModelMessage, type Telemetry, type TelemetryOptions, type TelemetryTracingChannelMessage, type TelemetryTracingEventType, type TextPart, type TextStreamPart, type TextUIPart, type TimeoutConfiguration, type ToUIMessageChunkOptions, TooManyEmbeddingValuesForCallError, type Tool, type ToolApprovalConfiguration, type ToolApprovalRequest, type ToolApprovalRequestOutput, type ToolApprovalResponse, type ToolApprovalResponseOutput, type ToolApprovalStatus, type ToolCallPart, type ToolCallRepairFunction, type ToolChoice, type ToolContent, type ToolExecuteFunction, type ToolExecutionEndEvent, type ToolExecutionOptions, type ToolExecutionStartEvent, type ToolInputRefinement, type ToolModelMessage, type ToolOrder, type ToolOutputErrorUIPart, type ToolResultPart, type ToolSet, type ToolUIPart, type TranscriptionEndEvent, type TranscriptionModel, type TranscriptionModelResponseMetadata, type TranscriptionResult, type TranscriptionStartEvent, type TranscriptionStreamPart, TypeValidationError, type TypedToolCall, type TypedToolError, type TypedToolOutputDenied, type TypedToolResult, type UIDataPartSchemas, type UIDataTypes, type UIMessage, type UIMessageChunk, type UIMessagePart, type UIMessageStreamOnEndCallback, type UIMessageStreamOnFinishCallback, type UIMessageStreamOnStepEndCallback, type UIMessageStreamOnStepFinishCallback, type UIMessageStreamOptions, type UIMessageStreamOutcome, type UIMessageStreamWriter, type UIMessageStreamWriterWithOutcome, type UITool, type UIToolInvocation, type UITools, UnsupportedFunctionalityError, type UploadFileResult, type UploadSkillResult, type UseCompletionOptions, type UserContent, type UserModelMessage, type Warning, type WebSocketChatTransportAbortRequest, type WebSocketChatTransportInitOptions, type WebSocketChatTransportRequest, type WebSocketChatTransportResponse, type WebSocketChatTransportResumeRequest, type WebSocketChatTransportSendRequest, asSchema, createGateway, createIdGenerator, dynamicTool, cancelBatch as experimental_cancelBatch, createSteering as experimental_createSteering, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, streamLanguageModelCall as experimental_streamLanguageModelCall, streamSpeech as experimental_streamSpeech, streamTextLowMemory as experimental_streamTextLowMemory, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_toolCaller, experimental_transcribe, gateway, generateId$1 as generateId, isStepCount as stepCountIs, jsonSchema, parseJsonEventStream, tool$1 as tool, zodSchema };
|
|
11150
11365
|
//# sourceMappingURL=index.d.ts.map
|