@lmnr-ai/lmnr 0.8.53 → 0.8.55
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/README.md +12 -0
- package/dist/cli.cjs +6 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +1 -3
- package/dist/cli.d.mts +1 -3
- package/dist/cli.mjs +6 -9
- package/dist/cli.mjs.map +1 -1
- package/dist/{consts-9rSS0oeR.cjs → consts-X-pnRGD0.cjs} +2 -3
- package/dist/{consts-9rSS0oeR.cjs.map → consts-X-pnRGD0.cjs.map} +1 -1
- package/dist/{consts-CTTu3jhI.mjs → consts-r67THnT9.mjs} +2 -3
- package/dist/{consts-CTTu3jhI.mjs.map → consts-r67THnT9.mjs.map} +1 -1
- package/dist/{evaluations-BwB2JsRa.d.mts → evaluations-Bz4AjiEN.d.mts} +302 -1264
- package/dist/{evaluations-BXDpgOzM.d.cts → evaluations-CAossFsy.d.cts} +302 -1264
- package/dist/{file-utils-CyBBBeeW.cjs → file-utils-DvRb07ah.cjs} +7 -15
- package/dist/{file-utils-CyBBBeeW.cjs.map → file-utils-DvRb07ah.cjs.map} +1 -1
- package/dist/{file-utils-CwqjWMsF.mjs → file-utils-qSiXXrPa.mjs} +6 -14
- package/dist/{file-utils-CwqjWMsF.mjs.map → file-utils-qSiXXrPa.mjs.map} +1 -1
- package/dist/index.cjs +3893 -2308
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1664 -512
- package/dist/index.d.mts +1664 -512
- package/dist/index.mjs +3905 -2322
- package/dist/index.mjs.map +1 -1
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.cjs +117 -185
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.cjs.map +1 -1
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.d.cts +1 -453
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.d.mts +1 -453
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.mjs +117 -185
- package/dist/opentelemetry-lib/instrumentation/temporal/workflow-interceptors.mjs.map +1 -1
- package/dist/{rolldown-runtime-Ctb5zv51.cjs → rolldown-runtime-C-fzZZTt.cjs} +2 -3
- package/dist/{rolldown-runtime-B4iAMlE-.mjs → rolldown-runtime-DYf_mQCB.mjs} +2 -3
- package/dist/{utils-DavLzQA8.mjs → utils-B7IKRw5F.mjs} +190 -55
- package/dist/utils-B7IKRw5F.mjs.map +1 -0
- package/dist/{utils-DcdjJ-4n.cjs → utils-C3QuhVGE.cjs} +245 -68
- package/dist/utils-C3QuhVGE.cjs.map +1 -0
- package/package.json +9 -8
- package/dist/utils-DavLzQA8.mjs.map +0 -1
- package/dist/utils-DcdjJ-4n.cjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { S as TracingLevel, _ as MaskInputOptions, a as HumanEvaluator, b as SpanType, c as InitializeOptions, d as LaminarClient, f as Dataset, g as LaminarSpanContext, h as Event, i as EvaluatorFunctionReturn, l as EvaluationDataset, m as EvaluationDatapointDatasetLink, o as evaluate, p as EvaluationDatapoint, r as EvaluatorFunction, s as StringUUID, t as Datapoint, u as LaminarDataset, v as PushDatapointsResponse, x as TraceType, y as SessionRecordingOptions } from "./evaluations-
|
|
1
|
+
import { S as TracingLevel, _ as MaskInputOptions, a as HumanEvaluator, b as SpanType, c as InitializeOptions, d as LaminarClient, f as Dataset, g as LaminarSpanContext, h as Event, i as EvaluatorFunctionReturn, l as EvaluationDataset, m as EvaluationDatapointDatasetLink, o as evaluate, p as EvaluationDatapoint, r as EvaluatorFunction, s as StringUUID, t as Datapoint, u as LaminarDataset, v as PushDatapointsResponse, x as TraceType, y as SessionRecordingOptions } from "./evaluations-Bz4AjiEN.mjs";
|
|
2
2
|
import { AttributeValue, Attributes, Context, Exception, HrTime, Link, Span, Span as Span$1, SpanContext, SpanKind, SpanStatus, TimeInput, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
3
3
|
import { Instrumentation, InstrumentationBase } from "@opentelemetry/instrumentation";
|
|
4
4
|
import { ReadableSpan, SpanExporter, SpanProcessor, TimedEvent } from "@opentelemetry/sdk-trace-base";
|
|
5
5
|
import { InstrumentationScope } from "@opentelemetry/core";
|
|
6
6
|
import { ServerResponse } from "node:http";
|
|
7
|
-
import { JSONSchema7, JSONSchema7 as JSONSchema7$
|
|
7
|
+
import { JSONSchema7, JSONSchema7 as JSONSchema7$2 } from "json-schema";
|
|
8
8
|
import { $ZodType } from "zod/v4/core";
|
|
9
9
|
import * as z3 from "zod/v3";
|
|
10
10
|
import { ZodType } from "zod/v4";
|
|
11
11
|
import { ServerResponse as ServerResponse$1 } from "http";
|
|
12
|
-
//#region src/decorators.d.ts
|
|
13
12
|
interface ObserveOptions {
|
|
14
13
|
name?: string;
|
|
15
14
|
sessionId?: string;
|
|
@@ -167,8 +166,6 @@ export declare function observeDecorator<This, Args extends unknown[], Return>(c
|
|
|
167
166
|
* ```
|
|
168
167
|
*/
|
|
169
168
|
export declare function observeExperimentalDecorator(config: Partial<ObserveOptions> | ((thisArg: unknown, ...funcArgs: unknown[]) => Partial<ObserveOptions>)): (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/integrations/eve.d.ts
|
|
172
169
|
/**
|
|
173
170
|
* Narrow local mirrors of eve's `eve/evals` types. We intentionally do not
|
|
174
171
|
* import from `eve`, so the SDK carries no peer dependency on it. Every field
|
|
@@ -273,6 +270,8 @@ type EveEvalVerdict = "passed" | "failed" | "scored" | "skipped";
|
|
|
273
270
|
interface EveEvalResult {
|
|
274
271
|
/** Path-derived eval id (e.g. "weather"). */
|
|
275
272
|
id?: string;
|
|
273
|
+
/** 1-based Trial number (eve calls it `attempt`), present only when the run repeats evals. */
|
|
274
|
+
attempt?: number;
|
|
276
275
|
/** Execution result (output, session, derived facts). */
|
|
277
276
|
result?: EveEvalTaskResult;
|
|
278
277
|
/** Every assertion recorded by the eval's `test(t)`, in record order. */
|
|
@@ -335,7 +334,7 @@ interface LaminarReporterOptions {
|
|
|
335
334
|
* Reports eve eval results to Laminar.
|
|
336
335
|
*
|
|
337
336
|
* Eve 0.35+ gives reporters every native trace context observed during an eval.
|
|
338
|
-
* The reporter links
|
|
337
|
+
* The reporter links each Trial to the first sampled primary trace (or the
|
|
339
338
|
* first sampled trace when there is no sampled primary), records every valid
|
|
340
339
|
* context in metadata, and adds
|
|
341
340
|
* a small EVALUATION span to the selected native trace for the grade. When eve
|
|
@@ -371,8 +370,6 @@ export declare class LaminarReporter implements EvalReporter {
|
|
|
371
370
|
private toSpanContext;
|
|
372
371
|
private finishGradeTrace;
|
|
373
372
|
}
|
|
374
|
-
//#endregion
|
|
375
|
-
//#region ../../node_modules/.pnpm/@ai-sdk+provider@4.0.24/node_modules/@ai-sdk/provider/dist/index.d.ts
|
|
376
373
|
//#region src/shared/v4/shared-v4-audio-format.d.ts
|
|
377
374
|
/**
|
|
378
375
|
* Audio format configuration shared by provider V4 model specifications.
|
|
@@ -875,6 +872,22 @@ type LanguageModelV4Source = {
|
|
|
875
872
|
providerMetadata?: SharedV4ProviderMetadata;
|
|
876
873
|
};
|
|
877
874
|
//#endregion
|
|
875
|
+
//#region src/language-model/v4/language-model-v4-citation.d.ts
|
|
876
|
+
/**
|
|
877
|
+
* A reference supporting generated text. Citations are attached to the text
|
|
878
|
+
* they support, independently of the complete set of retrieved sources.
|
|
879
|
+
*/
|
|
880
|
+
type LanguageModelV4Citation = {
|
|
881
|
+
/** The referenced URL or document. */
|
|
882
|
+
source: LanguageModelV4Source;
|
|
883
|
+
/** Start offset in the containing generated text, when supplied by the provider. */
|
|
884
|
+
startIndex?: number;
|
|
885
|
+
/** Exclusive end offset in the containing generated text, when supplied by the provider. */
|
|
886
|
+
endIndex?: number;
|
|
887
|
+
/** The supporting passage from the source, when supplied by the provider. */
|
|
888
|
+
citedText?: string;
|
|
889
|
+
};
|
|
890
|
+
//#endregion
|
|
878
891
|
//#region src/language-model/v4/language-model-v4-text.d.ts
|
|
879
892
|
/**
|
|
880
893
|
* Text that the model has generated.
|
|
@@ -885,6 +898,8 @@ type LanguageModelV4Text = {
|
|
|
885
898
|
* The text content.
|
|
886
899
|
*/
|
|
887
900
|
text: string;
|
|
901
|
+
/** References supporting this text, separate from retrieved sources. */
|
|
902
|
+
citations?: Array<LanguageModelV4Citation>;
|
|
888
903
|
providerMetadata?: SharedV4ProviderMetadata;
|
|
889
904
|
};
|
|
890
905
|
//#endregion
|
|
@@ -927,8 +942,9 @@ type LanguageModelV4ToolCall = {
|
|
|
927
942
|
*/
|
|
928
943
|
toolName: string;
|
|
929
944
|
/**
|
|
930
|
-
*
|
|
931
|
-
*
|
|
945
|
+
* JSON-encoded tool input. Must match the input schema of the tool.
|
|
946
|
+
* String inputs must also be JSON-encoded, even when input deltas use text
|
|
947
|
+
* encoding.
|
|
932
948
|
*/
|
|
933
949
|
input: string;
|
|
934
950
|
/**
|
|
@@ -1011,9 +1027,10 @@ type LanguageModelV4FinishReason = {
|
|
|
1011
1027
|
* - `content-filter`: content filter violation stopped the model
|
|
1012
1028
|
* - `tool-calls`: model triggered tool calls
|
|
1013
1029
|
* - `error`: model stopped because of an error
|
|
1030
|
+
* - `interrupted`: provider stream ended without a completion signal; output may be incomplete
|
|
1014
1031
|
* - `other`: model stopped for other reasons
|
|
1015
1032
|
*/
|
|
1016
|
-
unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
1033
|
+
unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'interrupted' | 'other';
|
|
1017
1034
|
/**
|
|
1018
1035
|
* Raw finish reason from the provider.
|
|
1019
1036
|
* This is the original finish reason from the provider.
|
|
@@ -1098,6 +1115,15 @@ type LanguageModelV4GenerateResult = {
|
|
|
1098
1115
|
* Ordered content that the model has generated.
|
|
1099
1116
|
*/
|
|
1100
1117
|
content: Array<LanguageModelV4Content>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Text to parse for structured JSON output when it differs from the
|
|
1120
|
+
* concatenation of all text parts in `content` (e.g. drafts followed by a
|
|
1121
|
+
* final answer). This does not replace or remove any generated content.
|
|
1122
|
+
*
|
|
1123
|
+
* When omitted, consumers concatenate all text parts. An empty string is
|
|
1124
|
+
* an explicit selection and must not fall back to the other text parts.
|
|
1125
|
+
*/
|
|
1126
|
+
structuredOutputText?: string;
|
|
1101
1127
|
/**
|
|
1102
1128
|
* The finish reason.
|
|
1103
1129
|
*/
|
|
@@ -2094,6 +2120,12 @@ type EmbeddingModelV4CallOptions = {
|
|
|
2094
2120
|
* List of text values to generate embeddings for.
|
|
2095
2121
|
*/
|
|
2096
2122
|
values: Array<string>;
|
|
2123
|
+
/**
|
|
2124
|
+
* The requested number of dimensions for the output embeddings.
|
|
2125
|
+
* Must be a positive integer. Support and allowed values depend on the model
|
|
2126
|
+
* and provider implementation.
|
|
2127
|
+
*/
|
|
2128
|
+
dimensions?: number;
|
|
2097
2129
|
/**
|
|
2098
2130
|
* Abort signal for cancelling the operation.
|
|
2099
2131
|
*/
|
|
@@ -2714,33 +2746,49 @@ declare class UnsupportedFunctionalityError extends AISDKError {
|
|
|
2714
2746
|
}
|
|
2715
2747
|
//#endregion
|
|
2716
2748
|
//#region src/decision-model/v4/decision-model-v4-question.d.ts
|
|
2717
|
-
/**
|
|
2749
|
+
/** Content for decision instructions and criteria descriptions. */
|
|
2718
2750
|
type DecisionModelV4Input = string | Readonly<JSONObject$2> | readonly JSONValue$3[];
|
|
2719
2751
|
/** A judgment to make about the shared state. */
|
|
2720
2752
|
type DecisionModelV4Question = {
|
|
2721
2753
|
readonly type: 'choice';
|
|
2722
|
-
|
|
2754
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
2755
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
2723
2756
|
/** Nonempty map of option names to descriptions. Null means no description. */
|
|
2724
2757
|
readonly criteria: Readonly<Record<string, DecisionModelV4Input | null>>;
|
|
2725
2758
|
} | {
|
|
2726
2759
|
readonly type: 'score';
|
|
2727
|
-
|
|
2728
|
-
|
|
2760
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
2761
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
2762
|
+
/** At least one ordered level, indexed from zero. Providers may require more. */
|
|
2729
2763
|
readonly criteria: readonly (DecisionModelV4Input | null)[];
|
|
2730
2764
|
} | {
|
|
2731
|
-
readonly type: '
|
|
2765
|
+
readonly type: 'box';
|
|
2732
2766
|
readonly instructions: DecisionModelV4Input;
|
|
2767
|
+
} | {
|
|
2768
|
+
readonly type: 'boolean';
|
|
2769
|
+
/** May be omitted or null when supported by the provider and criteria define the judgment. */
|
|
2770
|
+
readonly instructions?: DecisionModelV4Input | null;
|
|
2771
|
+
/** At least one non-null description is required when instructions are absent. */
|
|
2733
2772
|
readonly criteria?: {
|
|
2734
2773
|
readonly true?: DecisionModelV4Input | null;
|
|
2735
2774
|
readonly false?: DecisionModelV4Input | null;
|
|
2736
2775
|
};
|
|
2737
2776
|
};
|
|
2738
2777
|
//#endregion
|
|
2778
|
+
//#region src/decision-model/v4/decision-model-v4-state.d.ts
|
|
2779
|
+
type DecisionModelV4State = readonly DecisionModelV4StatePart[];
|
|
2780
|
+
type DecisionModelV4StatePart = LanguageModelV4TextPart | LanguageModelV4FilePart | {
|
|
2781
|
+
type: 'json';
|
|
2782
|
+
value: JSONValue$3;
|
|
2783
|
+
};
|
|
2784
|
+
//#endregion
|
|
2739
2785
|
//#region src/decision-model/v4/decision-model-v4-call-options.d.ts
|
|
2740
2786
|
type DecisionModelV4CallOptions = {
|
|
2741
|
-
|
|
2742
|
-
state: DecisionModelV4Input;
|
|
2787
|
+
state: DecisionModelV4State;
|
|
2743
2788
|
questions: Readonly<Record<string, DecisionModelV4Question>>;
|
|
2789
|
+
maxOutputTokens?: number;
|
|
2790
|
+
/** Reasoning effort for supported models. Language-model adapters default to none. */
|
|
2791
|
+
reasoning?: LanguageModelV4CallOptions['reasoning'];
|
|
2744
2792
|
abortSignal?: AbortSignal;
|
|
2745
2793
|
headers?: SharedV4Headers;
|
|
2746
2794
|
providerOptions?: SharedV4ProviderOptions;
|
|
@@ -2762,6 +2810,15 @@ type DecisionModelV4Answer = {
|
|
|
2762
2810
|
* When supplied, score is its probability-weighted mean.
|
|
2763
2811
|
*/
|
|
2764
2812
|
probabilities?: Record<string, number>;
|
|
2813
|
+
} | {
|
|
2814
|
+
type: 'box';
|
|
2815
|
+
/** Edges in [0, 1], measured from the image's top-left corner. */
|
|
2816
|
+
box: {
|
|
2817
|
+
top: number;
|
|
2818
|
+
bottom: number;
|
|
2819
|
+
left: number;
|
|
2820
|
+
right: number;
|
|
2821
|
+
};
|
|
2765
2822
|
} | {
|
|
2766
2823
|
type: 'boolean';
|
|
2767
2824
|
/** Model-estimated P(true), in [0, 1]. Not confidence in either outcome. */
|
|
@@ -3574,6 +3631,8 @@ type LanguageModelV4StreamPart = {
|
|
|
3574
3631
|
delta: string;
|
|
3575
3632
|
} | {
|
|
3576
3633
|
type: 'text-end';
|
|
3634
|
+
/** References supporting the text block with this ID. */
|
|
3635
|
+
citations?: Array<LanguageModelV4Citation>;
|
|
3577
3636
|
providerMetadata?: SharedV4ProviderMetadata;
|
|
3578
3637
|
id: string;
|
|
3579
3638
|
} | {
|
|
@@ -3593,6 +3652,12 @@ type LanguageModelV4StreamPart = {
|
|
|
3593
3652
|
type: 'tool-input-start';
|
|
3594
3653
|
id: string;
|
|
3595
3654
|
toolName: string;
|
|
3655
|
+
/**
|
|
3656
|
+
* Encoding of the input deltas. Defaults to JSON when omitted.
|
|
3657
|
+
* Text deltas concatenate to a raw string. The final tool-call input
|
|
3658
|
+
* must still be JSON-encoded, regardless of the delta encoding.
|
|
3659
|
+
*/
|
|
3660
|
+
inputEncoding?: 'json' | 'text';
|
|
3596
3661
|
providerMetadata?: SharedV4ProviderMetadata;
|
|
3597
3662
|
providerExecuted?: boolean;
|
|
3598
3663
|
dynamic?: boolean;
|
|
@@ -5770,7 +5835,7 @@ type RerankingModelV4 = {
|
|
|
5770
5835
|
};
|
|
5771
5836
|
//#endregion
|
|
5772
5837
|
//#region src/speech-model/v4/speech-model-v4-call-options.d.ts
|
|
5773
|
-
type SpeechModelV4ProviderOptions = Record<string, JSONObject$2>;
|
|
5838
|
+
type SpeechModelV4ProviderOptions$1 = Record<string, JSONObject$2>;
|
|
5774
5839
|
type SpeechModelV4CallOptions = {
|
|
5775
5840
|
/**
|
|
5776
5841
|
* Text to convert to speech.
|
|
@@ -5810,7 +5875,7 @@ type SpeechModelV4CallOptions = {
|
|
|
5810
5875
|
* }
|
|
5811
5876
|
* ```
|
|
5812
5877
|
*/
|
|
5813
|
-
providerOptions?: SpeechModelV4ProviderOptions;
|
|
5878
|
+
providerOptions?: SpeechModelV4ProviderOptions$1;
|
|
5814
5879
|
/**
|
|
5815
5880
|
* Abort signal for cancelling the operation.
|
|
5816
5881
|
*/
|
|
@@ -7803,6 +7868,255 @@ interface RealtimeFactoryV4 {
|
|
|
7803
7868
|
getToken(options: RealtimeFactoryV4GetTokenOptions): Promise<RealtimeFactoryV4GetTokenResult>;
|
|
7804
7869
|
}
|
|
7805
7870
|
//#endregion
|
|
7871
|
+
//#region src/speech-model/v4/speech-model-v4-stream-text-part.d.ts
|
|
7872
|
+
/**
|
|
7873
|
+
* One piece of streamed input text. Consecutive parts are synthesized in
|
|
7874
|
+
* order as one continuous script.
|
|
7875
|
+
*/
|
|
7876
|
+
type SpeechModelV4StreamTextPart = {
|
|
7877
|
+
type: 'text';
|
|
7878
|
+
/**
|
|
7879
|
+
* The text to synthesize. Parts may split anywhere, including mid-word.
|
|
7880
|
+
*/
|
|
7881
|
+
text: string;
|
|
7882
|
+
/**
|
|
7883
|
+
* The voice that speaks this part. Like the call's `voice`, the value is
|
|
7884
|
+
* provider-specific (a voice ID, name, or other identifier). Defaults to the
|
|
7885
|
+
* call's `voice` (or the provider's default voice). Providers that support
|
|
7886
|
+
* several voices per stream (e.g. dialogue) switch speakers when it changes.
|
|
7887
|
+
* Single-voice providers fail the stream (error it) when a part's voice
|
|
7888
|
+
* differs from the voice of the call.
|
|
7889
|
+
*/
|
|
7890
|
+
voice?: string;
|
|
7891
|
+
/**
|
|
7892
|
+
* Additional provider-specific options for this part, keyed by provider
|
|
7893
|
+
* name (e.g. to start a new speaker turn without changing the voice).
|
|
7894
|
+
*/
|
|
7895
|
+
providerOptions?: SharedV4ProviderOptions;
|
|
7896
|
+
};
|
|
7897
|
+
//#endregion
|
|
7898
|
+
//#region src/speech-model/v4/speech-model-v4-stream-options.d.ts
|
|
7899
|
+
type SpeechModelV4ProviderOptions = Record<string, JSONObject$2>;
|
|
7900
|
+
/**
|
|
7901
|
+
* Options for a speech model stream call.
|
|
7902
|
+
*/
|
|
7903
|
+
type SpeechModelV4StreamOptions = {
|
|
7904
|
+
/**
|
|
7905
|
+
* Text to convert to speech, as a stream of text parts.
|
|
7906
|
+
*
|
|
7907
|
+
* Parts are synthesized in order. Providers with an incremental text
|
|
7908
|
+
* input transport forward text as it arrives; providers that only accept
|
|
7909
|
+
* complete text read the stream to completion before synthesis. The end of
|
|
7910
|
+
* the stream signals the end of the input text. A part's optional `voice`
|
|
7911
|
+
* selects its speaker on providers that support several voices.
|
|
7912
|
+
*
|
|
7913
|
+
* The provider owns the stream once `doStream` is called. It must release
|
|
7914
|
+
* it in every terminal path: cancel it (or its locked reader) when the
|
|
7915
|
+
* abort signal fires, when the consumer cancels the returned stream, when
|
|
7916
|
+
* setup fails before or after the stream is locked, and when the provider
|
|
7917
|
+
* fails. Leaving it unread and uncancelled keeps the caller's text producer
|
|
7918
|
+
* running indefinitely. After a normal finish the stream is fully read.
|
|
7919
|
+
*/
|
|
7920
|
+
text: ReadableStream<SpeechModelV4StreamTextPart>;
|
|
7921
|
+
/**
|
|
7922
|
+
* The voice to use for speech synthesis.
|
|
7923
|
+
* This is provider-specific and may be a voice ID, name, or other identifier.
|
|
7924
|
+
*/
|
|
7925
|
+
voice?: string;
|
|
7926
|
+
/**
|
|
7927
|
+
* The desired format of the output audio chunks, e.g.
|
|
7928
|
+
* `{ type: 'audio/pcm', rate: 24000 }` or `{ type: 'audio/mpeg' }`.
|
|
7929
|
+
* When absent, the provider default format is used.
|
|
7930
|
+
*/
|
|
7931
|
+
outputFormat?: SharedV4AudioFormat;
|
|
7932
|
+
/**
|
|
7933
|
+
* Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
7934
|
+
*/
|
|
7935
|
+
instructions?: string;
|
|
7936
|
+
/**
|
|
7937
|
+
* The speed of the speech generation.
|
|
7938
|
+
*/
|
|
7939
|
+
speed?: number;
|
|
7940
|
+
/**
|
|
7941
|
+
* The language for speech generation. This should be an ISO 639-1 language code (e.g. "en", "es", "fr")
|
|
7942
|
+
* or "auto" for automatic language detection. Provider support varies.
|
|
7943
|
+
*/
|
|
7944
|
+
language?: string;
|
|
7945
|
+
/**
|
|
7946
|
+
* Additional provider-specific options that are passed through to the provider.
|
|
7947
|
+
*
|
|
7948
|
+
* The outer record is keyed by the provider name, and the inner record is keyed
|
|
7949
|
+
* by provider-specific option names.
|
|
7950
|
+
*/
|
|
7951
|
+
providerOptions?: SpeechModelV4ProviderOptions;
|
|
7952
|
+
/**
|
|
7953
|
+
* Abort signal for cancelling the operation.
|
|
7954
|
+
*/
|
|
7955
|
+
abortSignal?: AbortSignal;
|
|
7956
|
+
/**
|
|
7957
|
+
* Additional HTTP headers to be sent with the request.
|
|
7958
|
+
* Only applicable for HTTP/WebSocket-based providers that support headers.
|
|
7959
|
+
*/
|
|
7960
|
+
headers?: Record<string, string | undefined>;
|
|
7961
|
+
/**
|
|
7962
|
+
* When true, providers should include raw provider chunks in the stream.
|
|
7963
|
+
*/
|
|
7964
|
+
includeRawChunks?: boolean;
|
|
7965
|
+
};
|
|
7966
|
+
//#endregion
|
|
7967
|
+
//#region src/speech-model/v4/speech-model-v4-stream-usage.d.ts
|
|
7968
|
+
/**
|
|
7969
|
+
* Usage information for a speech stream call.
|
|
7970
|
+
*
|
|
7971
|
+
* All fields are optional because providers bill speech with different
|
|
7972
|
+
* units (input characters, text tokens, and/or audio tokens).
|
|
7973
|
+
*/
|
|
7974
|
+
type SpeechModelV4StreamUsage = {
|
|
7975
|
+
/**
|
|
7976
|
+
* Number of input text characters (Unicode code points) that were sent
|
|
7977
|
+
* for synthesis, if known. Character-billed providers report this.
|
|
7978
|
+
*/
|
|
7979
|
+
inputCharacters?: number;
|
|
7980
|
+
/**
|
|
7981
|
+
* Number of input text tokens, if reported.
|
|
7982
|
+
*/
|
|
7983
|
+
inputTokens?: number;
|
|
7984
|
+
/**
|
|
7985
|
+
* Number of output audio tokens, if reported.
|
|
7986
|
+
*/
|
|
7987
|
+
outputTokens?: number;
|
|
7988
|
+
/**
|
|
7989
|
+
* Raw usage information from the provider, in the shape the provider
|
|
7990
|
+
* returns it.
|
|
7991
|
+
*/
|
|
7992
|
+
raw?: JSONObject$2;
|
|
7993
|
+
};
|
|
7994
|
+
//#endregion
|
|
7995
|
+
//#region src/speech-model/v4/speech-model-v4-stream-part.d.ts
|
|
7996
|
+
type SpeechModelV4StreamPart = {
|
|
7997
|
+
/**
|
|
7998
|
+
* Stream start event with warnings for the call, e.g. unsupported settings.
|
|
7999
|
+
*/
|
|
8000
|
+
type: 'stream-start';
|
|
8001
|
+
warnings: Array<SharedV4Warning>;
|
|
8002
|
+
} | {
|
|
8003
|
+
/**
|
|
8004
|
+
* Output audio chunk, in generation order. Chunks are not necessarily
|
|
8005
|
+
* standalone files; concatenate them to reconstruct the audio.
|
|
8006
|
+
*
|
|
8007
|
+
* `Uint8Array` chunks contain raw audio bytes. `string` chunks contain
|
|
8008
|
+
* base64-encoded raw audio bytes.
|
|
8009
|
+
*
|
|
8010
|
+
* A chunk may be empty when it only carries `providerMetadata` for a
|
|
8011
|
+
* point in the audio, e.g. a provider's end-of-turn marker.
|
|
8012
|
+
*/
|
|
8013
|
+
type: 'audio';
|
|
8014
|
+
/**
|
|
8015
|
+
* Optional provider identifier for the chunk.
|
|
8016
|
+
*/
|
|
8017
|
+
id?: string;
|
|
8018
|
+
audio: Uint8Array | string;
|
|
8019
|
+
/**
|
|
8020
|
+
* Format of the audio chunk, e.g. `{ type: 'audio/mpeg' }` or
|
|
8021
|
+
* `{ type: 'audio/pcm', rate: 24000 }`.
|
|
8022
|
+
*/
|
|
8023
|
+
audioFormat: SharedV4AudioFormat;
|
|
8024
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
8025
|
+
} | {
|
|
8026
|
+
/**
|
|
8027
|
+
* Metadata for the response, emitted once available.
|
|
8028
|
+
*/
|
|
8029
|
+
type: 'response-metadata';
|
|
8030
|
+
timestamp?: Date;
|
|
8031
|
+
modelId?: string;
|
|
8032
|
+
headers?: SharedV4Headers;
|
|
8033
|
+
body?: unknown;
|
|
8034
|
+
} | {
|
|
8035
|
+
/**
|
|
8036
|
+
* Metadata that is available after the stream is finished. Emitted
|
|
8037
|
+
* exactly once, after all audio chunks.
|
|
8038
|
+
*/
|
|
8039
|
+
type: 'finish';
|
|
8040
|
+
/**
|
|
8041
|
+
* Usage information for the call, if known.
|
|
8042
|
+
*/
|
|
8043
|
+
usage?: SpeechModelV4StreamUsage;
|
|
8044
|
+
/**
|
|
8045
|
+
* Additional provider-specific metadata.
|
|
8046
|
+
*/
|
|
8047
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
8048
|
+
} | {
|
|
8049
|
+
/**
|
|
8050
|
+
* Raw provider chunks if enabled.
|
|
8051
|
+
*/
|
|
8052
|
+
type: 'raw';
|
|
8053
|
+
rawValue: unknown;
|
|
8054
|
+
} | {
|
|
8055
|
+
/**
|
|
8056
|
+
* A non-fatal error; the stream continues and may carry more of them.
|
|
8057
|
+
* Providers signal an unrecoverable failure by erroring the stream, or
|
|
8058
|
+
* by closing it without a `finish` part.
|
|
8059
|
+
*/
|
|
8060
|
+
type: 'error';
|
|
8061
|
+
error: unknown;
|
|
8062
|
+
};
|
|
8063
|
+
//#endregion
|
|
8064
|
+
//#region src/speech-model/v4/speech-model-v4-stream-result.d.ts
|
|
8065
|
+
/**
|
|
8066
|
+
* The result of a speech model doStream call.
|
|
8067
|
+
*/
|
|
8068
|
+
type SpeechModelV4StreamResult = {
|
|
8069
|
+
/**
|
|
8070
|
+
* The stream.
|
|
8071
|
+
*/
|
|
8072
|
+
stream: ReadableStream<SpeechModelV4StreamPart>;
|
|
8073
|
+
/**
|
|
8074
|
+
* Optional request information for telemetry and debugging purposes.
|
|
8075
|
+
*/
|
|
8076
|
+
request?: {
|
|
8077
|
+
/**
|
|
8078
|
+
* Request body or setup payload that was sent to the provider API.
|
|
8079
|
+
*/
|
|
8080
|
+
body?: unknown;
|
|
8081
|
+
};
|
|
8082
|
+
/**
|
|
8083
|
+
* Optional response data.
|
|
8084
|
+
*/
|
|
8085
|
+
response?: {
|
|
8086
|
+
/**
|
|
8087
|
+
* Timestamp for the start of the streamed response.
|
|
8088
|
+
*/
|
|
8089
|
+
timestamp?: Date;
|
|
8090
|
+
/**
|
|
8091
|
+
* The ID of the response model that was used to generate the response.
|
|
8092
|
+
*/
|
|
8093
|
+
modelId?: string;
|
|
8094
|
+
/**
|
|
8095
|
+
* Response headers.
|
|
8096
|
+
*/
|
|
8097
|
+
headers?: SharedV4Headers;
|
|
8098
|
+
/**
|
|
8099
|
+
* Response body.
|
|
8100
|
+
*/
|
|
8101
|
+
body?: unknown;
|
|
8102
|
+
};
|
|
8103
|
+
};
|
|
8104
|
+
//#endregion
|
|
8105
|
+
//#region src/speech-model/v4/speech-model-v4-streaming.d.ts
|
|
8106
|
+
/**
|
|
8107
|
+
* A speech model that can also stream speech audio for streamed text input.
|
|
8108
|
+
*
|
|
8109
|
+
* Experimental: kept separate from the stable `SpeechModelV4` contract while
|
|
8110
|
+
* `experimental_streamSpeech` is experimental, and may change in patch
|
|
8111
|
+
* releases. Exported with an `Experimental_` prefix.
|
|
8112
|
+
*/
|
|
8113
|
+
type StreamingSpeechModelV4 = SpeechModelV4 & {
|
|
8114
|
+
/**
|
|
8115
|
+
* Streams speech audio for streamed text input.
|
|
8116
|
+
*/
|
|
8117
|
+
doStream(options: SpeechModelV4StreamOptions): PromiseLike<SpeechModelV4StreamResult>;
|
|
8118
|
+
};
|
|
8119
|
+
//#endregion
|
|
7806
8120
|
//#region src/speech-translation-model/v4/speech-translation-model-v4-stream-options.d.ts
|
|
7807
8121
|
type SpeechTranslationModelV4ProviderOptions = Record<string, JSONObject$2>;
|
|
7808
8122
|
/**
|
|
@@ -8809,8 +9123,6 @@ type VideoModelV3 = {
|
|
|
8809
9123
|
};
|
|
8810
9124
|
}>;
|
|
8811
9125
|
};
|
|
8812
|
-
//#endregion
|
|
8813
|
-
//#region ../../node_modules/.pnpm/@ai-sdk+provider@2.0.5/node_modules/@ai-sdk/provider/dist/index.d.ts
|
|
8814
9126
|
type SharedV2Headers = Record<string, string>;
|
|
8815
9127
|
/**
|
|
8816
9128
|
A JSON value can be a string, number, boolean, object, array, or null.
|
|
@@ -9613,8 +9925,6 @@ type LanguageModelV2 = {
|
|
|
9613
9925
|
};
|
|
9614
9926
|
}>;
|
|
9615
9927
|
};
|
|
9616
|
-
//#endregion
|
|
9617
|
-
//#region ../../node_modules/.pnpm/@ai-sdk+provider@3.0.19/node_modules/@ai-sdk/provider/dist/index.d.ts
|
|
9618
9928
|
type SharedV3Headers = Record<string, string>;
|
|
9619
9929
|
/**
|
|
9620
9930
|
* A JSON value can be a string, number, boolean, object, array, or null.
|
|
@@ -10701,6 +11011,7 @@ type LanguageModelV3 = {
|
|
|
10701
11011
|
supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
|
|
10702
11012
|
/**
|
|
10703
11013
|
* Generates a language model output (non-streaming).
|
|
11014
|
+
|
|
10704
11015
|
* Naming: "do" prefix to prevent accidental direct usage of the method
|
|
10705
11016
|
* by the user.
|
|
10706
11017
|
*/
|
|
@@ -10715,8 +11026,35 @@ type LanguageModelV3 = {
|
|
|
10715
11026
|
*/
|
|
10716
11027
|
doStream(options: LanguageModelV3CallOptions): PromiseLike<LanguageModelV3StreamResult>;
|
|
10717
11028
|
};
|
|
10718
|
-
|
|
10719
|
-
|
|
11029
|
+
/**
|
|
11030
|
+
* Turns the spans of this process into lmnr-atif trajectory files.
|
|
11031
|
+
*
|
|
11032
|
+
* `path` may contain `{trace_id}` (one file per trace) and `{pid}`. Without
|
|
11033
|
+
* `{trace_id}`, every trace of the process goes into one file.
|
|
11034
|
+
*/
|
|
11035
|
+
declare class TrajectoryCollector {
|
|
11036
|
+
readonly path: string;
|
|
11037
|
+
readonly exported: boolean;
|
|
11038
|
+
readonly release?: string | undefined;
|
|
11039
|
+
snapshotIntervalMs: number;
|
|
11040
|
+
private records;
|
|
11041
|
+
private open;
|
|
11042
|
+
dirty: boolean;
|
|
11043
|
+
private timer;
|
|
11044
|
+
private stopped;
|
|
11045
|
+
private warned;
|
|
11046
|
+
private exitHook;
|
|
11047
|
+
constructor(path: string, exported: boolean, release?: string | undefined, snapshotIntervalMs?: number);
|
|
11048
|
+
onStart(span: ReadableSpan): void;
|
|
11049
|
+
onEnd(span: ReadableSpan): void;
|
|
11050
|
+
/** Rebuild and write the file(s) now. Never throws. */
|
|
11051
|
+
write(): boolean;
|
|
11052
|
+
/** Write `records`. Never throws. */
|
|
11053
|
+
private writeRecords;
|
|
11054
|
+
/** Stop snapshots and the exit hook, then write the final file. Safe to
|
|
11055
|
+
* call more than once. */
|
|
11056
|
+
shutdown(): boolean;
|
|
11057
|
+
}
|
|
10720
11058
|
interface LaminarSpanProcessorOptions {
|
|
10721
11059
|
/**
|
|
10722
11060
|
* The base URL of the Laminar API. Optional.
|
|
@@ -10786,9 +11124,28 @@ interface LaminarSpanProcessorOptions {
|
|
|
10786
11124
|
* every span. Optional. If not provided, detected from the environment.
|
|
10787
11125
|
*/
|
|
10788
11126
|
release?: string;
|
|
11127
|
+
/**
|
|
11128
|
+
* Write the run as an lmnr-atif trajectory file here
|
|
11129
|
+
* (`LMNR_TRAJECTORY_PATH`). May contain `{trace_id}` and `{pid}`. Optional.
|
|
11130
|
+
*/
|
|
11131
|
+
trajectoryPath?: string;
|
|
11132
|
+
/**
|
|
11133
|
+
* Whether to export spans to Laminar. Optional. Defaults to true. False
|
|
11134
|
+
* (with `trajectoryPath`) is local-only: no exporter and no batch
|
|
11135
|
+
* processor are created, and `exporter` / a wrapped LaminarSpanProcessor's
|
|
11136
|
+
* pipeline are not used. A `spanProcessor` that isn't a
|
|
11137
|
+
* LaminarSpanProcessor is the caller's own pipeline and still runs.
|
|
11138
|
+
*/
|
|
11139
|
+
exportSpans?: boolean;
|
|
10789
11140
|
}
|
|
10790
11141
|
export declare class LaminarSpanProcessor implements SpanProcessor {
|
|
10791
11142
|
private instance;
|
|
11143
|
+
private exporter;
|
|
11144
|
+
/**
|
|
11145
|
+
* Writes the trajectory file, when there is one. Fed from `onStart` /
|
|
11146
|
+
* `onEnd`, so it sees exactly the spans that would be exported.
|
|
11147
|
+
*/
|
|
11148
|
+
readonly trajectory: TrajectoryCollector | undefined;
|
|
10792
11149
|
private logger;
|
|
10793
11150
|
private readonly _spanIdToPath;
|
|
10794
11151
|
private readonly _spanIdLists;
|
|
@@ -10839,8 +11196,6 @@ export declare class LaminarSpanProcessor implements SpanProcessor {
|
|
|
10839
11196
|
dropPathInfo(spanId: string): void;
|
|
10840
11197
|
clear(): void;
|
|
10841
11198
|
}
|
|
10842
|
-
//#endregion
|
|
10843
|
-
//#region src/opentelemetry-lib/tracing/attributes.d.ts
|
|
10844
11199
|
export declare const LaminarAttributes: {
|
|
10845
11200
|
INPUT_TOKEN_COUNT: string;
|
|
10846
11201
|
OUTPUT_TOKEN_COUNT: string;
|
|
@@ -10852,8 +11207,6 @@ export declare const LaminarAttributes: {
|
|
|
10852
11207
|
OUTPUT_COST: string;
|
|
10853
11208
|
TOTAL_COST: string;
|
|
10854
11209
|
};
|
|
10855
|
-
//#endregion
|
|
10856
|
-
//#region src/opentelemetry-lib/tracing/span.d.ts
|
|
10857
11210
|
declare class LaminarSpan implements Span$1, ReadableSpan {
|
|
10858
11211
|
private _span;
|
|
10859
11212
|
private _activated;
|
|
@@ -10912,8 +11265,6 @@ declare class LaminarSpan implements Span$1, ReadableSpan {
|
|
|
10912
11265
|
getParentSpanId(): string | undefined;
|
|
10913
11266
|
get isActivated(): boolean;
|
|
10914
11267
|
}
|
|
10915
|
-
//#endregion
|
|
10916
|
-
//#region src/laminar.d.ts
|
|
10917
11268
|
interface LaminarInitializeProps {
|
|
10918
11269
|
projectApiKey?: string;
|
|
10919
11270
|
baseUrl?: string;
|
|
@@ -10933,6 +11284,7 @@ interface LaminarInitializeProps {
|
|
|
10933
11284
|
inheritGlobalContext?: boolean;
|
|
10934
11285
|
spanProcessor?: SpanProcessor;
|
|
10935
11286
|
release?: string;
|
|
11287
|
+
writeTrajectory?: boolean;
|
|
10936
11288
|
}
|
|
10937
11289
|
type LaminarAttributesProp = Record<(typeof LaminarAttributes)[keyof typeof LaminarAttributes], AttributeValue>;
|
|
10938
11290
|
export declare class Laminar {
|
|
@@ -11007,6 +11359,19 @@ export declare class Laminar {
|
|
|
11007
11359
|
* SHA. Laminar groups an agent's traces into versions by release. If not specified, read
|
|
11008
11360
|
* from the LMNR_RELEASE environment variable, common deploy platform variables (Vercel,
|
|
11009
11361
|
* Render, Railway, Heroku, Cloud Run, ...), or the checked-out git commit.
|
|
11362
|
+
* @param {boolean} props.writeTrajectory - Whether `LMNR_TRAJECTORY_PATH` (see below)
|
|
11363
|
+
* applies to this process. Set to false in a process whose environment is meant
|
|
11364
|
+
* for an agent it runs, so its own spans are still exported. Defaults to true.
|
|
11365
|
+
*
|
|
11366
|
+
* Environment variables:
|
|
11367
|
+
* - `LMNR_TRAJECTORY_PATH`: write the run as an lmnr-atif trajectory (Harbor's ATIF
|
|
11368
|
+
* format with Laminar's extensions) to this file, and do NOT export spans to
|
|
11369
|
+
* Laminar, so no API key is needed. The path may contain `{trace_id}` (one file
|
|
11370
|
+
* per trace) and `{pid}`. Inline images go to an `images/` directory next to it.
|
|
11371
|
+
* The file is written on `Laminar.flush()` / `Laminar.shutdown()`, on process
|
|
11372
|
+
* exit, and as a snapshot at most every 2 seconds while spans end.
|
|
11373
|
+
* - `LMNR_TRAJECTORY_FORCE_EXPORT`: with `LMNR_TRAJECTORY_PATH`, also export spans to
|
|
11374
|
+
* Laminar as usual (an API key is then required). The file says `exported: true`.
|
|
11010
11375
|
*
|
|
11011
11376
|
* @example
|
|
11012
11377
|
* import { Laminar } from '@lmnr-ai/lmnr';
|
|
@@ -11024,9 +11389,9 @@ export declare class Laminar {
|
|
|
11024
11389
|
* }
|
|
11025
11390
|
* });
|
|
11026
11391
|
*
|
|
11027
|
-
* @throws {Error} - If project API key is not set
|
|
11392
|
+
* @throws {Error} - If project API key is not set and spans are exported
|
|
11028
11393
|
*/
|
|
11029
|
-
static initialize({ projectApiKey, baseUrl, baseHttpUrl, httpPort, grpcPort, instrumentModules, disableBatch, traceExportTimeoutMillis, logLevel, maxExportBatchSize, maxExportBatchSizeBytes, flushBySize, forceHttp, sessionRecordingOptions, metadata, inheritGlobalContext, spanProcessor, release }?: LaminarInitializeProps): void;
|
|
11394
|
+
static initialize({ projectApiKey, baseUrl, baseHttpUrl, httpPort, grpcPort, instrumentModules, disableBatch, traceExportTimeoutMillis, logLevel, maxExportBatchSize, maxExportBatchSizeBytes, flushBySize, forceHttp, sessionRecordingOptions, metadata, inheritGlobalContext, spanProcessor, release, writeTrajectory }?: LaminarInitializeProps): void;
|
|
11030
11395
|
/**
|
|
11031
11396
|
* Initialize Laminar context from the LMNR_SPAN_CONTEXT environment variable.
|
|
11032
11397
|
* This allows continuing traces across process boundaries.
|
|
@@ -11317,8 +11682,6 @@ export declare class Laminar {
|
|
|
11317
11682
|
*/
|
|
11318
11683
|
static wrapClaudeAgentQuery<T extends Function>(originalQuery: T): T;
|
|
11319
11684
|
}
|
|
11320
|
-
//#endregion
|
|
11321
|
-
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
11322
11685
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
11323
11686
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
11324
11687
|
/** The Standard properties. */
|
|
@@ -11434,8 +11797,6 @@ declare namespace StandardJSONSchemaV1 {
|
|
|
11434
11797
|
/** Infers the output type of a Standard. */
|
|
11435
11798
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
11436
11799
|
}
|
|
11437
|
-
//#endregion
|
|
11438
|
-
//#region ../../node_modules/.pnpm/@ai-sdk+provider-utils@5.0.56_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
|
|
11439
11800
|
//#region src/as-array.d.ts
|
|
11440
11801
|
/**
|
|
11441
11802
|
* A value that can be provided either as a single item, an array of items,
|
|
@@ -12015,7 +12376,7 @@ type Schema<OBJECT = unknown> = {
|
|
|
12015
12376
|
/**
|
|
12016
12377
|
* The JSON Schema for the schema. It is passed to the providers.
|
|
12017
12378
|
*/
|
|
12018
|
-
readonly jsonSchema: JSONSchema7$
|
|
12379
|
+
readonly jsonSchema: JSONSchema7$2 | PromiseLike<JSONSchema7$2>;
|
|
12019
12380
|
};
|
|
12020
12381
|
type LazySchema<SCHEMA> = () => Schema<SCHEMA>;
|
|
12021
12382
|
type ZodSchema<SCHEMA = any> = z3.Schema<SCHEMA, z3.ZodTypeDef, any> | $ZodType<SCHEMA, any>;
|
|
@@ -12032,7 +12393,7 @@ type InferSchema<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T : SCHEMA extend
|
|
|
12032
12393
|
* @param jsonSchema The JSON Schema for the schema.
|
|
12033
12394
|
* @param options.validate Optional. A validation function for the schema.
|
|
12034
12395
|
*/
|
|
12035
|
-
declare function jsonSchema<OBJECT = unknown>(jsonSchema: JSONSchema7$
|
|
12396
|
+
declare function jsonSchema<OBJECT = unknown>(jsonSchema: JSONSchema7$2 | PromiseLike<JSONSchema7$2> | (() => JSONSchema7$2 | PromiseLike<JSONSchema7$2>), { validate }?: {
|
|
12036
12397
|
validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
|
|
12037
12398
|
}): Schema<OBJECT>;
|
|
12038
12399
|
declare function asSchema<OBJECT>(schema: FlexibleSchema<OBJECT> | undefined): Schema<OBJECT>;
|
|
@@ -12232,6 +12593,13 @@ type ToolApprovalResponse = {
|
|
|
12232
12593
|
approved: boolean;
|
|
12233
12594
|
/**
|
|
12234
12595
|
* Optional reason for the approval or denial.
|
|
12596
|
+
*
|
|
12597
|
+
* For denied tool calls, the reason is included in the `execution-denied`
|
|
12598
|
+
* tool result that is sent to the model. For approved tool calls that are
|
|
12599
|
+
* executed by the SDK, the reason remains in the message history: it is not
|
|
12600
|
+
* included in the model prompt and is not exposed through a dedicated tool
|
|
12601
|
+
* execution option. For provider-executed tools, the approval response
|
|
12602
|
+
* (including the reason) is forwarded to the provider.
|
|
12235
12603
|
*/
|
|
12236
12604
|
reason?: string;
|
|
12237
12605
|
/**
|
|
@@ -12939,31 +13307,29 @@ type ToolCallerTool<TOOL extends Tool = Tool> = TOOL & {
|
|
|
12939
13307
|
readonly experimental_toolCaller: ToolCallerDefinition;
|
|
12940
13308
|
};
|
|
12941
13309
|
declare function toolCaller<TOOL extends Tool>(tool: TOOL, definition: ToolCallerDefinition): ToolCallerTool<TOOL>;
|
|
12942
|
-
//#endregion
|
|
12943
|
-
//#region ../../node_modules/.pnpm/@ai-sdk+gateway@4.0.106_zod@4.4.3/node_modules/@ai-sdk/gateway/dist/index.d.ts
|
|
12944
13310
|
//#region src/gateway-decision-model-settings.d.ts
|
|
12945
|
-
type GatewayDecisionModelId = 'convaiinnovations/laya' | 'convaiinnovations/laya-free' | 'liquid/d1' | 'typesafe-ai/jev' | (string & {});
|
|
13311
|
+
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 & {});
|
|
12946
13312
|
//#endregion
|
|
12947
13313
|
//#region src/gateway-embedding-model-settings.d.ts
|
|
12948
13314
|
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 & {});
|
|
12949
13315
|
//#endregion
|
|
12950
13316
|
//#region src/gateway-image-model-settings.d.ts
|
|
12951
|
-
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' | '
|
|
13317
|
+
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 & {});
|
|
12952
13318
|
//#endregion
|
|
12953
13319
|
//#region src/gateway-language-model-settings.d.ts
|
|
12954
|
-
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/
|
|
13320
|
+
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-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 & {});
|
|
12955
13321
|
//#endregion
|
|
12956
13322
|
//#region src/gateway-reranking-model-settings.d.ts
|
|
12957
|
-
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 & {});
|
|
13323
|
+
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 & {});
|
|
12958
13324
|
//#endregion
|
|
12959
13325
|
//#region src/gateway-speech-model-settings.d.ts
|
|
12960
|
-
type GatewaySpeechModelId = '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' | 'openai/tts-1' | 'openai/tts-1-hd' | 'spacexai/grok-tts' | (string & {});
|
|
13326
|
+
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 & {});
|
|
12961
13327
|
//#endregion
|
|
12962
13328
|
//#region src/gateway-transcription-model-settings.d.ts
|
|
12963
|
-
type GatewayTranscriptionModelId = 'fish-audio/transcribe-1' | 'google/gemini-3.5-transcribe' | 'google/gemini-3.5-transcribe-live' | 'microsoft/mai-transcribe-
|
|
13329
|
+
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 & {});
|
|
12964
13330
|
//#endregion
|
|
12965
13331
|
//#region src/gateway-video-model-settings.d.ts
|
|
12966
|
-
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' | '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' | (string & {});
|
|
13332
|
+
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 & {});
|
|
12967
13333
|
//#endregion
|
|
12968
13334
|
//#region src/gateway-model-entry.d.ts
|
|
12969
13335
|
declare const KNOWN_MODEL_TYPES: readonly ["embedding", "decision", "evaluation", "image", "language", "realtime", "reranking", "speech", "transcription", "video"];
|
|
@@ -13365,19 +13731,26 @@ type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
|
|
|
13365
13731
|
declare const exaSearchToolFactory: ProviderExecutedToolFactory<ExaSearchInput, ExaSearchOutput, ExaSearchConfig, {}>;
|
|
13366
13732
|
//#endregion
|
|
13367
13733
|
//#region src/tool/parallel-search.d.ts
|
|
13734
|
+
declare const parallelSearchModes: readonly ["turbo", "fast", "basic", "advanced", "one-shot", "agentic"];
|
|
13735
|
+
/**
|
|
13736
|
+
* Search mode. `turbo` and `fast` trade excerpt depth for latency (`turbo` is
|
|
13737
|
+
* English and Japanese only), `basic` is balanced, `advanced` is the most thorough.
|
|
13738
|
+
* Deprecated: `one-shot` (runs as `basic`) and `agentic` (runs as `advanced`).
|
|
13739
|
+
*/
|
|
13740
|
+
type ParallelSearchMode = (typeof parallelSearchModes)[number];
|
|
13368
13741
|
interface ParallelSearchSourcePolicy {
|
|
13369
13742
|
/**
|
|
13370
|
-
*
|
|
13371
|
-
* Example: ['wikipedia.org', '
|
|
13743
|
+
* Domains or domain/path prefixes to restrict results to. When set,
|
|
13744
|
+
* `excludeDomains` is ignored. Example: ['wikipedia.org', 'docs.python.org/3']
|
|
13372
13745
|
*/
|
|
13373
13746
|
includeDomains?: string[];
|
|
13374
13747
|
/**
|
|
13375
|
-
*
|
|
13376
|
-
* Example: ['reddit.com'
|
|
13748
|
+
* Domains or domain/path prefixes to exclude from results.
|
|
13749
|
+
* Example: ['reddit.com']
|
|
13377
13750
|
*/
|
|
13378
13751
|
excludeDomains?: string[];
|
|
13379
13752
|
/**
|
|
13380
|
-
* Only include results published after this date (
|
|
13753
|
+
* Only include results published on or after this date (YYYY-MM-DD).
|
|
13381
13754
|
* Example: '2024-01-01'
|
|
13382
13755
|
*/
|
|
13383
13756
|
afterDate?: string;
|
|
@@ -13389,23 +13762,32 @@ interface ParallelSearchExcerpts {
|
|
|
13389
13762
|
maxCharsPerResult?: number;
|
|
13390
13763
|
/**
|
|
13391
13764
|
* Maximum total characters across all results.
|
|
13765
|
+
* @deprecated Use the top-level `maxCharsTotal` option instead.
|
|
13392
13766
|
*/
|
|
13393
13767
|
maxCharsTotal?: number;
|
|
13394
13768
|
}
|
|
13395
13769
|
interface ParallelSearchFetchPolicy {
|
|
13396
13770
|
/**
|
|
13397
|
-
* Maximum age in seconds
|
|
13398
|
-
*
|
|
13771
|
+
* Maximum age in seconds of cached content before a live fetch is attempted.
|
|
13772
|
+
* Minimum 600; lower values are raised to 600.
|
|
13399
13773
|
*/
|
|
13400
13774
|
maxAgeSeconds?: number;
|
|
13775
|
+
/**
|
|
13776
|
+
* Timeout in seconds for a live fetch when content is not cached.
|
|
13777
|
+
* The gateway caps it to stay within its own tool timeout.
|
|
13778
|
+
*/
|
|
13779
|
+
timeoutSeconds?: number;
|
|
13780
|
+
/**
|
|
13781
|
+
* Return an error instead of falling back to older cached content when a
|
|
13782
|
+
* live fetch fails or times out. Defaults to false.
|
|
13783
|
+
*/
|
|
13784
|
+
disableCacheFallback?: boolean;
|
|
13401
13785
|
}
|
|
13402
13786
|
interface ParallelSearchConfig {
|
|
13403
13787
|
/**
|
|
13404
|
-
*
|
|
13405
|
-
* - "one-shot": Comprehensive results with longer excerpts for single-response answers (default)
|
|
13406
|
-
* - "agentic": Concise, token-efficient results for multi-step agentic workflows
|
|
13788
|
+
* Search mode. Defaults to `basic`.
|
|
13407
13789
|
*/
|
|
13408
|
-
mode?:
|
|
13790
|
+
mode?: ParallelSearchMode;
|
|
13409
13791
|
/**
|
|
13410
13792
|
* Default maximum number of results to return (1-20).
|
|
13411
13793
|
* Defaults to 10 if not specified.
|
|
@@ -13419,32 +13801,59 @@ interface ParallelSearchConfig {
|
|
|
13419
13801
|
* Default excerpt configuration for controlling result length.
|
|
13420
13802
|
*/
|
|
13421
13803
|
excerpts?: ParallelSearchExcerpts;
|
|
13804
|
+
/**
|
|
13805
|
+
* Maximum total characters across all result excerpts.
|
|
13806
|
+
*/
|
|
13807
|
+
maxCharsTotal?: number;
|
|
13422
13808
|
/**
|
|
13423
13809
|
* Default fetch policy for controlling content freshness.
|
|
13424
13810
|
*/
|
|
13425
13811
|
fetchPolicy?: ParallelSearchFetchPolicy;
|
|
13812
|
+
/**
|
|
13813
|
+
* ISO 3166-1 alpha-2 country code to localize results, e.g. 'us'.
|
|
13814
|
+
* Invalid codes are ignored with a warning.
|
|
13815
|
+
*/
|
|
13816
|
+
location?: string;
|
|
13426
13817
|
}
|
|
13427
13818
|
interface ParallelSearchResult {
|
|
13428
13819
|
/** URL of the search result */
|
|
13429
13820
|
url: string;
|
|
13430
|
-
/** Title of the
|
|
13431
|
-
title
|
|
13432
|
-
/**
|
|
13433
|
-
|
|
13434
|
-
/**
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13821
|
+
/** Title of the page, if available */
|
|
13822
|
+
title?: string | null;
|
|
13823
|
+
/** Publication date of the page (YYYY-MM-DD), if available */
|
|
13824
|
+
publish_date?: string | null;
|
|
13825
|
+
/** Relevant excerpts from the page, formatted as markdown */
|
|
13826
|
+
excerpts: string[];
|
|
13827
|
+
}
|
|
13828
|
+
interface ParallelSearchWarning {
|
|
13829
|
+
/** Warning type, e.g. 'input_validation_warning'. New types may be added. */
|
|
13830
|
+
type: string;
|
|
13831
|
+
/** Human-readable message */
|
|
13832
|
+
message: string;
|
|
13833
|
+
/** Optional detail supporting the warning */
|
|
13834
|
+
detail?: Record<string, unknown> | null;
|
|
13835
|
+
}
|
|
13836
|
+
interface ParallelSearchUsage {
|
|
13837
|
+
/** Usage item name, e.g. 'sku_search' */
|
|
13838
|
+
name: string;
|
|
13839
|
+
/** Count for the usage item */
|
|
13840
|
+
count?: number;
|
|
13438
13841
|
}
|
|
13439
13842
|
interface ParallelSearchResponse {
|
|
13440
13843
|
/** Unique identifier for this search request */
|
|
13441
|
-
|
|
13442
|
-
/**
|
|
13844
|
+
search_id: string;
|
|
13845
|
+
/** Search results, ordered by decreasing relevance */
|
|
13443
13846
|
results: ParallelSearchResult[];
|
|
13847
|
+
/** Non-fatal issues with the request, such as an ignored `location` */
|
|
13848
|
+
warnings?: ParallelSearchWarning[] | null;
|
|
13849
|
+
/** Usage reported by Parallel for this search */
|
|
13850
|
+
usage?: ParallelSearchUsage[] | null;
|
|
13851
|
+
/** Session identifier shared by the searches made during one request */
|
|
13852
|
+
session_id?: string;
|
|
13444
13853
|
}
|
|
13445
13854
|
interface ParallelSearchError {
|
|
13446
13855
|
/** Error type */
|
|
13447
|
-
error: 'api_error' | '
|
|
13856
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'gateway_rate_limit' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown' | 'unknown_tool';
|
|
13448
13857
|
/** HTTP status code if applicable */
|
|
13449
13858
|
statusCode?: number;
|
|
13450
13859
|
/** Human-readable error message */
|
|
@@ -13458,16 +13867,13 @@ interface ParallelSearchInput {
|
|
|
13458
13867
|
*/
|
|
13459
13868
|
objective: string;
|
|
13460
13869
|
/**
|
|
13461
|
-
*
|
|
13462
|
-
* Maximum 200 characters per query.
|
|
13870
|
+
* 2-3 concise keyword queries, 3-6 words each (max 5, 200 characters each).
|
|
13463
13871
|
*/
|
|
13464
13872
|
search_queries?: string[];
|
|
13465
13873
|
/**
|
|
13466
|
-
*
|
|
13467
|
-
* - "one-shot": Comprehensive results with longer excerpts
|
|
13468
|
-
* - "agentic": Concise, token-efficient results for multi-step workflows
|
|
13874
|
+
* Search mode. Defaults to `basic`.
|
|
13469
13875
|
*/
|
|
13470
|
-
mode?:
|
|
13876
|
+
mode?: ParallelSearchMode;
|
|
13471
13877
|
/**
|
|
13472
13878
|
* Maximum number of results to return (1-20).
|
|
13473
13879
|
* Defaults to 10 if not specified.
|
|
@@ -13486,14 +13892,25 @@ interface ParallelSearchInput {
|
|
|
13486
13892
|
*/
|
|
13487
13893
|
excerpts?: {
|
|
13488
13894
|
max_chars_per_result?: number;
|
|
13895
|
+
/** @deprecated Use the top-level `max_chars_total` instead. */
|
|
13489
13896
|
max_chars_total?: number;
|
|
13490
13897
|
};
|
|
13898
|
+
/**
|
|
13899
|
+
* Maximum total characters across all result excerpts.
|
|
13900
|
+
*/
|
|
13901
|
+
max_chars_total?: number;
|
|
13491
13902
|
/**
|
|
13492
13903
|
* Fetch policy for controlling content freshness.
|
|
13493
13904
|
*/
|
|
13494
13905
|
fetch_policy?: {
|
|
13495
13906
|
max_age_seconds?: number;
|
|
13907
|
+
timeout_seconds?: number;
|
|
13908
|
+
disable_cache_fallback?: boolean;
|
|
13496
13909
|
};
|
|
13910
|
+
/**
|
|
13911
|
+
* ISO 3166-1 alpha-2 country code to localize results.
|
|
13912
|
+
*/
|
|
13913
|
+
location?: string;
|
|
13497
13914
|
}
|
|
13498
13915
|
type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
13499
13916
|
declare const parallelSearchToolFactory: ProviderExecutedToolFactory<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig, {}>;
|
|
@@ -14028,6 +14445,13 @@ interface GatewayProvider extends ProviderV4 {
|
|
|
14028
14445
|
* transcription WebSocket without holding the Gateway credential.
|
|
14029
14446
|
*/
|
|
14030
14447
|
experimental_transcription: GatewayTranscriptionFactory;
|
|
14448
|
+
/**
|
|
14449
|
+
* Experimental streaming-speech entry point. Callable like
|
|
14450
|
+
* `speech(modelId)`, plus `getToken` for minting a short-lived client
|
|
14451
|
+
* secret (`vcst_`) a browser can use to open the streaming speech
|
|
14452
|
+
* WebSocket without holding the Gateway credential.
|
|
14453
|
+
*/
|
|
14454
|
+
experimental_speech: GatewaySpeechFactory;
|
|
14031
14455
|
/**
|
|
14032
14456
|
* Gateway-specific tools executed server-side.
|
|
14033
14457
|
*/
|
|
@@ -14057,6 +14481,30 @@ interface GatewayTranscriptionFactory {
|
|
|
14057
14481
|
(modelId: GatewayTranscriptionModelId): TranscriptionModelV4;
|
|
14058
14482
|
getToken(options: GatewayTranscriptionFactoryGetTokenOptions): Promise<GatewayTranscriptionFactoryGetTokenResult>;
|
|
14059
14483
|
}
|
|
14484
|
+
type GatewaySpeechFactoryGetTokenOptions = {
|
|
14485
|
+
model: GatewaySpeechModelId;
|
|
14486
|
+
/** Token lifetime in seconds. Gateway default is 60s (max 300s). */
|
|
14487
|
+
expiresAfterSeconds?: number;
|
|
14488
|
+
};
|
|
14489
|
+
type GatewaySpeechFactoryGetTokenResult = {
|
|
14490
|
+
/** The minted `vcst_` client secret. */
|
|
14491
|
+
token: string;
|
|
14492
|
+
/** WebSocket URL of the streaming speech surface for this model. */
|
|
14493
|
+
url: string;
|
|
14494
|
+
/** Token expiry, epoch seconds. */
|
|
14495
|
+
expiresAt?: number;
|
|
14496
|
+
};
|
|
14497
|
+
/**
|
|
14498
|
+
* Streaming-speech factory: callable like `speech(modelId)`, plus a
|
|
14499
|
+
* server-side `getToken` that mints a speech-bound short-lived client secret
|
|
14500
|
+
* (`vcst_`). The browser connects with
|
|
14501
|
+
* `createGateway({ apiKey: token }).speech(modelId)`; the token rides the
|
|
14502
|
+
* same auth subprotocol an API key does, without exposing the credential.
|
|
14503
|
+
*/
|
|
14504
|
+
interface GatewaySpeechFactory {
|
|
14505
|
+
(modelId: GatewaySpeechModelId): StreamingSpeechModelV4;
|
|
14506
|
+
getToken(options: GatewaySpeechFactoryGetTokenOptions): Promise<GatewaySpeechFactoryGetTokenResult>;
|
|
14507
|
+
}
|
|
14060
14508
|
interface GatewayProviderSettings {
|
|
14061
14509
|
/** Settings for downloading JSON Lines batch results. */
|
|
14062
14510
|
batchResultDownloads?: {
|
|
@@ -14087,10 +14535,10 @@ interface GatewayProviderSettings {
|
|
|
14087
14535
|
*/
|
|
14088
14536
|
fetch?: FetchFunction;
|
|
14089
14537
|
/**
|
|
14090
|
-
* Custom WebSocket implementation used for streaming transcription
|
|
14091
|
-
* useful for testing or for runtimes without a
|
|
14092
|
-
* header-capable implementation is not required —
|
|
14093
|
-
* carried in the subprotocols.
|
|
14538
|
+
* Custom WebSocket implementation used for streaming transcription and
|
|
14539
|
+
* streaming speech. This is useful for testing or for runtimes without a
|
|
14540
|
+
* global WebSocket. A header-capable implementation is not required —
|
|
14541
|
+
* Gateway WebSocket auth is carried in the subprotocols.
|
|
14094
14542
|
*/
|
|
14095
14543
|
webSocket?: WebSocketConstructor;
|
|
14096
14544
|
/**
|
|
@@ -14129,8 +14577,12 @@ type GatewayProviderMetadata = {
|
|
|
14129
14577
|
readonly [key: string]: JSONValue$3 | undefined;
|
|
14130
14578
|
};
|
|
14131
14579
|
declare namespace index_d_exports {
|
|
14132
|
-
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, ActiveTools, Agent$1 as Agent, AgentCallParameters, AgentStreamParameters, AssistantContent, AssistantModelMessage, AsyncIterableStream, CallSettings, CallWarning, CallWarningRegistry, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, CustomContentUIPart, DataContent, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedEndEvent, EmbedManyResult, EmbedResult, EmbedStartEvent, Embedding, EmbeddingModel, EmbeddingModelCallEndEvent, EmbeddingModelCallStartEvent, EmbeddingModelMiddleware, EmbeddingModelUsage, EmptyResponseBodyError, ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, Batch as Experimental_Batch, BatchError as Experimental_BatchError, BatchItemResult as Experimental_BatchItemResult, BatchProvider as Experimental_BatchProvider, BatchReference as Experimental_BatchReference, BatchRequest as Experimental_BatchRequest, BatchStatus as Experimental_BatchStatus, CancelBatchOptions as Experimental_CancelBatchOptions, CancelBatchResult as Experimental_CancelBatchResult, DecideEndEvent as Experimental_DecideEndEvent, DecideStartEvent as Experimental_DecideStartEvent, DecisionAnswer as Experimental_DecisionAnswer, DecisionModel as Experimental_DecisionModel, DecisionModelCallEndEvent as Experimental_DecisionModelCallEndEvent, DecisionModelCallStartEvent as Experimental_DecisionModelCallStartEvent, DecisionProviderRegistry as Experimental_DecisionProviderRegistry, DecisionQuestion as Experimental_DecisionQuestion, DecisionRefusalError as Experimental_DecisionRefusalError, DecisionResult as Experimental_DecisionResult, DecisionUnsupportedQuestionTypeError as Experimental_DecisionUnsupportedQuestionTypeError, DownloadFunction as Experimental_DownloadFunction, Experimental_EvaluateEndEvent, Experimental_EvaluateStartEvent, Experimental_EvaluationAnswer, Experimental_EvaluationModel, Experimental_EvaluationModelCallEndEvent, Experimental_EvaluationModelCallStartEvent, Experimental_EvaluationProviderRegistry, Experimental_EvaluationQuestion, Experimental_EvaluationResult, Experimental_EvaluationUnsupportedQuestionTypeError, Experimental_GeneratedImage, GetBatchResultsOptions as Experimental_GetBatchResultsOptions, GetBatchStatusOptions as Experimental_GetBatchStatusOptions, ImageBatchGenerationResult as Experimental_ImageBatchGenerationResult, ImageBatchItemResult as Experimental_ImageBatchItemResult, ImageBatchRequest as Experimental_ImageBatchRequest, InferAgentUIMessage as Experimental_InferAgentUIMessage, LanguageModelStreamPart as Experimental_LanguageModelStreamPart, ListBatchesOptions as Experimental_ListBatchesOptions, ListBatchesResult as Experimental_ListBatchesResult, LogWarningsFunction as Experimental_LogWarningsFunction, RealtimeClientEvent as Experimental_RealtimeClientEvent, RealtimeFactory as Experimental_RealtimeFactory, RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, RealtimeModel as Experimental_RealtimeModel, RealtimeServerEvent as Experimental_RealtimeServerEvent, RealtimeSessionConfig as Experimental_RealtimeSessionConfig, RealtimeSessionOptions as Experimental_RealtimeSessionOptions, RealtimeSessionState as Experimental_RealtimeSessionState, RealtimeSetupResponse as Experimental_RealtimeSetupResponse, RealtimeState as Experimental_RealtimeState, RealtimeStatus as Experimental_RealtimeStatus, RealtimeToolDefinition as Experimental_RealtimeToolDefinition, SandboxProcess as Experimental_SandboxProcess, SandboxSession as Experimental_SandboxSession, Experimental_SpeechResult, StartBatchOptions as Experimental_StartBatchOptions, StartBatchResult as Experimental_StartBatchResult, StreamTranscriptionEndEvent as Experimental_StreamTranscriptionEndEvent, StreamTranscriptionStartEvent as Experimental_StreamTranscriptionStartEvent, StreamTranslationResult as Experimental_StreamTranslationResult, TextBatchGenerationResult as Experimental_TextBatchGenerationResult, TextBatchItemResult as Experimental_TextBatchItemResult, TextBatchRequest as Experimental_TextBatchRequest, ToolCallerTool as Experimental_ToolCallerTool, Experimental_ToolCallers, Experimental_TranscriptionResult, TranslationStreamPart as Experimental_TranslationStreamPart, FilePart, FileUIPart, FinishReason, FlexibleSchema, GatewayAsyncJobMetadata, GatewayModelId, GatewayProviderMetadata, GenerateImageCall, GenerateImageResult, GenerateObjectEndEvent, GenerateObjectResult, GenerateObjectStartEvent, GenerateObjectStepEndEvent, GenerateObjectStepStartEvent, GenerateSpeechEndEvent, GenerateSpeechStartEvent, GenerateTextAbortEvent, GenerateTextEndEvent, GenerateTextInclude, GenerateTextOnAbortCallback, GenerateTextOnEndCallback, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepEndCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextResult, GenerateTextStartEvent, GenerateTextStepEndEvent, GenerateTextStepStartEvent, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, GenericToolApprovalFunction, GetVideoStatusResult, HttpChatTransport, HttpChatTransportInitOptions, IdGenerator, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, ImagePart, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferSchema, InferPartialOutput as InferStreamOutput, InferTelemetryEvent, InferToolInput, InferToolOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidPromptError, InvalidResponseDataError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONParseError, JSONSchema7$1 as JSONSchema7, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelCallEndEvent, LanguageModelCallOptions, LanguageModelCallStartEvent, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LoadAPIKeyError, LoadSettingError, LogWarningsFunction, MessageConversionError, MissingToolResultsError, ModelInfo, ModelMessage, NoContentGeneratedError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchModelError, NoSuchProviderError, NoSuchProviderReferenceError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnLanguageModelCallEndCallback, OnLanguageModelCallStartCallback, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, OnToolExecutionEndCallback, OnToolExecutionStartCallback, output_d_exports as Output, OutputChunkTimingStats, Output as OutputInterface, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderReference, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RequestOptions, RerankEndEvent, RerankResult, RerankStartEvent, RerankingModel, RerankingModelCallEndEvent, RerankingModelCallStartEvent, RetryError, SafeValidateUIMessagesResult, Schema, SerialJobExecutor, SingleToolApprovalFunction, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechResult, StartVideoResult, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepResultPerformance, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamProviderError, StreamTextEndEvent, StreamTextInclude, StreamTextOnChunkCallback, StreamTextOnEndCallback, StreamTextOnErrorCallback, StreamTextOnErrorResult, StreamTextOnErrorRetryCallback, StreamTextResult, StreamTextTransform, StreamTranscriptionResult, SystemModelMessage, Telemetry, TelemetryOptions, TelemetryTracingChannelMessage, TelemetryTracingEventType, TextPart, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToUIMessageChunkOptions, TooManyEmbeddingValuesForCallError, Tool, ToolApprovalConfiguration, ToolApprovalRequest, ToolApprovalRequestOutput, ToolApprovalResponse, ToolApprovalResponseOutput, ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolChoiceViolationError, ToolContent, ToolExecuteFunction, ToolExecutionEndEvent, ToolExecutionOptions, ToolExecutionStartEvent, ToolInputRefinement, ToolLoopAgent, ToolLoopAgentSettings, ToolModelMessage, ToolOrder, ToolOutputErrorUIPart, ToolResultPart, ToolSet, ToolUIPart, TranscriptionEndEvent, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionResult, TranscriptionStartEvent, TranscriptionStreamPart, TypeValidationError, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnEndCallback, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepEndCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamOutcome, UIMessageStreamWriter, UIMessageStreamWriterWithOutcome, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedFunctionalityError, UnsupportedModelVersionError, UploadFileResult, UploadSkillResult, UseCompletionOptions, UserContent, UserModelMessage, Warning, addToolInputExamplesMiddleware, asSchema, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createGateway, createIdGenerator, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, dynamicTool, embed, embedMany, cancelBatch as experimental_cancelBatch, experimental_createProviderRegistry, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, experimental_evaluate, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, toolCaller as experimental_toolCaller, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, gateway, generateId$1 as generateId, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isTextUIPart, isToolOutputErrorUIPart, isToolUIPart, jsonSchema, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parseJsonEventStream, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, isStepCount as stepCountIs, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, tool$1 as tool, toolModelMessageSchema, toolSearch, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel$1 as wrapLanguageModel, wrapProvider, zodSchema };
|
|
14580
|
+
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, ActiveTools, Agent$1 as Agent, AgentCallParameters, AgentStreamParameters, AssistantContent, AssistantModelMessage, AsyncIterableStream, CallSettings, CallWarning, CallWarningRegistry, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, Citation, CompletionRequestOptions, ContentPart, CreateUIMessage, CustomContentUIPart, DataContent, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedEndEvent, EmbedManyResult, EmbedResult, EmbedStartEvent, Embedding, EmbeddingModel, EmbeddingModelCallEndEvent, EmbeddingModelCallStartEvent, EmbeddingModelMiddleware, EmbeddingModelUsage, EmptyResponseBodyError, ErrorHandler, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, Batch as Experimental_Batch, BatchError as Experimental_BatchError, BatchItemResult as Experimental_BatchItemResult, BatchProvider as Experimental_BatchProvider, BatchReference as Experimental_BatchReference, BatchRequest as Experimental_BatchRequest, BatchStatus as Experimental_BatchStatus, CancelBatchOptions as Experimental_CancelBatchOptions, CancelBatchResult as Experimental_CancelBatchResult, DecideEndEvent as Experimental_DecideEndEvent, DecideStartEvent as Experimental_DecideStartEvent, DecisionAnswer as Experimental_DecisionAnswer, DecisionModel as Experimental_DecisionModel, DecisionModelCallEndEvent as Experimental_DecisionModelCallEndEvent, DecisionModelCallStartEvent as Experimental_DecisionModelCallStartEvent, DecisionProviderRegistry as Experimental_DecisionProviderRegistry, DecisionModelV4Question as Experimental_DecisionQuestion, DecisionRefusalError as Experimental_DecisionRefusalError, DecisionResult as Experimental_DecisionResult, DecisionState as Experimental_DecisionState, DecisionStatePart as Experimental_DecisionStatePart, DecisionUnsupportedQuestionTypeError as Experimental_DecisionUnsupportedQuestionTypeError, DownloadFunction as Experimental_DownloadFunction, Experimental_EvaluateEndEvent, Experimental_EvaluateStartEvent, Experimental_EvaluationAnswer, Experimental_EvaluationModel, Experimental_EvaluationModelCallEndEvent, Experimental_EvaluationModelCallStartEvent, Experimental_EvaluationProviderRegistry, Experimental_EvaluationQuestion, Experimental_EvaluationResult, Experimental_EvaluationUnsupportedQuestionTypeError, Experimental_GeneratedImage, GetBatchResultsOptions as Experimental_GetBatchResultsOptions, GetBatchStatusOptions as Experimental_GetBatchStatusOptions, ImageBatchGenerationResult as Experimental_ImageBatchGenerationResult, ImageBatchItemResult as Experimental_ImageBatchItemResult, ImageBatchRequest as Experimental_ImageBatchRequest, InferAgentUIMessage as Experimental_InferAgentUIMessage, LanguageModelStreamPart as Experimental_LanguageModelStreamPart, ListBatchesOptions as Experimental_ListBatchesOptions, ListBatchesResult as Experimental_ListBatchesResult, LogWarningsFunction as Experimental_LogWarningsFunction, RealtimeClientEvent as Experimental_RealtimeClientEvent, RealtimeFactory as Experimental_RealtimeFactory, RealtimeFactoryGetTokenOptions as Experimental_RealtimeFactoryGetTokenOptions, RealtimeFactoryGetTokenResult as Experimental_RealtimeFactoryGetTokenResult, RealtimeModel as Experimental_RealtimeModel, RealtimeServerEvent as Experimental_RealtimeServerEvent, RealtimeSessionConfig as Experimental_RealtimeSessionConfig, RealtimeSessionOptions as Experimental_RealtimeSessionOptions, RealtimeSessionState as Experimental_RealtimeSessionState, RealtimeSetupResponse as Experimental_RealtimeSetupResponse, RealtimeState as Experimental_RealtimeState, RealtimeStatus as Experimental_RealtimeStatus, RealtimeToolDefinition as Experimental_RealtimeToolDefinition, SandboxProcess as Experimental_SandboxProcess, SandboxSession as Experimental_SandboxSession, Experimental_SpeechResult, SpeechStreamPart as Experimental_SpeechStreamPart, SpeechStreamUsage as Experimental_SpeechStreamUsage, SpeechTextPart as Experimental_SpeechTextPart, StartBatchOptions as Experimental_StartBatchOptions, StartBatchResult as Experimental_StartBatchResult, Steering as Experimental_Steering, SteeringNotDeliveredReason as Experimental_SteeringNotDeliveredReason, SteeringOutcome as Experimental_SteeringOutcome, StreamSpeechResult as Experimental_StreamSpeechResult, StreamTranscriptionEndEvent as Experimental_StreamTranscriptionEndEvent, StreamTranscriptionStartEvent as Experimental_StreamTranscriptionStartEvent, StreamTranslationResult as Experimental_StreamTranslationResult, TextBatchGenerationResult as Experimental_TextBatchGenerationResult, TextBatchItemResult as Experimental_TextBatchItemResult, TextBatchRequest as Experimental_TextBatchRequest, ToolCallerTool as Experimental_ToolCallerTool, Experimental_ToolCallers, Experimental_TranscriptionResult, TranslationStreamPart as Experimental_TranslationStreamPart, FilePart, FileUIPart, FinishReason, FlexibleSchema, GatewayAsyncJobMetadata, GatewayModelId, GatewayProviderMetadata, GenerateImageCall, GenerateImageResult, GenerateObjectEndEvent, GenerateObjectResult, GenerateObjectStartEvent, GenerateObjectStepEndEvent, GenerateObjectStepStartEvent, GenerateSpeechEndEvent, GenerateSpeechStartEvent, GenerateTextAbortEvent, GenerateTextEndEvent, GenerateTextInclude, GenerateTextOnAbortCallback, GenerateTextOnEndCallback, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepEndCallback, GenerateTextOnStepErrorCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextResult, GenerateTextStartEvent, GenerateTextStepEndEvent, GenerateTextStepErrorEvent, GenerateTextStepStartEvent, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, GenericToolApprovalFunction, GetVideoStatusResult, HttpChatTransport, HttpChatTransportInitOptions, IdGenerator, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, ImagePart, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferSchema, InferPartialOutput as InferStreamOutput, InferTelemetryEvent, InferToolInput, InferToolOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, Instructions, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidPromptError, InvalidResponseDataError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONParseError, JSONSchema7$2 as JSONSchema7, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelCallEndEvent, LanguageModelCallOptions, LanguageModelCallStartEvent, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LoadAPIKeyError, LoadSettingError, LogWarningsFunction, MessageConversionError, MissingToolResultsError, ModelInfo, ModelMessage, NoContentGeneratedError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchModelError, NoSuchProviderError, NoSuchProviderReferenceError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnLanguageModelCallEndCallback, OnLanguageModelCallStartCallback, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, OnToolExecutionEndCallback, OnToolExecutionStartCallback, output_d_exports as Output, OutputChunkTimingStats, Output as OutputInterface, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, PrepareWebSocketChatTransportReconnectToStreamRequest, PrepareWebSocketChatTransportSendMessagesRequest, Prompt, Provider, ProviderMetadata, ProviderReference, ProviderRegistryProvider, ReasoningFileOutput, ReasoningFileUIPart, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RequestOptions, RerankEndEvent, RerankResult, RerankStartEvent, RerankingModel, RerankingModelCallEndEvent, RerankingModelCallStartEvent, RetryError, SafeValidateUIMessagesResult, SafeValidateWebSocketChatTransportRequestResult, Schema, SerialJobExecutor, SingleToolApprovalFunction, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechResult, StartVideoResult, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepResultPerformance, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamProviderError, StreamTextEndEvent, StreamTextInclude, StreamTextOnChunkCallback, StreamTextOnEndCallback, StreamTextOnErrorCallback, StreamTextOnErrorResult, StreamTextOnErrorRetryCallback, StreamTextResult, StreamTextTransform, StreamTranscriptionResult, SystemModelMessage, Telemetry, TelemetryOptions, TelemetryTracingChannelMessage, TelemetryTracingEventType, TextPart, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToUIMessageChunkOptions, TooManyEmbeddingValuesForCallError, Tool, ToolApprovalConfiguration, ToolApprovalRequest, ToolApprovalRequestOutput, ToolApprovalResponse, ToolApprovalResponseOutput, ToolApprovalStatus, ToolCallNotFoundForApprovalError, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolChoiceViolationError, ToolContent, ToolExecuteFunction, ToolExecutionEndEvent, ToolExecutionOptions, ToolExecutionStartEvent, ToolInputRefinement, ToolLoopAgent, ToolLoopAgentSettings, ToolModelMessage, ToolOrder, ToolOutputErrorUIPart, ToolResultPart, ToolSet, ToolUIPart, TranscriptionEndEvent, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionResult, TranscriptionStartEvent, TranscriptionStreamPart, TypeValidationError, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnEndCallback, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepEndCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamOutcome, UIMessageStreamWriter, UIMessageStreamWriterWithOutcome, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedFunctionalityError, UnsupportedModelVersionError, UploadFileResult, UploadSkillResult, UseCompletionOptions, UserContent, UserModelMessage, Warning, WebSocketChatTransport, WebSocketChatTransportAbortRequest, WebSocketChatTransportInitOptions, WebSocketChatTransportRequest, WebSocketChatTransportResponse, WebSocketChatTransportResumeRequest, WebSocketChatTransportSendRequest, addToolInputExamplesMiddleware, asSchema, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createGateway, createIdGenerator, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, dynamicTool, embed, embedMany, cancelBatch as experimental_cancelBatch, experimental_createProviderRegistry, createSteering as experimental_createSteering, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, experimental_evaluate, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamSpeech as experimental_streamSpeech, streamTextLowMemory as experimental_streamTextLowMemory, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, toolCaller as experimental_toolCaller, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, gateway, generateId$1 as generateId, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isTextUIPart, isToolOutputErrorUIPart, isToolUIPart, jsonSchema, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parseJsonEventStream, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, safeValidateWebSocketChatTransportRequest, simulateReadableStream, simulateStreamingMiddleware, smoothStream, isStepCount as stepCountIs, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, tool$1 as tool, toolModelMessageSchema, toolSearch, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel$1 as wrapLanguageModel, wrapProvider, zodSchema };
|
|
14133
14581
|
}
|
|
14582
|
+
//#region src/types/citation.d.ts
|
|
14583
|
+
/** A reference supporting a generated text part. */
|
|
14584
|
+
type Citation = LanguageModelV4Citation;
|
|
14585
|
+
//#endregion
|
|
14134
14586
|
//#region src/types/embedding-model.d.ts
|
|
14135
14587
|
/**
|
|
14136
14588
|
* Embedding model that is used by the AI SDK.
|
|
@@ -14245,9 +14697,10 @@ type LanguageModel = GlobalProviderModelId | LanguageModelV4 | LanguageModelV3$1
|
|
|
14245
14697
|
* - `content-filter`: content filter violation stopped the model
|
|
14246
14698
|
* - `tool-calls`: model triggered tool calls
|
|
14247
14699
|
* - `error`: model stopped because of an error
|
|
14700
|
+
* - `interrupted`: provider stream ended without a completion signal; output may be incomplete
|
|
14248
14701
|
* - `other`: model stopped for other reasons
|
|
14249
14702
|
*/
|
|
14250
|
-
type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
14703
|
+
type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'interrupted' | 'other';
|
|
14251
14704
|
/**
|
|
14252
14705
|
* Registry for call warning variants. Packages that expose additional warning
|
|
14253
14706
|
* protocols can augment this interface.
|
|
@@ -14582,6 +15035,8 @@ type EmbedStartEvent<RUNTIME_CONTEXT extends Context$1 = Context$1> = {
|
|
|
14582
15035
|
readonly modelId: string;
|
|
14583
15036
|
/** The value(s) being embedded. A string for embed, an array for embedMany. */
|
|
14584
15037
|
readonly value: string | Array<string>;
|
|
15038
|
+
/** Requested output dimensions, when specified. */
|
|
15039
|
+
readonly dimensions?: number;
|
|
14585
15040
|
/** Maximum number of retries for failed requests. */
|
|
14586
15041
|
readonly maxRetries: number;
|
|
14587
15042
|
/** Additional HTTP headers sent with the request. */
|
|
@@ -14643,6 +15098,8 @@ type EmbeddingModelCallStartEvent = {
|
|
|
14643
15098
|
readonly modelId: string;
|
|
14644
15099
|
/** The values being embedded in this particular model call. */
|
|
14645
15100
|
readonly values: Array<string>;
|
|
15101
|
+
/** Requested output dimensions, when specified. */
|
|
15102
|
+
readonly dimensions?: number;
|
|
14646
15103
|
};
|
|
14647
15104
|
/**
|
|
14648
15105
|
* Event fired when an individual embedding model call (doEmbed) completes.
|
|
@@ -14668,10 +15125,17 @@ type EmbeddingModelCallEndEvent = {
|
|
|
14668
15125
|
readonly usage: EmbeddingModelUsage;
|
|
14669
15126
|
};
|
|
14670
15127
|
//#endregion
|
|
15128
|
+
//#region src/decide/decision-state.d.ts
|
|
15129
|
+
/** Shared text, JSON data, or ordered multimodal parts for a decision. */
|
|
15130
|
+
type DecisionState = string | Readonly<JSONObject$2> | readonly DecisionStatePart[];
|
|
15131
|
+
type DecisionStatePart = TextPart | FilePart | {
|
|
15132
|
+
type: 'json';
|
|
15133
|
+
value: JSONValue$3;
|
|
15134
|
+
};
|
|
15135
|
+
//#endregion
|
|
14671
15136
|
//#region src/decide/decision-result.d.ts
|
|
14672
15137
|
type DecisionModel = string | DecisionModelV4 | Experimental_EvaluationModelV4;
|
|
14673
|
-
type
|
|
14674
|
-
type DecisionAnswer<QUESTION extends DecisionQuestion> = QUESTION extends {
|
|
15138
|
+
type DecisionAnswer<QUESTION extends DecisionModelV4Question> = QUESTION extends {
|
|
14675
15139
|
type: 'choice';
|
|
14676
15140
|
criteria: infer CRITERIA;
|
|
14677
15141
|
} ? {
|
|
@@ -14684,11 +15148,21 @@ type DecisionAnswer<QUESTION extends DecisionQuestion> = QUESTION extends {
|
|
|
14684
15148
|
type: 'score';
|
|
14685
15149
|
score: number;
|
|
14686
15150
|
probabilities?: Record<string, number>;
|
|
15151
|
+
} : QUESTION extends {
|
|
15152
|
+
type: 'box';
|
|
15153
|
+
} ? {
|
|
15154
|
+
type: 'box';
|
|
15155
|
+
box: {
|
|
15156
|
+
top: number;
|
|
15157
|
+
bottom: number;
|
|
15158
|
+
left: number;
|
|
15159
|
+
right: number;
|
|
15160
|
+
};
|
|
14687
15161
|
} : {
|
|
14688
15162
|
type: 'boolean';
|
|
14689
15163
|
probability: number;
|
|
14690
15164
|
};
|
|
14691
|
-
type DecisionResult<QUESTIONS extends Record<string,
|
|
15165
|
+
type DecisionResult<QUESTIONS extends Record<string, DecisionModelV4Question>> = {
|
|
14692
15166
|
readonly answers: { [ID in keyof QUESTIONS]: DecisionAnswer<QUESTIONS[ID]>; };
|
|
14693
15167
|
readonly usage: {
|
|
14694
15168
|
inputTokens: number | undefined;
|
|
@@ -14722,9 +15196,13 @@ type DecideStartEvent<RUNTIME_CONTEXT extends Context$1 = Context$1> = {
|
|
|
14722
15196
|
/** The decision model identifier. */
|
|
14723
15197
|
readonly modelId: string;
|
|
14724
15198
|
/** The shared state used to make decisions. */
|
|
14725
|
-
readonly state:
|
|
15199
|
+
readonly state: DecisionState;
|
|
14726
15200
|
/** The questions to decide against the shared state. */
|
|
14727
|
-
readonly questions: Readonly<Record<string,
|
|
15201
|
+
readonly questions: Readonly<Record<string, DecisionModelV4Question>>;
|
|
15202
|
+
/** Maximum output tokens requested for the decision. */
|
|
15203
|
+
readonly maxOutputTokens?: number;
|
|
15204
|
+
/** Reasoning effort requested for the decision. */
|
|
15205
|
+
readonly reasoning?: DecisionModelV4CallOptions['reasoning'];
|
|
14728
15206
|
/** Maximum number of retries for the decision model call. */
|
|
14729
15207
|
readonly maxRetries: number;
|
|
14730
15208
|
/** Additional HTTP headers sent with the request. */
|
|
@@ -14739,17 +15217,17 @@ type DecideStartEvent<RUNTIME_CONTEXT extends Context$1 = Context$1> = {
|
|
|
14739
15217
|
*/
|
|
14740
15218
|
type DecideEndEvent<RUNTIME_CONTEXT extends Context$1 = Context$1> = DecideStartEvent<RUNTIME_CONTEXT> & {
|
|
14741
15219
|
/** Exactly one typed answer per question ID. */
|
|
14742
|
-
readonly answers: DecisionResult<Record<string,
|
|
15220
|
+
readonly answers: DecisionResult<Record<string, DecisionModelV4Question>>['answers'];
|
|
14743
15221
|
/** Token usage for the decision operation. */
|
|
14744
|
-
readonly usage: DecisionResult<Record<string,
|
|
15222
|
+
readonly usage: DecisionResult<Record<string, DecisionModelV4Question>>['usage'];
|
|
14745
15223
|
/** Warnings from the decision model. */
|
|
14746
|
-
readonly warnings: DecisionResult<Record<string,
|
|
15224
|
+
readonly warnings: DecisionResult<Record<string, DecisionModelV4Question>>['warnings'];
|
|
14747
15225
|
/** Provider-declared decimal precision for probabilities and scores. */
|
|
14748
|
-
readonly rounding: DecisionResult<Record<string,
|
|
15226
|
+
readonly rounding: DecisionResult<Record<string, DecisionModelV4Question>>['rounding'];
|
|
14749
15227
|
/** Optional provider-specific metadata. */
|
|
14750
|
-
readonly providerMetadata: DecisionResult<Record<string,
|
|
15228
|
+
readonly providerMetadata: DecisionResult<Record<string, DecisionModelV4Question>>['providerMetadata'];
|
|
14751
15229
|
/** Response metadata, including the resolved model ID and timestamp. */
|
|
14752
|
-
readonly response: DecisionResult<Record<string,
|
|
15230
|
+
readonly response: DecisionResult<Record<string, DecisionModelV4Question>>['response'];
|
|
14753
15231
|
};
|
|
14754
15232
|
/**
|
|
14755
15233
|
* Event fired when the decision model call begins.
|
|
@@ -14768,7 +15246,7 @@ type DecisionModelCallStartEvent = {
|
|
|
14768
15246
|
/** The shared state used to make decisions. */
|
|
14769
15247
|
readonly state: DecisionModelV4CallOptions['state'];
|
|
14770
15248
|
/** The questions to decide against the shared state. */
|
|
14771
|
-
readonly questions:
|
|
15249
|
+
readonly questions: DecisionModelV4CallOptions['questions'];
|
|
14772
15250
|
};
|
|
14773
15251
|
/**
|
|
14774
15252
|
* Event fired after the decision model response has been validated.
|
|
@@ -14865,9 +15343,9 @@ type LanguageModelCallOptions = {
|
|
|
14865
15343
|
* Timeout configuration for API calls. Can be specified as:
|
|
14866
15344
|
* - A number representing milliseconds
|
|
14867
15345
|
* - An object with `totalMs` property for the total timeout in milliseconds
|
|
14868
|
-
* - An object with `stepMs` property for the timeout of each step in milliseconds
|
|
15346
|
+
* - An object with `stepMs` property for the timeout of each complete step, including model generation, retries, and local tool execution, in milliseconds
|
|
14869
15347
|
* - An object with `firstChunkMs` property for the timeout until the first content chunk of each step (streaming only)
|
|
14870
|
-
* - An object with `chunkMs` property for the timeout between
|
|
15348
|
+
* - An object with `chunkMs` property for the timeout between meaningful model output chunks, starting with the first output and ending when the model response ends (streaming only)
|
|
14871
15349
|
* - An object with `toolMs` property for the default timeout for all tool executions
|
|
14872
15350
|
* - An object with `tools` property for per-tool timeout overrides using `{toolName}Ms` keys
|
|
14873
15351
|
*/
|
|
@@ -15421,7 +15899,7 @@ type BaseToolCall = {
|
|
|
15421
15899
|
* A tool call whose `toolName` maps to a tool in the declared tool set,
|
|
15422
15900
|
* with an `input` type inferred from that tool's input schema.
|
|
15423
15901
|
*/
|
|
15424
|
-
type StaticToolCall<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
15902
|
+
type StaticToolCall<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolCall & {
|
|
15425
15903
|
toolName: NAME & string;
|
|
15426
15904
|
input: InferToolInput<TOOLS[NAME]>;
|
|
15427
15905
|
dynamic?: false | undefined;
|
|
@@ -15516,7 +15994,7 @@ type ToolApprovalResponseOutput<TOOLS extends ToolSet> = {
|
|
|
15516
15994
|
};
|
|
15517
15995
|
//#endregion
|
|
15518
15996
|
//#region src/generate-text/tool-error.d.ts
|
|
15519
|
-
type StaticToolError<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
15997
|
+
type StaticToolError<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
15520
15998
|
type: 'tool-error';
|
|
15521
15999
|
toolCallId: string;
|
|
15522
16000
|
toolName: NAME & string;
|
|
@@ -15543,7 +16021,7 @@ type DynamicToolError = {
|
|
|
15543
16021
|
type TypedToolError<TOOLS extends ToolSet> = StaticToolError<TOOLS> | DynamicToolError;
|
|
15544
16022
|
//#endregion
|
|
15545
16023
|
//#region src/generate-text/tool-result.d.ts
|
|
15546
|
-
type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
16024
|
+
type StaticToolResult<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
15547
16025
|
type: 'tool-result';
|
|
15548
16026
|
toolCallId: string;
|
|
15549
16027
|
toolName: NAME & string;
|
|
@@ -15575,6 +16053,7 @@ type TypedToolResult<TOOLS extends ToolSet> = StaticToolResult<TOOLS> | DynamicT
|
|
|
15575
16053
|
type ContentPart<TOOLS extends ToolSet> = {
|
|
15576
16054
|
type: 'text';
|
|
15577
16055
|
text: string;
|
|
16056
|
+
citations?: Array<Citation>;
|
|
15578
16057
|
providerMetadata?: ProviderMetadata;
|
|
15579
16058
|
} | {
|
|
15580
16059
|
type: 'custom';
|
|
@@ -15800,6 +16279,12 @@ type StepResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Conte
|
|
|
15800
16279
|
* results that can be fully encapsulated in the provider.
|
|
15801
16280
|
*/
|
|
15802
16281
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
16282
|
+
/**
|
|
16283
|
+
* The user messages that were sent with `experimental_steering` and added
|
|
16284
|
+
* to the input of this step. Undefined when the step received no steering
|
|
16285
|
+
* messages.
|
|
16286
|
+
*/
|
|
16287
|
+
readonly experimental_steeringMessages?: Array<UserModelMessage>;
|
|
15803
16288
|
};
|
|
15804
16289
|
//#endregion
|
|
15805
16290
|
//#region src/generate-text/language-model-events.d.ts
|
|
@@ -15905,205 +16390,6 @@ type OnLanguageModelCallStartCallback = Callback<LanguageModelCallStartEvent>;
|
|
|
15905
16390
|
*/
|
|
15906
16391
|
type OnLanguageModelCallEndCallback<TOOLS extends ToolSet = ToolSet> = Callback<LanguageModelCallEndEvent<TOOLS>>;
|
|
15907
16392
|
//#endregion
|
|
15908
|
-
//#region src/generate-text/output-utils.d.ts
|
|
15909
|
-
/**
|
|
15910
|
-
* Infers the complete output type from the output specification.
|
|
15911
|
-
*/
|
|
15912
|
-
type InferCompleteOutput<OUTPUT extends Output> = OUTPUT extends Output<infer COMPLETE_OUTPUT, any, any> ? COMPLETE_OUTPUT : never;
|
|
15913
|
-
/**
|
|
15914
|
-
* Infers the partial output type from the output specification.
|
|
15915
|
-
*/
|
|
15916
|
-
type InferPartialOutput<OUTPUT extends Output> = OUTPUT extends Output<any, infer PARTIAL_OUTPUT, any> ? PARTIAL_OUTPUT : never;
|
|
15917
|
-
/**
|
|
15918
|
-
* Infers the element type from an array output specification.
|
|
15919
|
-
*/
|
|
15920
|
-
type InferElementOutput<OUTPUT extends Output> = OUTPUT extends Output<any, any, infer ELEMENT> ? ELEMENT : never;
|
|
15921
|
-
//#endregion
|
|
15922
|
-
//#region src/generate-text/tool-order.d.ts
|
|
15923
|
-
/**
|
|
15924
|
-
* Tool names that define the order in which tools are sent to the provider.
|
|
15925
|
-
*
|
|
15926
|
-
* Tool names are object keys at runtime, so the type is restricted to the
|
|
15927
|
-
* string keys of the configured tool set. The list can be partial; tools not
|
|
15928
|
-
* listed in `toolOrder` are sent after the listed tools, sorted alphabetically.
|
|
15929
|
-
*/
|
|
15930
|
-
type ToolOrder<TOOLS extends ToolSet> = ReadonlyArray<keyof TOOLS & string> | undefined;
|
|
15931
|
-
//#endregion
|
|
15932
|
-
//#region src/generate-text/prepare-step.d.ts
|
|
15933
|
-
/**
|
|
15934
|
-
* Function that you can use to provide different settings for a step.
|
|
15935
|
-
*
|
|
15936
|
-
* @param options - The options for the step.
|
|
15937
|
-
* @param options.steps - The steps that have been executed so far.
|
|
15938
|
-
* @param options.stepNumber - The number of the step that is being executed.
|
|
15939
|
-
* @param options.model - The model that is being used.
|
|
15940
|
-
* @param options.instructions - The instructions that will be sent to the model for the current step.
|
|
15941
|
-
* @param options.initialInstructions - The initial instructions that were passed into generateText or streamText.
|
|
15942
|
-
* @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.
|
|
15943
|
-
* @param options.initialMessages - The initial messages that were passed into generateText or streamText.
|
|
15944
|
-
* @param options.responseMessages - The response messages that have been accumulated from previous steps.
|
|
15945
|
-
* @param options.runtimeContext - The user-defined runtime context.
|
|
15946
|
-
*
|
|
15947
|
-
* @returns An object that contains the settings for the step.
|
|
15948
|
-
* If you return undefined (or for undefined settings), the settings from the outer level will be used.
|
|
15949
|
-
*/
|
|
15950
|
-
type PrepareStepFunction<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = (options: {
|
|
15951
|
-
/**
|
|
15952
|
-
* The steps that have been executed so far.
|
|
15953
|
-
*/
|
|
15954
|
-
steps: Array<StepResult<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>>;
|
|
15955
|
-
/**
|
|
15956
|
-
* The number of the step that is being executed.
|
|
15957
|
-
*/
|
|
15958
|
-
stepNumber: number;
|
|
15959
|
-
/**
|
|
15960
|
-
* The model instance that is being used for this step.
|
|
15961
|
-
*/
|
|
15962
|
-
model: LanguageModel;
|
|
15963
|
-
/**
|
|
15964
|
-
* The instructions that will be sent to the model for the current step.
|
|
15965
|
-
*/
|
|
15966
|
-
instructions: Instructions | undefined;
|
|
15967
|
-
/**
|
|
15968
|
-
* The initial instructions that were passed into generateText or streamText.
|
|
15969
|
-
*/
|
|
15970
|
-
initialInstructions: Instructions | undefined;
|
|
15971
|
-
/**
|
|
15972
|
-
* The messages that will be sent to the model for the current step.
|
|
15973
|
-
* If you return a `messages` override, those messages carry forward to later steps.
|
|
15974
|
-
*/
|
|
15975
|
-
messages: Array<ModelMessage>;
|
|
15976
|
-
/**
|
|
15977
|
-
* The initial messages that were passed into generateText or streamText.
|
|
15978
|
-
*/
|
|
15979
|
-
initialMessages: Array<ModelMessage>;
|
|
15980
|
-
/**
|
|
15981
|
-
* The response messages that have been accumulated from all previous steps.
|
|
15982
|
-
*/
|
|
15983
|
-
responseMessages: Array<ResponseMessage>;
|
|
15984
|
-
/**
|
|
15985
|
-
* Tool context.
|
|
15986
|
-
*/
|
|
15987
|
-
toolsContext: InferToolSetContext<TOOLS>;
|
|
15988
|
-
/**
|
|
15989
|
-
* User-defined runtime context.
|
|
15990
|
-
*/
|
|
15991
|
-
runtimeContext: RUNTIME_CONTEXT;
|
|
15992
|
-
/**
|
|
15993
|
-
* The sandbox environment that the step is operating in.
|
|
15994
|
-
*/
|
|
15995
|
-
experimental_sandbox?: SandboxSession;
|
|
15996
|
-
}) => PromiseLike<PrepareStepResult<TOOLS, RUNTIME_CONTEXT>> | PrepareStepResult<TOOLS, RUNTIME_CONTEXT>;
|
|
15997
|
-
/**
|
|
15998
|
-
* The result type returned by a {@link PrepareStepFunction},
|
|
15999
|
-
* allowing per-step overrides of model call settings, model, tools,
|
|
16000
|
-
* instructions, or messages.
|
|
16001
|
-
*
|
|
16002
|
-
* Model call setting overrides apply only to the current step. Undefined
|
|
16003
|
-
* settings fall back to the outer call settings.
|
|
16004
|
-
*/
|
|
16005
|
-
type PrepareStepResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = ({
|
|
16006
|
-
/**
|
|
16007
|
-
* Optionally override which LanguageModel instance is used for this step.
|
|
16008
|
-
*/
|
|
16009
|
-
model?: LanguageModel;
|
|
16010
|
-
/**
|
|
16011
|
-
* Optionally set which tool the model must call, or provide tool call configuration
|
|
16012
|
-
* for this step.
|
|
16013
|
-
*/
|
|
16014
|
-
toolChoice?: ToolChoice<NoInfer<TOOLS>>;
|
|
16015
|
-
/**
|
|
16016
|
-
* If provided, only these tools are enabled/available for this step.
|
|
16017
|
-
*/
|
|
16018
|
-
activeTools?: ActiveTools<NoInfer<TOOLS>>;
|
|
16019
|
-
/**
|
|
16020
|
-
* Optionally override the order in which tools are sent to the provider
|
|
16021
|
-
* for this step.
|
|
16022
|
-
*/
|
|
16023
|
-
toolOrder?: ToolOrder<NoInfer<TOOLS>>;
|
|
16024
|
-
/**
|
|
16025
|
-
* Optionally override the instructions sent to the model for this step.
|
|
16026
|
-
* The override carries forward to later steps.
|
|
16027
|
-
*/
|
|
16028
|
-
instructions?: Instructions;
|
|
16029
|
-
/**
|
|
16030
|
-
* Optionally override the instructions sent to the model for this step.
|
|
16031
|
-
*
|
|
16032
|
-
* @deprecated Use `instructions` instead.
|
|
16033
|
-
*/
|
|
16034
|
-
system?: Instructions;
|
|
16035
|
-
/**
|
|
16036
|
-
* Optionally override the full set of messages sent to the model
|
|
16037
|
-
* for this step. The override carries forward to later steps.
|
|
16038
|
-
*/
|
|
16039
|
-
messages?: Array<ModelMessage>;
|
|
16040
|
-
/**
|
|
16041
|
-
* Tool context.
|
|
16042
|
-
*
|
|
16043
|
-
* Changing the toolsContext will affect the toolsContext in this step
|
|
16044
|
-
* and all subsequent steps.
|
|
16045
|
-
*
|
|
16046
|
-
* The toolsContext is passed into tool execution.
|
|
16047
|
-
*/
|
|
16048
|
-
toolsContext?: InferToolSetContext<TOOLS>;
|
|
16049
|
-
/**
|
|
16050
|
-
* Runtime context.
|
|
16051
|
-
*
|
|
16052
|
-
* Changing the runtimeContext will affect the runtimeContext in this step
|
|
16053
|
-
* and all subsequent steps.
|
|
16054
|
-
*/
|
|
16055
|
-
runtimeContext?: RUNTIME_CONTEXT;
|
|
16056
|
-
/**
|
|
16057
|
-
* The sandbox environment that the step is operating in.
|
|
16058
|
-
*
|
|
16059
|
-
* Changing the sandbox will affect tool execution in this step only.
|
|
16060
|
-
*/
|
|
16061
|
-
experimental_sandbox?: SandboxSession;
|
|
16062
|
-
/**
|
|
16063
|
-
* Additional provider-specific options for this step.
|
|
16064
|
-
*
|
|
16065
|
-
* Can be used to pass provider-specific configuration such as
|
|
16066
|
-
* container IDs for Anthropic's code execution.
|
|
16067
|
-
*/
|
|
16068
|
-
providerOptions?: ProviderOptions;
|
|
16069
|
-
} & LanguageModelCallOptions) | undefined;
|
|
16070
|
-
//#endregion
|
|
16071
|
-
//#region src/generate-text/stop-condition.d.ts
|
|
16072
|
-
/**
|
|
16073
|
-
* A predicate that decides whether a tool-calling loop should stop after the
|
|
16074
|
-
* current step.
|
|
16075
|
-
*
|
|
16076
|
-
* A tool calling loop continues until one of the following conditions is met:
|
|
16077
|
-
* - The model returns a finish reason other than `tool-calls`
|
|
16078
|
-
* - A tool without an execute function is called
|
|
16079
|
-
* - A tool call needs approval
|
|
16080
|
-
* - One of the provided stop conditions returns `true`
|
|
16081
|
-
*/
|
|
16082
|
-
type StopCondition<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = (options: {
|
|
16083
|
-
steps: Array<StepResult<TOOLS, RUNTIME_CONTEXT>>;
|
|
16084
|
-
}) => PromiseLike<boolean> | boolean;
|
|
16085
|
-
/**
|
|
16086
|
-
* Creates a stop condition that returns `true` when the number of completed
|
|
16087
|
-
* steps equals `stepCount`.
|
|
16088
|
-
*
|
|
16089
|
-
* @param stepCount - The number of steps to allow before stopping.
|
|
16090
|
-
*/
|
|
16091
|
-
declare function isStepCount(stepCount: number): StopCondition<any, any>;
|
|
16092
|
-
/**
|
|
16093
|
-
* Creates a stop condition that never returns `true`.
|
|
16094
|
-
*
|
|
16095
|
-
* This lets the tool-calling loop continue until it reaches one of its
|
|
16096
|
-
* natural termination conditions.
|
|
16097
|
-
*/
|
|
16098
|
-
declare function isLoopFinished(): StopCondition<any, any>;
|
|
16099
|
-
/**
|
|
16100
|
-
* Creates a stop condition that returns `true` when the most recent step
|
|
16101
|
-
* contains a tool call with any of the specified names.
|
|
16102
|
-
*
|
|
16103
|
-
* @param toolName - The names of the tools that should stop the loop.
|
|
16104
|
-
*/
|
|
16105
|
-
declare function hasToolCall<TOOLS extends ToolSet>(...toolName: Array<keyof TOOLS | (string & {})>): StopCondition<TOOLS, any>;
|
|
16106
|
-
//#endregion
|
|
16107
16393
|
//#region src/ui/ui-messages.d.ts
|
|
16108
16394
|
/**
|
|
16109
16395
|
* The data types that can be used in the UI message for the UI message data parts.
|
|
@@ -16159,6 +16445,8 @@ type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = Text
|
|
|
16159
16445
|
*/
|
|
16160
16446
|
type TextUIPart = {
|
|
16161
16447
|
type: 'text';
|
|
16448
|
+
/** References supporting this text, separate from retrieved sources. */
|
|
16449
|
+
citations?: Array<Citation>;
|
|
16162
16450
|
/**
|
|
16163
16451
|
* The text content.
|
|
16164
16452
|
*/
|
|
@@ -16330,6 +16618,8 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
16330
16618
|
* and later resumed.
|
|
16331
16619
|
*/
|
|
16332
16620
|
rawInput?: string;
|
|
16621
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
16622
|
+
inputEncoding?: 'json' | 'text';
|
|
16333
16623
|
output?: never;
|
|
16334
16624
|
errorText?: never;
|
|
16335
16625
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -16466,6 +16756,8 @@ type DynamicToolUIPart = {
|
|
|
16466
16756
|
* and later resumed.
|
|
16467
16757
|
*/
|
|
16468
16758
|
rawInput?: string;
|
|
16759
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
16760
|
+
inputEncoding?: 'json' | 'text';
|
|
16469
16761
|
output?: never;
|
|
16470
16762
|
errorText?: never;
|
|
16471
16763
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -16663,6 +16955,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
16663
16955
|
providerMetadata?: ProviderMetadata;
|
|
16664
16956
|
} | {
|
|
16665
16957
|
type: 'text-end';
|
|
16958
|
+
citations?: Array<Citation>;
|
|
16666
16959
|
id: string;
|
|
16667
16960
|
providerMetadata?: ProviderMetadata;
|
|
16668
16961
|
} | {
|
|
@@ -16746,6 +17039,8 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
16746
17039
|
type: 'tool-input-start';
|
|
16747
17040
|
toolCallId: string;
|
|
16748
17041
|
toolName: string;
|
|
17042
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
17043
|
+
inputEncoding?: 'json' | 'text';
|
|
16749
17044
|
providerExecuted?: boolean;
|
|
16750
17045
|
providerMetadata?: ProviderMetadata;
|
|
16751
17046
|
toolMetadata?: JSONObject$2;
|
|
@@ -16865,28 +17160,59 @@ type UIMessageStreamOnEndCallback<UI_MESSAGE extends UIMessage> = (event: {
|
|
|
16865
17160
|
finishReason?: FinishReason;
|
|
16866
17161
|
}) => PromiseLike<void> | void;
|
|
16867
17162
|
//#endregion
|
|
16868
|
-
//#region src/ui-message-stream/ui-message-stream-
|
|
17163
|
+
//#region src/ui-message-stream/ui-message-stream-on-step-end-callback.d.ts
|
|
16869
17164
|
/**
|
|
16870
|
-
*
|
|
16871
|
-
*
|
|
17165
|
+
* Callback that is called when a step ends during streaming.
|
|
17166
|
+
* This is useful for persisting intermediate UI messages during multi-step agent runs.
|
|
16872
17167
|
*/
|
|
16873
|
-
type
|
|
17168
|
+
type UIMessageStreamOnStepEndCallback<UI_MESSAGE extends UIMessage> = (event: {
|
|
16874
17169
|
/**
|
|
16875
|
-
*
|
|
16876
|
-
* When set, an opening comment is sent immediately and additional comments
|
|
16877
|
-
* are sent after the stream has been idle for the configured interval.
|
|
17170
|
+
* The updated list of UI messages at the end of this step.
|
|
16878
17171
|
*/
|
|
16879
|
-
|
|
17172
|
+
messages: UI_MESSAGE[];
|
|
16880
17173
|
/**
|
|
16881
|
-
*
|
|
16882
|
-
*
|
|
16883
|
-
* The callback receives a tee'd copy of the stream and does not block the response.
|
|
17174
|
+
* Indicates whether the response message is a continuation of the last original message,
|
|
17175
|
+
* or if a new message was created.
|
|
16884
17176
|
*/
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
17177
|
+
isContinuation: boolean;
|
|
17178
|
+
/**
|
|
17179
|
+
* The message that was sent to the client as a response
|
|
17180
|
+
* (including the original message if it was extended).
|
|
17181
|
+
*/
|
|
17182
|
+
responseMessage: UI_MESSAGE;
|
|
17183
|
+
}) => PromiseLike<void> | void;
|
|
17184
|
+
//#endregion
|
|
17185
|
+
//#region src/ui-message-stream/ui-message-stream-on-step-finish-callback.d.ts
|
|
17186
|
+
/**
|
|
17187
|
+
* Callback that is called when a step finishes during streaming.
|
|
17188
|
+
* This is useful for persisting intermediate UI messages during multi-step agent runs.
|
|
17189
|
+
*
|
|
17190
|
+
* @deprecated Use `UIMessageStreamOnStepEndCallback` instead.
|
|
17191
|
+
*/
|
|
17192
|
+
type UIMessageStreamOnStepFinishCallback<UI_MESSAGE extends UIMessage> = UIMessageStreamOnStepEndCallback<UI_MESSAGE>;
|
|
17193
|
+
//#endregion
|
|
17194
|
+
//#region src/ui-message-stream/ui-message-stream-response-init.d.ts
|
|
17195
|
+
/**
|
|
17196
|
+
* Options for creating a UI message stream response.
|
|
17197
|
+
* Extends the standard `ResponseInit` with additional streaming options.
|
|
17198
|
+
*/
|
|
17199
|
+
type UIMessageStreamResponseInit = ResponseInit & {
|
|
17200
|
+
/**
|
|
17201
|
+
* Optional interval in milliseconds for sending SSE keep-alive comments.
|
|
17202
|
+
* When set, an opening comment is sent immediately and additional comments
|
|
17203
|
+
* are sent after the stream has been idle for the configured interval.
|
|
17204
|
+
*/
|
|
17205
|
+
keepAliveMs?: number;
|
|
17206
|
+
/**
|
|
17207
|
+
* Optional callback to consume a copy of the SSE stream independently.
|
|
17208
|
+
* This is useful for logging, debugging, or processing the stream in parallel.
|
|
17209
|
+
* The callback receives a tee'd copy of the stream and does not block the response.
|
|
17210
|
+
*/
|
|
17211
|
+
consumeSseStream?: (options: {
|
|
17212
|
+
stream: ReadableStream<string>;
|
|
17213
|
+
}) => PromiseLike<void> | void;
|
|
17214
|
+
};
|
|
17215
|
+
//#endregion
|
|
16890
17216
|
//#region src/util/async-iterable-stream.d.ts
|
|
16891
17217
|
/**
|
|
16892
17218
|
* A type that combines AsyncIterable and ReadableStream.
|
|
@@ -16897,11 +17223,25 @@ type AsyncIterableStream<T> = AsyncIterable<T> & ReadableStream<T>;
|
|
|
16897
17223
|
//#region src/util/error-handler.d.ts
|
|
16898
17224
|
type ErrorHandler = (error: unknown) => void;
|
|
16899
17225
|
//#endregion
|
|
17226
|
+
//#region src/generate-text/output-utils.d.ts
|
|
17227
|
+
/**
|
|
17228
|
+
* Infers the complete output type from the output specification.
|
|
17229
|
+
*/
|
|
17230
|
+
type InferCompleteOutput<OUTPUT extends Output> = OUTPUT extends Output<infer COMPLETE_OUTPUT, any, any> ? COMPLETE_OUTPUT : never;
|
|
17231
|
+
/**
|
|
17232
|
+
* Infers the partial output type from the output specification.
|
|
17233
|
+
*/
|
|
17234
|
+
type InferPartialOutput<OUTPUT extends Output> = OUTPUT extends Output<any, infer PARTIAL_OUTPUT, any> ? PARTIAL_OUTPUT : never;
|
|
17235
|
+
/**
|
|
17236
|
+
* Infers the element type from an array output specification.
|
|
17237
|
+
*/
|
|
17238
|
+
type InferElementOutput<OUTPUT extends Output> = OUTPUT extends Output<any, any, infer ELEMENT> ? ELEMENT : never;
|
|
17239
|
+
//#endregion
|
|
16900
17240
|
//#region src/generate-text/tool-output-denied.d.ts
|
|
16901
17241
|
/**
|
|
16902
17242
|
* Tool output when the tool execution has been denied (for static tools).
|
|
16903
17243
|
*/
|
|
16904
|
-
type StaticToolOutputDenied<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
17244
|
+
type StaticToolOutputDenied<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: {
|
|
16905
17245
|
type: 'tool-output-denied';
|
|
16906
17246
|
toolCallId: string;
|
|
16907
17247
|
toolName: NAME & string;
|
|
@@ -16927,6 +17267,13 @@ type UIMessageStreamOptions<UI_MESSAGE extends UIMessage> = {
|
|
|
16927
17267
|
* the original messages are provided and the last message is an assistant message).
|
|
16928
17268
|
*/
|
|
16929
17269
|
generateMessageId?: IdGenerator;
|
|
17270
|
+
/**
|
|
17271
|
+
* Called after each step is converted to UI message parts.
|
|
17272
|
+
* Receives the accumulated UI message for inspection or persistence.
|
|
17273
|
+
*/
|
|
17274
|
+
onStepEnd?: UIMessageStreamOnStepEndCallback<UI_MESSAGE>;
|
|
17275
|
+
/** @deprecated Use `onStepEnd` instead. */
|
|
17276
|
+
onStepFinish?: UIMessageStreamOnStepFinishCallback<UI_MESSAGE>;
|
|
16930
17277
|
onEnd?: UIMessageStreamOnEndCallback<UI_MESSAGE>;
|
|
16931
17278
|
/**
|
|
16932
17279
|
* @deprecated Use `onEnd` instead.
|
|
@@ -17254,6 +17601,7 @@ type TextStreamTextStartPart = {
|
|
|
17254
17601
|
};
|
|
17255
17602
|
type TextStreamTextEndPart = {
|
|
17256
17603
|
type: 'text-end';
|
|
17604
|
+
citations?: Array<Citation>;
|
|
17257
17605
|
id: string;
|
|
17258
17606
|
providerMetadata?: ProviderMetadata;
|
|
17259
17607
|
};
|
|
@@ -17282,6 +17630,8 @@ type TextStreamToolInputStartPart = {
|
|
|
17282
17630
|
type: 'tool-input-start';
|
|
17283
17631
|
id: string;
|
|
17284
17632
|
toolName: string;
|
|
17633
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
17634
|
+
inputEncoding?: 'json' | 'text';
|
|
17285
17635
|
providerMetadata?: ProviderMetadata;
|
|
17286
17636
|
toolMetadata?: JSONObject$2;
|
|
17287
17637
|
providerExecuted?: boolean;
|
|
@@ -17363,6 +17713,301 @@ type TextStreamRawPart = {
|
|
|
17363
17713
|
};
|
|
17364
17714
|
type TextStreamPart<TOOLS extends ToolSet> = TextStreamTextStartPart | TextStreamTextEndPart | TextStreamTextDeltaPart | TextStreamReasoningStartPart | TextStreamReasoningEndPart | TextStreamReasoningDeltaPart | TextStreamCustomPart | TextStreamToolInputStartPart | TextStreamToolInputEndPart | TextStreamToolInputDeltaPart | TextStreamSourcePart | TextStreamFilePart | TextStreamReasoningFilePart | TextStreamToolCallPart<TOOLS> | TextStreamToolResultPart<TOOLS> | TextStreamToolErrorPart<TOOLS> | TextStreamToolOutputDeniedPart<TOOLS> | TextStreamToolApprovalRequestPart<TOOLS> | TextStreamToolApprovalResponsePart<TOOLS> | TextStreamStartStepPart | TextStreamFinishStepPart | TextStreamStartPart | TextStreamFinishPart | TextStreamAbortPart | TextStreamErrorPart | TextStreamRawPart;
|
|
17365
17715
|
//#endregion
|
|
17716
|
+
//#region src/generate-text/stream-text-single-consumer-result.d.ts
|
|
17717
|
+
/** A single-consumer view of a text generation, without replay or final content getters. */
|
|
17718
|
+
type StreamTextSingleConsumerResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1, OUTPUT extends Output> = Pick<StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>, 'textStream' | 'stream' | 'fullStream' | 'partialOutputStream' | 'elementStream' | 'totalUsage' | 'usage' | 'finishReason' | 'rawFinishReason' | 'consumeStream' | 'toUIMessageStream' | 'toUIMessageStreamResponse' | 'toTextStreamResponse' | 'pipeUIMessageStreamToResponse' | 'pipeTextStreamToResponse'>;
|
|
17719
|
+
//#endregion
|
|
17720
|
+
//#region src/generate-text/tool-order.d.ts
|
|
17721
|
+
/**
|
|
17722
|
+
* Tool names that define the order in which tools are sent to the provider.
|
|
17723
|
+
*
|
|
17724
|
+
* Tool names are object keys at runtime, so the type is restricted to the
|
|
17725
|
+
* string keys of the configured tool set. The list can be partial; tools not
|
|
17726
|
+
* listed in `toolOrder` are sent after the listed tools, sorted alphabetically.
|
|
17727
|
+
*/
|
|
17728
|
+
type ToolOrder<TOOLS extends ToolSet> = ReadonlyArray<keyof TOOLS & string> | undefined;
|
|
17729
|
+
//#endregion
|
|
17730
|
+
//#region src/generate-text/prepare-step.d.ts
|
|
17731
|
+
/**
|
|
17732
|
+
* Function that you can use to provide different settings for a step.
|
|
17733
|
+
*
|
|
17734
|
+
* @param options - The options for the step.
|
|
17735
|
+
* @param options.steps - The steps that have been executed so far.
|
|
17736
|
+
* @param options.stepNumber - The number of the step that is being executed.
|
|
17737
|
+
* @param options.model - The model that is being used.
|
|
17738
|
+
* @param options.instructions - The instructions that will be sent to the model for the current step.
|
|
17739
|
+
* @param options.initialInstructions - The initial instructions that were passed into generateText or streamText.
|
|
17740
|
+
* @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.
|
|
17741
|
+
* @param options.initialMessages - The initial messages that were passed into generateText or streamText.
|
|
17742
|
+
* @param options.responseMessages - The response messages that have been accumulated from previous steps.
|
|
17743
|
+
* @param options.experimental_steeringMessages - The steering messages that were added to `messages` for the current step.
|
|
17744
|
+
* @param options.runtimeContext - The user-defined runtime context.
|
|
17745
|
+
*
|
|
17746
|
+
* @returns An object that contains the settings for the step.
|
|
17747
|
+
* If you return undefined (or for undefined settings), the settings from the outer level will be used.
|
|
17748
|
+
*/
|
|
17749
|
+
type PrepareStepFunction<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = (options: {
|
|
17750
|
+
/**
|
|
17751
|
+
* The steps that have been executed so far.
|
|
17752
|
+
*/
|
|
17753
|
+
steps: Array<StepResult<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>>;
|
|
17754
|
+
/**
|
|
17755
|
+
* The number of the step that is being executed.
|
|
17756
|
+
*/
|
|
17757
|
+
stepNumber: number;
|
|
17758
|
+
/**
|
|
17759
|
+
* The model instance that is being used for this step.
|
|
17760
|
+
*/
|
|
17761
|
+
model: LanguageModel;
|
|
17762
|
+
/**
|
|
17763
|
+
* The instructions that will be sent to the model for the current step.
|
|
17764
|
+
*/
|
|
17765
|
+
instructions: Instructions | undefined;
|
|
17766
|
+
/**
|
|
17767
|
+
* The initial instructions that were passed into generateText or streamText.
|
|
17768
|
+
*/
|
|
17769
|
+
initialInstructions: Instructions | undefined;
|
|
17770
|
+
/**
|
|
17771
|
+
* The messages that will be sent to the model for the current step.
|
|
17772
|
+
* If you return a `messages` override, those messages carry forward to later steps.
|
|
17773
|
+
*/
|
|
17774
|
+
messages: Array<ModelMessage>;
|
|
17775
|
+
/**
|
|
17776
|
+
* The initial messages that were passed into generateText or streamText.
|
|
17777
|
+
*/
|
|
17778
|
+
initialMessages: Array<ModelMessage>;
|
|
17779
|
+
/**
|
|
17780
|
+
* The response messages that have been accumulated from all previous steps.
|
|
17781
|
+
*/
|
|
17782
|
+
responseMessages: Array<ResponseMessage>;
|
|
17783
|
+
/**
|
|
17784
|
+
* The user messages that were sent with `experimental_steering` and added to
|
|
17785
|
+
* `messages` for the current step. Undefined when the step received no
|
|
17786
|
+
* steering messages. `messages` already contains them. If you return a
|
|
17787
|
+
* `messages` override that is rebuilt from other fields, e.g.
|
|
17788
|
+
* `initialMessages` and `responseMessages`, add them back together with the
|
|
17789
|
+
* steering messages of previous steps from `steps`.
|
|
17790
|
+
*/
|
|
17791
|
+
experimental_steeringMessages?: Array<UserModelMessage>;
|
|
17792
|
+
/**
|
|
17793
|
+
* Tool context.
|
|
17794
|
+
*/
|
|
17795
|
+
toolsContext: InferToolSetContext<TOOLS>;
|
|
17796
|
+
/**
|
|
17797
|
+
* User-defined runtime context.
|
|
17798
|
+
*/
|
|
17799
|
+
runtimeContext: RUNTIME_CONTEXT;
|
|
17800
|
+
/**
|
|
17801
|
+
* The sandbox environment that the step is operating in.
|
|
17802
|
+
*/
|
|
17803
|
+
experimental_sandbox?: SandboxSession;
|
|
17804
|
+
}) => PromiseLike<PrepareStepResult<TOOLS, RUNTIME_CONTEXT>> | PrepareStepResult<TOOLS, RUNTIME_CONTEXT>;
|
|
17805
|
+
/**
|
|
17806
|
+
* The result type returned by a {@link PrepareStepFunction},
|
|
17807
|
+
* allowing per-step overrides of model call settings, model, tools,
|
|
17808
|
+
* instructions, or messages.
|
|
17809
|
+
*
|
|
17810
|
+
* Model call setting overrides apply only to the current step. Undefined
|
|
17811
|
+
* settings fall back to the outer call settings.
|
|
17812
|
+
*/
|
|
17813
|
+
type PrepareStepResult<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = ({
|
|
17814
|
+
/**
|
|
17815
|
+
* Optionally override which LanguageModel instance is used for this step.
|
|
17816
|
+
*/
|
|
17817
|
+
model?: LanguageModel;
|
|
17818
|
+
/**
|
|
17819
|
+
* Optionally set which tool the model must call, or provide tool call configuration
|
|
17820
|
+
* for this step.
|
|
17821
|
+
*/
|
|
17822
|
+
toolChoice?: ToolChoice<NoInfer<TOOLS>>;
|
|
17823
|
+
/**
|
|
17824
|
+
* If provided, only these tools are enabled/available for this step.
|
|
17825
|
+
*/
|
|
17826
|
+
activeTools?: ActiveTools<NoInfer<TOOLS>>;
|
|
17827
|
+
/**
|
|
17828
|
+
* Optionally override the order in which tools are sent to the provider
|
|
17829
|
+
* for this step.
|
|
17830
|
+
*/
|
|
17831
|
+
toolOrder?: ToolOrder<NoInfer<TOOLS>>;
|
|
17832
|
+
/**
|
|
17833
|
+
* Optionally override the instructions sent to the model for this step.
|
|
17834
|
+
* The override carries forward to later steps.
|
|
17835
|
+
*/
|
|
17836
|
+
instructions?: Instructions;
|
|
17837
|
+
/**
|
|
17838
|
+
* Optionally override the instructions sent to the model for this step.
|
|
17839
|
+
*
|
|
17840
|
+
* @deprecated Use `instructions` instead.
|
|
17841
|
+
*/
|
|
17842
|
+
system?: Instructions;
|
|
17843
|
+
/**
|
|
17844
|
+
* Optionally override the full set of messages sent to the model
|
|
17845
|
+
* for this step. The override carries forward to later steps.
|
|
17846
|
+
*/
|
|
17847
|
+
messages?: Array<ModelMessage>;
|
|
17848
|
+
/**
|
|
17849
|
+
* Tool context.
|
|
17850
|
+
*
|
|
17851
|
+
* Changing the toolsContext will affect the toolsContext in this step
|
|
17852
|
+
* and all subsequent steps.
|
|
17853
|
+
*
|
|
17854
|
+
* The toolsContext is passed into tool execution.
|
|
17855
|
+
*/
|
|
17856
|
+
toolsContext?: InferToolSetContext<TOOLS>;
|
|
17857
|
+
/**
|
|
17858
|
+
* Runtime context.
|
|
17859
|
+
*
|
|
17860
|
+
* Changing the runtimeContext will affect the runtimeContext in this step
|
|
17861
|
+
* and all subsequent steps.
|
|
17862
|
+
*/
|
|
17863
|
+
runtimeContext?: RUNTIME_CONTEXT;
|
|
17864
|
+
/**
|
|
17865
|
+
* The sandbox environment that the step is operating in.
|
|
17866
|
+
*
|
|
17867
|
+
* Changing the sandbox will affect tool execution in this step only.
|
|
17868
|
+
*/
|
|
17869
|
+
experimental_sandbox?: SandboxSession;
|
|
17870
|
+
/**
|
|
17871
|
+
* Additional provider-specific options for this step.
|
|
17872
|
+
*
|
|
17873
|
+
* Can be used to pass provider-specific configuration such as
|
|
17874
|
+
* container IDs for Anthropic's code execution.
|
|
17875
|
+
*/
|
|
17876
|
+
providerOptions?: ProviderOptions;
|
|
17877
|
+
} & LanguageModelCallOptions) | undefined;
|
|
17878
|
+
//#endregion
|
|
17879
|
+
//#region src/generate-text/steering.d.ts
|
|
17880
|
+
/**
|
|
17881
|
+
* Why a steering message was not delivered:
|
|
17882
|
+
*
|
|
17883
|
+
* - `finished`: the run ended before the message could be delivered.
|
|
17884
|
+
* - `removed-by-prepare-step`: `prepareStep` returned messages without it.
|
|
17885
|
+
* - `stop-condition`: a stop condition ended the run.
|
|
17886
|
+
* - `waiting-for-tool-results`: the run ended to wait for tool results,
|
|
17887
|
+
* e.g. a tool approval or a tool without an `execute` function.
|
|
17888
|
+
* - `aborted`: the run was aborted.
|
|
17889
|
+
* - `error`: the run failed.
|
|
17890
|
+
*/
|
|
17891
|
+
type SteeringNotDeliveredReason = 'finished' | 'removed-by-prepare-step' | 'stop-condition' | 'waiting-for-tool-results' | 'aborted' | 'error';
|
|
17892
|
+
/**
|
|
17893
|
+
* The outcome of a steering message.
|
|
17894
|
+
*/
|
|
17895
|
+
type SteeringOutcome = {
|
|
17896
|
+
readonly type: 'delivered';
|
|
17897
|
+
/** The id of the steering message. */
|
|
17898
|
+
readonly id: string;
|
|
17899
|
+
/** The user message that was added to the run. */
|
|
17900
|
+
readonly message: UserModelMessage;
|
|
17901
|
+
/** The number of the step whose model call received the message. */
|
|
17902
|
+
readonly stepNumber: number;
|
|
17903
|
+
} | {
|
|
17904
|
+
readonly type: 'not-delivered';
|
|
17905
|
+
/** The id of the steering message. */
|
|
17906
|
+
readonly id: string;
|
|
17907
|
+
/** The user message that was not added to the run. */
|
|
17908
|
+
readonly message: UserModelMessage;
|
|
17909
|
+
/** Why the message was not delivered. */
|
|
17910
|
+
readonly reason: SteeringNotDeliveredReason;
|
|
17911
|
+
};
|
|
17912
|
+
/**
|
|
17913
|
+
* Sends user messages to a running generation. Pass it to `generateText`,
|
|
17914
|
+
* `streamText`, or an agent call with the `experimental_steering` option.
|
|
17915
|
+
*/
|
|
17916
|
+
interface Steering {
|
|
17917
|
+
/**
|
|
17918
|
+
* Adds a user message to the run at the next step boundary, after the
|
|
17919
|
+
* current step and its tool calls are done. If the run would end because the
|
|
17920
|
+
* model finished its answer, it continues for another step unless a stop
|
|
17921
|
+
* condition is met.
|
|
17922
|
+
*
|
|
17923
|
+
* Messages that are sent before the run starts are delivered in the first
|
|
17924
|
+
* step. A steering object can only be used for one generation.
|
|
17925
|
+
*
|
|
17926
|
+
* @param message - The user message, or its text.
|
|
17927
|
+
* @param options.id - The id of the message. Sending a message again with
|
|
17928
|
+
* the same id returns the outcome of the first message.
|
|
17929
|
+
*
|
|
17930
|
+
* @returns The outcome of the message. It never rejects.
|
|
17931
|
+
*/
|
|
17932
|
+
steer(message: string | UserModelMessage, options?: {
|
|
17933
|
+
id?: string;
|
|
17934
|
+
}): Promise<SteeringOutcome>;
|
|
17935
|
+
}
|
|
17936
|
+
/**
|
|
17937
|
+
* The run side of a steering object.
|
|
17938
|
+
*/
|
|
17939
|
+
type SteeringRun = {
|
|
17940
|
+
hasPendingMessages(): boolean;
|
|
17941
|
+
/**
|
|
17942
|
+
* Takes the waiting messages for the next step. They are resolved by
|
|
17943
|
+
* `resolveTakenMessages` once the prompt of the step is known.
|
|
17944
|
+
*/
|
|
17945
|
+
takeMessages(): Array<UserModelMessage>;
|
|
17946
|
+
/**
|
|
17947
|
+
* Resolves the taken messages as delivered when they are part of the
|
|
17948
|
+
* messages that are sent to the model, and returns the delivered messages.
|
|
17949
|
+
*/
|
|
17950
|
+
resolveTakenMessages(options: {
|
|
17951
|
+
stepNumber: number;
|
|
17952
|
+
sentMessages: ReadonlyArray<ModelMessage>;
|
|
17953
|
+
}): Array<UserModelMessage>;
|
|
17954
|
+
end(reason: SteeringNotDeliveredReason): void;
|
|
17955
|
+
};
|
|
17956
|
+
/**
|
|
17957
|
+
* Creates a steering object that sends user messages to a running generation.
|
|
17958
|
+
*
|
|
17959
|
+
* @example
|
|
17960
|
+
* ```ts
|
|
17961
|
+
* const steering = experimental_createSteering();
|
|
17962
|
+
*
|
|
17963
|
+
* const result = streamText({
|
|
17964
|
+
* model,
|
|
17965
|
+
* tools,
|
|
17966
|
+
* stopWhen: isStepCount(20),
|
|
17967
|
+
* experimental_steering: steering,
|
|
17968
|
+
* });
|
|
17969
|
+
*
|
|
17970
|
+
* const outcome = await steering.steer('Use Paris, Texas instead.');
|
|
17971
|
+
* ```
|
|
17972
|
+
*/
|
|
17973
|
+
declare function createSteering(): Steering;
|
|
17974
|
+
//#endregion
|
|
17975
|
+
//#region src/generate-text/stop-condition.d.ts
|
|
17976
|
+
/**
|
|
17977
|
+
* A predicate that decides whether a tool-calling loop should stop after the
|
|
17978
|
+
* current step.
|
|
17979
|
+
*
|
|
17980
|
+
* A tool calling loop continues until one of the following conditions is met:
|
|
17981
|
+
* - The model returns a finish reason other than `tool-calls`
|
|
17982
|
+
* - A tool without an execute function is called
|
|
17983
|
+
* - A tool call needs approval
|
|
17984
|
+
* - One of the provided stop conditions returns `true`
|
|
17985
|
+
*/
|
|
17986
|
+
type StopCondition<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = (options: {
|
|
17987
|
+
steps: Array<StepResult<TOOLS, RUNTIME_CONTEXT>>;
|
|
17988
|
+
}) => PromiseLike<boolean> | boolean;
|
|
17989
|
+
/**
|
|
17990
|
+
* Creates a stop condition that returns `true` when the number of completed
|
|
17991
|
+
* steps equals `stepCount`.
|
|
17992
|
+
*
|
|
17993
|
+
* @param stepCount - The number of steps to allow before stopping.
|
|
17994
|
+
*/
|
|
17995
|
+
declare function isStepCount(stepCount: number): StopCondition<any, any>;
|
|
17996
|
+
/**
|
|
17997
|
+
* Creates a stop condition that never returns `true`.
|
|
17998
|
+
*
|
|
17999
|
+
* This lets the tool-calling loop continue until it reaches one of its
|
|
18000
|
+
* natural termination conditions.
|
|
18001
|
+
*/
|
|
18002
|
+
declare function isLoopFinished(): StopCondition<any, any>;
|
|
18003
|
+
/**
|
|
18004
|
+
* Creates a stop condition that returns `true` when the most recent step
|
|
18005
|
+
* contains a tool call with any of the specified names.
|
|
18006
|
+
*
|
|
18007
|
+
* @param toolName - The names of the tools that should stop the loop.
|
|
18008
|
+
*/
|
|
18009
|
+
declare function hasToolCall<TOOLS extends ToolSet>(...toolName: Array<keyof TOOLS | (string & {})>): StopCondition<TOOLS, any>;
|
|
18010
|
+
//#endregion
|
|
17366
18011
|
//#region src/generate-text/tool-approval-configuration.d.ts
|
|
17367
18012
|
/**
|
|
17368
18013
|
* The approval status of a tool configuration. This can be one of the following:
|
|
@@ -17509,7 +18154,7 @@ type ToolCallRepairFunction<TOOLS extends ToolSet> = (options: {
|
|
|
17509
18154
|
tools: TOOLS;
|
|
17510
18155
|
inputSchema: (options: {
|
|
17511
18156
|
toolName: string;
|
|
17512
|
-
}) => PromiseLike<JSONSchema7$
|
|
18157
|
+
}) => PromiseLike<JSONSchema7$2>;
|
|
17513
18158
|
error: NoSuchToolError | InvalidToolInputError;
|
|
17514
18159
|
abortSignal?: AbortSignal;
|
|
17515
18160
|
}) => Promise<LanguageModelV4ToolCall | null>;
|
|
@@ -17538,7 +18183,7 @@ type BaseToolExecutionStartFields = {
|
|
|
17538
18183
|
* Each union member ties a specific `toolCall.toolName` to that tool's
|
|
17539
18184
|
* validated `toolContext` type.
|
|
17540
18185
|
*/
|
|
17541
|
-
type StaticToolExecutionStartEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
18186
|
+
type StaticToolExecutionStartEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolExecutionStartFields & {
|
|
17542
18187
|
readonly toolCall: Extract<StaticToolCall<TOOLS>, {
|
|
17543
18188
|
toolName: NAME;
|
|
17544
18189
|
}>;
|
|
@@ -17584,7 +18229,7 @@ type BaseToolExecutionEndFields = {
|
|
|
17584
18229
|
* Each union member preserves the link between `toolCall.toolName`, the
|
|
17585
18230
|
* corresponding validated `toolContext`, and the tool execution result.
|
|
17586
18231
|
*/
|
|
17587
|
-
type StaticToolExecutionEndEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]
|
|
18232
|
+
type StaticToolExecutionEndEvent<TOOLS extends ToolSet> = ValueOf<{ [NAME in keyof TOOLS]-?: BaseToolExecutionEndFields & {
|
|
17588
18233
|
readonly toolCall: Extract<StaticToolCall<TOOLS>, {
|
|
17589
18234
|
toolName: NAME;
|
|
17590
18235
|
}>;
|
|
@@ -17678,6 +18323,13 @@ type ToolsContextParameter<TOOLS extends ToolSet> = {
|
|
|
17678
18323
|
} & ToolsContextSettings<TOOLS>;
|
|
17679
18324
|
//#endregion
|
|
17680
18325
|
//#region src/generate-text/stream-text.d.ts
|
|
18326
|
+
/** Internal policy, fixed before the model request starts. */
|
|
18327
|
+
type StreamTextRetention = {
|
|
18328
|
+
/** Keep a replay branch for independently consumed stream projections. */
|
|
18329
|
+
replay: boolean;
|
|
18330
|
+
/** Collect complete content for results, callbacks, or subsequent steps. */
|
|
18331
|
+
collectContent: boolean;
|
|
18332
|
+
};
|
|
17681
18333
|
type StreamTextInclude = {
|
|
17682
18334
|
/**
|
|
17683
18335
|
* Whether to retain the request body in step results.
|
|
@@ -17761,6 +18413,7 @@ type StreamTextOnEndCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT ex
|
|
|
17761
18413
|
* @param event - The event that is passed to the callback.
|
|
17762
18414
|
*/
|
|
17763
18415
|
type StreamTextOnAbortCallback<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1> = Callback<GenerateTextAbortEvent<TOOLS, RUNTIME_CONTEXT>>;
|
|
18416
|
+
type StreamTextOptions<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1, OUTPUT extends Output> = Parameters<typeof streamTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0];
|
|
17764
18417
|
/**
|
|
17765
18418
|
* Generate a text and call tools for a given prompt using a language model.
|
|
17766
18419
|
*
|
|
@@ -17769,6 +18422,7 @@ type StreamTextOnAbortCallback<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Co
|
|
|
17769
18422
|
* @param model - The language model to use.
|
|
17770
18423
|
* @param tools - Tools that are accessible to and can be called by the model. The model needs to support calling tools.
|
|
17771
18424
|
* @param toolOrder - Controls the order in which tools are sent to the provider. Tools not listed are appended alphabetically.
|
|
18425
|
+
* @param toolCallConcurrency - Maximum number of tool calls that may execute concurrently within a step. Set to 1 for sequential execution. Default: unlimited.
|
|
17772
18426
|
*
|
|
17773
18427
|
* @param system - A system message that will be part of the prompt.
|
|
17774
18428
|
* @param prompt - A simple text prompt. You can either use `prompt` or `messages` but not both.
|
|
@@ -17803,6 +18457,7 @@ type StreamTextOnAbortCallback<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Co
|
|
|
17803
18457
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
17804
18458
|
*
|
|
17805
18459
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
18460
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
17806
18461
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
17807
18462
|
* @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.
|
|
17808
18463
|
*
|
|
@@ -17821,6 +18476,7 @@ type StreamTextOnAbortCallback<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Co
|
|
|
17821
18476
|
* @param onToolExecutionEnd - Callback invoked after each tool execution completes.
|
|
17822
18477
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
17823
18478
|
* @param onStepEnd - Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
18479
|
+
* @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`.
|
|
17824
18480
|
* @param onStepFinish - Deprecated alias for `onStepEnd`.
|
|
17825
18481
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
17826
18482
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
@@ -17828,7 +18484,13 @@ type StreamTextOnAbortCallback<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Co
|
|
|
17828
18484
|
* @returns
|
|
17829
18485
|
* A result object for accessing different stream types and additional information.
|
|
17830
18486
|
*/
|
|
17831
|
-
declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output<string, string, never>>(
|
|
18487
|
+
declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
18488
|
+
/**
|
|
18489
|
+
* Stream text with a single consumer, without replay or final-content getters.
|
|
18490
|
+
* Accepts the same options as streamText and uses the same execution engine.
|
|
18491
|
+
*/
|
|
18492
|
+
declare function streamTextLowMemory<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output<string, string, never>>(options: StreamTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): StreamTextSingleConsumerResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
18493
|
+
declare function streamTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, 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> & {
|
|
17832
18494
|
/**
|
|
17833
18495
|
* The language model to use.
|
|
17834
18496
|
*/
|
|
@@ -17864,6 +18526,12 @@ declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Conte
|
|
|
17864
18526
|
* The sandbox environment that is passed through to tool execution.
|
|
17865
18527
|
*/
|
|
17866
18528
|
experimental_sandbox?: SandboxSession;
|
|
18529
|
+
/**
|
|
18530
|
+
* A steering object created with `experimental_createSteering()`.
|
|
18531
|
+
* Messages sent with it are added to the generation at the next step
|
|
18532
|
+
* boundary.
|
|
18533
|
+
*/
|
|
18534
|
+
experimental_steering?: Steering;
|
|
17867
18535
|
/**
|
|
17868
18536
|
* Runtime context. Treat runtime context as immutable.
|
|
17869
18537
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -17882,6 +18550,13 @@ declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Conte
|
|
|
17882
18550
|
* caching by keeping tool definitions in a stable order.
|
|
17883
18551
|
*/
|
|
17884
18552
|
toolOrder?: ToolOrder<NoInfer<TOOLS>>;
|
|
18553
|
+
/**
|
|
18554
|
+
* Maximum number of tool calls that may execute concurrently within a step.
|
|
18555
|
+
*
|
|
18556
|
+
* Set to `1` to execute tool calls sequentially in the order they were
|
|
18557
|
+
* generated. By default, all tool calls execute concurrently.
|
|
18558
|
+
*/
|
|
18559
|
+
toolCallConcurrency?: number;
|
|
17885
18560
|
/**
|
|
17886
18561
|
* Optional specification for parsing structured outputs from the LLM response.
|
|
17887
18562
|
*/
|
|
@@ -18006,6 +18681,11 @@ declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Conte
|
|
|
18006
18681
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
18007
18682
|
*/
|
|
18008
18683
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
18684
|
+
/**
|
|
18685
|
+
* Callback that is called when a step that started fails before it
|
|
18686
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
18687
|
+
*/
|
|
18688
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
18009
18689
|
/**
|
|
18010
18690
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
18011
18691
|
*
|
|
@@ -18099,8 +18779,10 @@ declare function streamText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Conte
|
|
|
18099
18779
|
now?: () => number;
|
|
18100
18780
|
generateId?: IdGenerator;
|
|
18101
18781
|
generateCallId?: IdGenerator;
|
|
18782
|
+
/** Internal policy used by the streaming-only facade. */
|
|
18783
|
+
retention?: StreamTextRetention;
|
|
18102
18784
|
};
|
|
18103
|
-
}): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
18785
|
+
}, steeringRun: SteeringRun | undefined): StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
18104
18786
|
type EnrichedStreamPart<TOOLS extends ToolSet, PARTIAL_OUTPUT> = {
|
|
18105
18787
|
part: TextStreamPart<TOOLS>;
|
|
18106
18788
|
partialOutput: PARTIAL_OUTPUT | undefined;
|
|
@@ -18205,7 +18887,7 @@ declare const array$1: <ELEMENT>({ element: inputElementSchema, minItems, maxIte
|
|
|
18205
18887
|
}) => Output<Array<ELEMENT>, Array<ELEMENT>, ELEMENT>;
|
|
18206
18888
|
/**
|
|
18207
18889
|
* Output specification for choice generation.
|
|
18208
|
-
* When the model generates a text response, it will return
|
|
18890
|
+
* When the model generates a text response, it will return one of the choice options.
|
|
18209
18891
|
*
|
|
18210
18892
|
* @param options - The available choices.
|
|
18211
18893
|
* @param name - Optional name of the output that should be generated. Used by some providers for additional LLM guidance, e.g. via tool or schema name.
|
|
@@ -18483,15 +19165,42 @@ type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CO
|
|
|
18483
19165
|
* Called when a step (LLM call) completes. The event includes all step result
|
|
18484
19166
|
* properties (text, tool calls, usage, etc.) along with additional metadata.
|
|
18485
19167
|
*
|
|
18486
|
-
* @param stepResult - The result of the step.
|
|
19168
|
+
* @param stepResult - The result of the step.
|
|
19169
|
+
*/
|
|
19170
|
+
type GenerateTextOnStepEndCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = Callback<GenerateTextStepEndEvent<TOOLS, RUNTIME_CONTEXT>>;
|
|
19171
|
+
/**
|
|
19172
|
+
* Callback that is set using the `onStepFinish` option.
|
|
19173
|
+
*
|
|
19174
|
+
* @deprecated Use `GenerateTextOnStepEndCallback` instead.
|
|
19175
|
+
*/
|
|
19176
|
+
type GenerateTextOnStepFinishCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1> = GenerateTextOnStepEndCallback<TOOLS, RUNTIME_CONTEXT>;
|
|
19177
|
+
/**
|
|
19178
|
+
* Event passed to the `onStepError` callback.
|
|
19179
|
+
*
|
|
19180
|
+
* Contains the step start event of the step that failed before it produced
|
|
19181
|
+
* a step result, along with the error.
|
|
18487
19182
|
*/
|
|
18488
|
-
type
|
|
19183
|
+
type GenerateTextStepErrorEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output> = GenerateTextStepStartEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT> & {
|
|
19184
|
+
/** The error that ended the step. */
|
|
19185
|
+
readonly error: unknown;
|
|
19186
|
+
};
|
|
18489
19187
|
/**
|
|
18490
|
-
* Callback that is set using the `
|
|
19188
|
+
* Callback that is set using the `onStepError` option.
|
|
18491
19189
|
*
|
|
18492
|
-
*
|
|
19190
|
+
* Called when a step that started fails before it produces a step result:
|
|
19191
|
+
* when the provider call throws or rejects, or when the model stream ends
|
|
19192
|
+
* without output. `onStepEnd` is not called for such a step. A provider
|
|
19193
|
+
* `error` chunk does not fail the step, it still ends with `onStepEnd` and
|
|
19194
|
+
* `finishReason: 'error'`.
|
|
19195
|
+
*
|
|
19196
|
+
* In `generateText`, an abort or timeout also ends the step here. The error
|
|
19197
|
+
* is the abort or timeout error, or a provider error that has it as its
|
|
19198
|
+
* `cause`. In `streamText`, an abort or timeout ends the step
|
|
19199
|
+
* with `onAbort` instead.
|
|
19200
|
+
*
|
|
19201
|
+
* @param event - The step that failed and the error.
|
|
18493
19202
|
*/
|
|
18494
|
-
type
|
|
19203
|
+
type GenerateTextOnStepErrorCallback<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output> = Callback<GenerateTextStepErrorEvent<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
18495
19204
|
/**
|
|
18496
19205
|
* Callback that is set using the `onEnd` option.
|
|
18497
19206
|
*
|
|
@@ -18782,7 +19491,13 @@ type TelemetryTracingChannelMessage<EVENT = unknown> = {
|
|
|
18782
19491
|
};
|
|
18783
19492
|
//#endregion
|
|
18784
19493
|
//#region src/telemetry/telemetry.d.ts
|
|
18785
|
-
type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'
|
|
19494
|
+
type InferTelemetryEvent<EVENT> = EVENT & Omit<TelemetryOptions, 'integrations' | 'isEnabled' | 'includeRuntimeContext'> & {
|
|
19495
|
+
/**
|
|
19496
|
+
* The version of the `ai` package that emitted this event.
|
|
19497
|
+
* Absent in older releases.
|
|
19498
|
+
*/
|
|
19499
|
+
readonly aiVersion?: string;
|
|
19500
|
+
};
|
|
18786
19501
|
type BivariantCallback<EVENT> = {
|
|
18787
19502
|
bivarianceHack(event: EVENT): PromiseLike<void> | void;
|
|
18788
19503
|
}['bivarianceHack'];
|
|
@@ -18849,6 +19564,11 @@ interface Telemetry {
|
|
|
18849
19564
|
* @deprecated Use `onStepEnd` instead.
|
|
18850
19565
|
*/
|
|
18851
19566
|
onStepFinish?: Callback<InferTelemetryEvent<GenerateTextStepEndEvent>>;
|
|
19567
|
+
/**
|
|
19568
|
+
* Called when a step that started fails before it produces a step result.
|
|
19569
|
+
* Use it to close step-level spans. The call then ends with `onError`.
|
|
19570
|
+
*/
|
|
19571
|
+
onStepError?: Callback<InferTelemetryEvent<GenerateTextStepErrorEvent>>;
|
|
18852
19572
|
/**
|
|
18853
19573
|
* Called when an object generation step (single LLM invocation) begins.
|
|
18854
19574
|
* For generateObject/streamObject there is always exactly one step.
|
|
@@ -18962,7 +19682,15 @@ interface Telemetry {
|
|
|
18962
19682
|
}
|
|
18963
19683
|
//#endregion
|
|
18964
19684
|
//#region src/global.d.ts
|
|
19685
|
+
declare const aiSdkGlobalsKey: unique symbol;
|
|
18965
19686
|
declare global {
|
|
19687
|
+
interface AISDKGlobalTypes {
|
|
19688
|
+
[aiSdkGlobalsKey]: {
|
|
19689
|
+
provider: ProviderV4 | ProviderV3 | ProviderV2;
|
|
19690
|
+
logWarnings: LogWarningsFunction;
|
|
19691
|
+
telemetry: Telemetry;
|
|
19692
|
+
};
|
|
19693
|
+
}
|
|
18966
19694
|
/**
|
|
18967
19695
|
* The default provider to use for the AI SDK.
|
|
18968
19696
|
* String model ids are resolved to the default provider and model id.
|
|
@@ -18972,7 +19700,7 @@ declare global {
|
|
|
18972
19700
|
*
|
|
18973
19701
|
* @see https://ai-sdk.dev/docs/ai-sdk-core/provider-management#global-provider-configuration
|
|
18974
19702
|
*/
|
|
18975
|
-
var AI_SDK_DEFAULT_PROVIDER:
|
|
19703
|
+
var AI_SDK_DEFAULT_PROVIDER: AISDKGlobalTypes[keyof AISDKGlobalTypes]['provider'] | undefined;
|
|
18976
19704
|
/**
|
|
18977
19705
|
* The warning logger to use for the AI SDK.
|
|
18978
19706
|
*
|
|
@@ -18981,7 +19709,7 @@ declare global {
|
|
|
18981
19709
|
*
|
|
18982
19710
|
* If set to false, no warnings are logged.
|
|
18983
19711
|
*/
|
|
18984
|
-
var AI_SDK_LOG_WARNINGS:
|
|
19712
|
+
var AI_SDK_LOG_WARNINGS: AISDKGlobalTypes[keyof AISDKGlobalTypes]['logWarnings'] | undefined | false;
|
|
18985
19713
|
/**
|
|
18986
19714
|
* Globally registered telemetry integrations for the AI SDK.
|
|
18987
19715
|
*
|
|
@@ -18991,7 +19719,7 @@ declare global {
|
|
|
18991
19719
|
* Prefer using `registerTelemetry()` from `'ai'` instead of
|
|
18992
19720
|
* assigning this directly.
|
|
18993
19721
|
*/
|
|
18994
|
-
var AI_SDK_TELEMETRY_INTEGRATIONS:
|
|
19722
|
+
var AI_SDK_TELEMETRY_INTEGRATIONS: Array<AISDKGlobalTypes[keyof AISDKGlobalTypes]['telemetry']> | undefined;
|
|
18995
19723
|
}
|
|
18996
19724
|
//#endregion
|
|
18997
19725
|
//#region src/generate-text/generate-text-result.d.ts
|
|
@@ -19310,6 +20038,7 @@ type GenerateTextInclude = {
|
|
|
19310
20038
|
* @param tools - Tools that are accessible to and can be called by the model. The model needs to support calling tools.
|
|
19311
20039
|
* @param toolChoice - The tool choice strategy. Default: 'auto'.
|
|
19312
20040
|
* @param toolOrder - Controls the order in which tools are sent to the provider. Tools not listed are appended alphabetically.
|
|
20041
|
+
* @param toolCallConcurrency - Maximum number of tool calls that may execute concurrently within a step. Set to 1 for sequential execution. Default: unlimited.
|
|
19313
20042
|
*
|
|
19314
20043
|
* @param system - A system message that will be part of the prompt.
|
|
19315
20044
|
* @param prompt - A simple text prompt. You can either use `prompt` or `messages` but not both.
|
|
@@ -19343,6 +20072,7 @@ type GenerateTextInclude = {
|
|
|
19343
20072
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
19344
20073
|
*
|
|
19345
20074
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution.
|
|
20075
|
+
* @param experimental_steering - A steering object that adds user messages to the generation at the next step boundary.
|
|
19346
20076
|
* @param runtimeContext - User-defined runtime context that flows through the entire generation lifecycle.
|
|
19347
20077
|
* @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.
|
|
19348
20078
|
* @param onStart - Callback invoked when generation begins, before any LLM calls.
|
|
@@ -19361,13 +20091,16 @@ type GenerateTextInclude = {
|
|
|
19361
20091
|
* Uses a discriminated union: check `success` to determine if `output` or `error` is present.
|
|
19362
20092
|
* @param experimental_onToolCallFinish - Deprecated alias for `onToolExecutionEnd`.
|
|
19363
20093
|
* @param onStepFinish - Callback that is called when each step (LLM call) is finished, including intermediate steps.
|
|
20094
|
+
* @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.
|
|
19364
20095
|
* @param onEnd - Callback that is called when all steps are finished and the response is complete.
|
|
19365
20096
|
* @param onFinish - Deprecated alias for `onEnd`.
|
|
19366
20097
|
*
|
|
19367
20098
|
* @returns
|
|
19368
20099
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
19369
20100
|
*/
|
|
19370
|
-
declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output<string, string>>(
|
|
20101
|
+
declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = Output<string, string>>(options: GenerateTextOptions<TOOLS, RUNTIME_CONTEXT, OUTPUT>): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
20102
|
+
type GenerateTextOptions<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1, OUTPUT extends Output> = Parameters<typeof generateTextInternal<TOOLS, RUNTIME_CONTEXT, OUTPUT>>[0];
|
|
20103
|
+
declare function generateTextInternal<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1 = Context$1, 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> & {
|
|
19371
20104
|
/**
|
|
19372
20105
|
* The language model to use.
|
|
19373
20106
|
*/
|
|
@@ -19403,6 +20136,12 @@ declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Con
|
|
|
19403
20136
|
* The sandbox environment that is passed through to tool execution.
|
|
19404
20137
|
*/
|
|
19405
20138
|
experimental_sandbox?: SandboxSession;
|
|
20139
|
+
/**
|
|
20140
|
+
* A steering object created with `experimental_createSteering()`.
|
|
20141
|
+
* Messages sent with it are added to the generation at the next step
|
|
20142
|
+
* boundary.
|
|
20143
|
+
*/
|
|
20144
|
+
experimental_steering?: Steering;
|
|
19406
20145
|
/**
|
|
19407
20146
|
* Runtime context. Treat runtime context as immutable.
|
|
19408
20147
|
* If you need to mutate runtime context, update it in `prepareStep`.
|
|
@@ -19421,6 +20160,13 @@ declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Con
|
|
|
19421
20160
|
* caching by keeping tool definitions in a stable order.
|
|
19422
20161
|
*/
|
|
19423
20162
|
toolOrder?: ToolOrder<NoInfer<TOOLS>>;
|
|
20163
|
+
/**
|
|
20164
|
+
* Maximum number of tool calls that may execute concurrently within a step.
|
|
20165
|
+
*
|
|
20166
|
+
* Set to `1` to execute tool calls sequentially in the order they were
|
|
20167
|
+
* generated. By default, all tool calls execute concurrently.
|
|
20168
|
+
*/
|
|
20169
|
+
toolCallConcurrency?: number;
|
|
19424
20170
|
/**
|
|
19425
20171
|
* Optional specification for parsing structured outputs from the LLM response.
|
|
19426
20172
|
*/
|
|
@@ -19538,6 +20284,11 @@ declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Con
|
|
|
19538
20284
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
19539
20285
|
*/
|
|
19540
20286
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
20287
|
+
/**
|
|
20288
|
+
* Callback that is called when a step that started fails before it
|
|
20289
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
20290
|
+
*/
|
|
20291
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
19541
20292
|
/**
|
|
19542
20293
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
19543
20294
|
*
|
|
@@ -19577,7 +20328,7 @@ declare function generateText<TOOLS extends ToolSet, RUNTIME_CONTEXT extends Con
|
|
|
19577
20328
|
generateCallId?: IdGenerator;
|
|
19578
20329
|
now?: () => number;
|
|
19579
20330
|
};
|
|
19580
|
-
}): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
20331
|
+
}, steeringRun: SteeringRun | undefined): Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>;
|
|
19581
20332
|
//#endregion
|
|
19582
20333
|
//#region src/agent/tool-loop-agent-settings.d.ts
|
|
19583
20334
|
/**
|
|
@@ -19641,6 +20392,13 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUN
|
|
|
19641
20392
|
* caching by keeping tool definitions in a stable order.
|
|
19642
20393
|
*/
|
|
19643
20394
|
toolOrder?: ToolOrder<NoInfer<TOOLS>>;
|
|
20395
|
+
/**
|
|
20396
|
+
* Maximum number of tool calls that may execute concurrently within a step.
|
|
20397
|
+
*
|
|
20398
|
+
* Set to `1` to execute tool calls sequentially in the order they were
|
|
20399
|
+
* generated. By default, all tool calls execute concurrently.
|
|
20400
|
+
*/
|
|
20401
|
+
toolCallConcurrency?: number;
|
|
19644
20402
|
/**
|
|
19645
20403
|
* Optional specification for generating structured outputs.
|
|
19646
20404
|
*/
|
|
@@ -19728,6 +20486,27 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUN
|
|
|
19728
20486
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
19729
20487
|
*/
|
|
19730
20488
|
onStepEnd?: GenerateTextOnStepEndCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
20489
|
+
/**
|
|
20490
|
+
* Callback that is called when a step that started fails before it
|
|
20491
|
+
* produces a step result. `onStepEnd` is not called for such a step.
|
|
20492
|
+
*
|
|
20493
|
+
* Unlike `onStepStart` and `onStepEnd`, it can only be set here and not
|
|
20494
|
+
* per call, because the per-call callbacks are shared with other `Agent`
|
|
20495
|
+
* implementations that do not report step errors.
|
|
20496
|
+
*/
|
|
20497
|
+
onStepError?: GenerateTextOnStepErrorCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>, NoInfer<OUTPUT>>;
|
|
20498
|
+
/**
|
|
20499
|
+
* Callback that is called when an error occurs. For `stream()` it receives
|
|
20500
|
+
* the errors of the stream, for `generate()` it receives the error before
|
|
20501
|
+
* it is thrown. Aborts and timeouts are not reported.
|
|
20502
|
+
*/
|
|
20503
|
+
onError?: StreamTextOnErrorCallback;
|
|
20504
|
+
/**
|
|
20505
|
+
* Callback that is called when `stream()` is aborted or times out.
|
|
20506
|
+
* `generate()` does not call it: an aborted or timed out `generate()` call
|
|
20507
|
+
* rejects, and its step ends with `onStepError`.
|
|
20508
|
+
*/
|
|
20509
|
+
onAbort?: StreamTextOnAbortCallback<NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>;
|
|
19731
20510
|
/**
|
|
19732
20511
|
* Callback that is called when each step (LLM call) ends, including intermediate steps.
|
|
19733
20512
|
*
|
|
@@ -19791,14 +20570,24 @@ type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUN
|
|
|
19791
20570
|
* }),
|
|
19792
20571
|
* ```
|
|
19793
20572
|
*/
|
|
19794
|
-
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>, 'abortSignal' | 'timeout' | 'onStart' | 'experimental_onStart' | 'onStepStart' | 'experimental_onStepStart' | 'onToolExecutionStart' | 'onToolExecutionEnd' | 'onStepEnd' | 'onStepFinish' | 'onEnd' | 'onFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, NoInfer<OUTPUT>>, 'model' | 'tools' | 'toolChoice' | 'maxRetries' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'reasoning' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'telemetry' | 'experimental_telemetry' | 'activeTools' | 'toolOrder' | 'toolApproval' | 'experimental_toolCallers' | 'experimental_toolApprovalSecret' | 'prepareStep' | 'repairToolCall' | 'experimental_repairToolCall' | 'providerOptions' | 'experimental_download' | 'experimental_refineToolInput' | 'include' | 'runtimeContext' | '_internal'> & {
|
|
20573
|
+
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>, NoInfer<RUNTIME_CONTEXT>>, 'abortSignal' | 'timeout' | 'onStart' | 'experimental_onStart' | 'onStepStart' | 'experimental_onStepStart' | 'onToolExecutionStart' | 'onToolExecutionEnd' | 'onStepEnd' | 'onStepFinish' | 'onEnd' | 'onFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, NoInfer<OUTPUT>>, 'model' | 'tools' | 'toolChoice' | 'maxRetries' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'reasoning' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'telemetry' | 'experimental_telemetry' | 'activeTools' | 'toolOrder' | 'toolCallConcurrency' | 'toolApproval' | 'experimental_toolCallers' | 'experimental_toolApprovalSecret' | 'prepareStep' | 'repairToolCall' | 'experimental_repairToolCall' | 'providerOptions' | 'experimental_download' | 'experimental_refineToolInput' | 'include' | 'runtimeContext' | '_internal'> & {
|
|
19795
20574
|
toolsContext: InferToolSetContext<TOOLS>;
|
|
19796
|
-
}) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, NoInfer<OUTPUT>>, 'model' | 'tools' | 'toolChoice' | 'maxRetries' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'reasoning' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'telemetry' | 'experimental_telemetry' | 'activeTools' | 'toolOrder' | 'toolApproval' | 'experimental_toolCallers' | 'experimental_toolApprovalSecret' | 'prepareStep' | 'repairToolCall' | 'experimental_repairToolCall' | 'providerOptions' | 'experimental_download' | 'experimental_refineToolInput' | 'include' | 'runtimeContext' | '_internal'> & Omit<Prompt, 'system'> & {
|
|
20575
|
+
}) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, NoInfer<OUTPUT>>, 'model' | 'tools' | 'toolChoice' | 'maxRetries' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'reasoning' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'telemetry' | 'experimental_telemetry' | 'activeTools' | 'toolOrder' | 'toolCallConcurrency' | 'toolApproval' | 'experimental_toolCallers' | 'experimental_toolApprovalSecret' | 'prepareStep' | 'repairToolCall' | 'experimental_repairToolCall' | 'providerOptions' | 'experimental_download' | 'experimental_refineToolInput' | 'include' | 'runtimeContext' | '_internal'> & Omit<Prompt, 'system'> & {
|
|
19797
20576
|
toolsContext: InferToolSetContext<TOOLS>;
|
|
19798
20577
|
}>;
|
|
19799
20578
|
};
|
|
19800
20579
|
//#endregion
|
|
19801
20580
|
//#region src/agent/tool-loop-agent.d.ts
|
|
20581
|
+
/**
|
|
20582
|
+
* Call parameters that only `ToolLoopAgent` supports.
|
|
20583
|
+
*/
|
|
20584
|
+
interface ToolLoopAgentCallExtensions {
|
|
20585
|
+
/**
|
|
20586
|
+
* A steering object created with `experimental_createSteering()`.
|
|
20587
|
+
* Messages sent with it are added to the run at the next step boundary.
|
|
20588
|
+
*/
|
|
20589
|
+
experimental_steering?: Steering;
|
|
20590
|
+
}
|
|
19802
20591
|
/**
|
|
19803
20592
|
* A tool loop agent is an agent that runs tools in a loop. In each step,
|
|
19804
20593
|
* it calls the LLM, and if there are tool calls, it executes the tools
|
|
@@ -19832,11 +20621,11 @@ declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RU
|
|
|
19832
20621
|
/**
|
|
19833
20622
|
* Generates an output from the agent (non-streaming).
|
|
19834
20623
|
*/
|
|
19835
|
-
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>>;
|
|
20624
|
+
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>>;
|
|
19836
20625
|
/**
|
|
19837
20626
|
* Streams an output from the agent (streaming).
|
|
19838
20627
|
*/
|
|
19839
|
-
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>>;
|
|
20628
|
+
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>>;
|
|
19840
20629
|
}
|
|
19841
20630
|
//#endregion
|
|
19842
20631
|
//#region src/agent/infer-agent-tools.d.ts
|
|
@@ -19869,77 +20658,6 @@ declare function convertToModelMessages<UI_MESSAGE extends UIMessage>(messages:
|
|
|
19869
20658
|
convertDataPart?: (part: DataUIPart<InferUIMessageData<UI_MESSAGE>>) => TextPart | FilePart | undefined;
|
|
19870
20659
|
}): Promise<ModelMessage[]>;
|
|
19871
20660
|
//#endregion
|
|
19872
|
-
//#region src/agent/create-agent-ui-stream-response.d.ts
|
|
19873
|
-
/**
|
|
19874
|
-
* Runs the agent and returns a response object with a UI message stream.
|
|
19875
|
-
*
|
|
19876
|
-
* @param agent - The agent to run.
|
|
19877
|
-
* @param uiMessages - The input UI messages.
|
|
19878
|
-
* @param convertDataPart - Optional function to convert custom data parts to text or file model message parts.
|
|
19879
|
-
* @param abortSignal - Abort signal. Optional.
|
|
19880
|
-
* @param timeout - Timeout in milliseconds. Optional.
|
|
19881
|
-
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
19882
|
-
* @param options - The options for the agent. Optional.
|
|
19883
|
-
* @param experimental_transform - Stream transformations. Optional.
|
|
19884
|
-
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
19885
|
-
* @param onStepFinish - Deprecated alias for `onStepEnd`. Optional.
|
|
19886
|
-
* @param headers - Additional headers for the response. Optional.
|
|
19887
|
-
* @param status - The status code for the response. Optional.
|
|
19888
|
-
* @param statusText - The status text for the response. Optional.
|
|
19889
|
-
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
19890
|
-
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
19891
|
-
*
|
|
19892
|
-
* @returns The response object.
|
|
19893
|
-
*/
|
|
19894
|
-
declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = never, MESSAGE_METADATA = unknown, UI_MESSAGE extends UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>> = UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>>>({ headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
19895
|
-
agent: Agent$1<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
19896
|
-
uiMessages: unknown[];
|
|
19897
|
-
/**
|
|
19898
|
-
* Converts custom UI data parts to text or file model message parts.
|
|
19899
|
-
* Data parts are ignored when omitted or when the callback returns undefined.
|
|
19900
|
-
*/
|
|
19901
|
-
convertDataPart?: NonNullable<Parameters<typeof convertToModelMessages<UI_MESSAGE>>[1]>['convertDataPart'];
|
|
19902
|
-
abortSignal?: AbortSignal;
|
|
19903
|
-
timeout?: TimeoutConfiguration<TOOLS>;
|
|
19904
|
-
experimental_sandbox?: SandboxSession;
|
|
19905
|
-
options?: CALL_OPTIONS;
|
|
19906
|
-
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
19907
|
-
onStepEnd?: GenerateTextOnStepEndCallback<TOOLS>;
|
|
19908
|
-
/** @deprecated Use `onStepEnd` instead. */
|
|
19909
|
-
onStepFinish?: GenerateTextOnStepFinishCallback<TOOLS>;
|
|
19910
|
-
} & UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Promise<Response>;
|
|
19911
|
-
//#endregion
|
|
19912
|
-
//#region src/ui-message-stream/ui-message-stream-on-step-end-callback.d.ts
|
|
19913
|
-
/**
|
|
19914
|
-
* Callback that is called when a step ends during streaming.
|
|
19915
|
-
* This is useful for persisting intermediate UI messages during multi-step agent runs.
|
|
19916
|
-
*/
|
|
19917
|
-
type UIMessageStreamOnStepEndCallback<UI_MESSAGE extends UIMessage> = (event: {
|
|
19918
|
-
/**
|
|
19919
|
-
* The updated list of UI messages at the end of this step.
|
|
19920
|
-
*/
|
|
19921
|
-
messages: UI_MESSAGE[];
|
|
19922
|
-
/**
|
|
19923
|
-
* Indicates whether the response message is a continuation of the last original message,
|
|
19924
|
-
* or if a new message was created.
|
|
19925
|
-
*/
|
|
19926
|
-
isContinuation: boolean;
|
|
19927
|
-
/**
|
|
19928
|
-
* The message that was sent to the client as a response
|
|
19929
|
-
* (including the original message if it was extended).
|
|
19930
|
-
*/
|
|
19931
|
-
responseMessage: UI_MESSAGE;
|
|
19932
|
-
}) => PromiseLike<void> | void;
|
|
19933
|
-
//#endregion
|
|
19934
|
-
//#region src/ui-message-stream/ui-message-stream-on-step-finish-callback.d.ts
|
|
19935
|
-
/**
|
|
19936
|
-
* Callback that is called when a step finishes during streaming.
|
|
19937
|
-
* This is useful for persisting intermediate UI messages during multi-step agent runs.
|
|
19938
|
-
*
|
|
19939
|
-
* @deprecated Use `UIMessageStreamOnStepEndCallback` instead.
|
|
19940
|
-
*/
|
|
19941
|
-
type UIMessageStreamOnStepFinishCallback<UI_MESSAGE extends UIMessage> = UIMessageStreamOnStepEndCallback<UI_MESSAGE>;
|
|
19942
|
-
//#endregion
|
|
19943
20661
|
//#region src/ui/call-completion-api.d.ts
|
|
19944
20662
|
declare const getOriginalFetch: () => typeof fetch;
|
|
19945
20663
|
declare function callCompletionApi({ api, prompt, credentials, headers, body, streamProtocol, setCompletion, setLoading, setError, setAbortController, getAbortController, onFinish, onError, fetch }: {
|
|
@@ -19971,6 +20689,20 @@ declare function callCompletionApi({ api, prompt, credentials, headers, body, st
|
|
|
19971
20689
|
* @template UI_MESSAGE - The UI message type extending UIMessage
|
|
19972
20690
|
*/
|
|
19973
20691
|
interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
20692
|
+
/**
|
|
20693
|
+
* Whether reconnecting returns the complete response from its beginning.
|
|
20694
|
+
* Complete replays must reset the streaming message state before processing
|
|
20695
|
+
* the first start chunk.
|
|
20696
|
+
*/
|
|
20697
|
+
readonly resumeStreamIsReplay?: boolean;
|
|
20698
|
+
/**
|
|
20699
|
+
* Releases persistent resources owned by the transport.
|
|
20700
|
+
*
|
|
20701
|
+
* The caller that creates a transport owns its lifecycle and should call
|
|
20702
|
+
* this method when no consumers remain. `AbstractChat.dispose()` calls it
|
|
20703
|
+
* for directly managed chat instances.
|
|
20704
|
+
*/
|
|
20705
|
+
close?: () => void;
|
|
19974
20706
|
/**
|
|
19975
20707
|
* Sends messages to the chat API endpoint and returns a streaming response.
|
|
19976
20708
|
*
|
|
@@ -20137,7 +20869,7 @@ type ChatOnFinishCallback<UI_MESSAGE extends UIMessage> = (options: {
|
|
|
20137
20869
|
interface ChatInit<UI_MESSAGE extends UIMessage> {
|
|
20138
20870
|
/**
|
|
20139
20871
|
* A unique identifier for the chat. If not provided, a random one will be
|
|
20140
|
-
* generated.
|
|
20872
|
+
* generated when first accessed.
|
|
20141
20873
|
*/
|
|
20142
20874
|
id?: string;
|
|
20143
20875
|
messageMetadataSchema?: FlexibleSchema<UI_MESSAGE['metadata']>;
|
|
@@ -20180,7 +20912,8 @@ interface ChatInit<UI_MESSAGE extends UIMessage> {
|
|
|
20180
20912
|
}) => boolean | PromiseLike<boolean>;
|
|
20181
20913
|
}
|
|
20182
20914
|
declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
20183
|
-
|
|
20915
|
+
private _id;
|
|
20916
|
+
get id(): string;
|
|
20184
20917
|
readonly generateId: IdGenerator;
|
|
20185
20918
|
protected state: ChatState<UI_MESSAGE>;
|
|
20186
20919
|
private messageMetadataSchema;
|
|
@@ -20193,10 +20926,13 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
20193
20926
|
private sendAutomaticallyWhen?;
|
|
20194
20927
|
private pendingMessagePreparations;
|
|
20195
20928
|
private pendingApprovalMessageId;
|
|
20929
|
+
private interruptedMessageIds;
|
|
20196
20930
|
private activeResponse;
|
|
20197
20931
|
private activeResumeRequest;
|
|
20198
20932
|
private resumableStreamState;
|
|
20199
20933
|
private jobExecutor;
|
|
20934
|
+
private activeStopCount;
|
|
20935
|
+
private stopGeneration;
|
|
20200
20936
|
constructor({ generateId, id, transport, messageMetadataSchema, dataPartSchemas, state, onError, onToolCall, onFinish, onData, sendAutomaticallyWhen }: Omit<ChatInit<UI_MESSAGE>, 'messages'> & {
|
|
20201
20937
|
state: ChatState<UI_MESSAGE>;
|
|
20202
20938
|
});
|
|
@@ -20259,12 +20995,19 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
20259
20995
|
/** @deprecated Use addToolOutput */
|
|
20260
20996
|
addToolResult: ChatAddToolOutputFunction<UI_MESSAGE>;
|
|
20261
20997
|
/**
|
|
20262
|
-
* Abort the current request
|
|
20998
|
+
* Abort the current request, keep the generated tokens if any, and wait for
|
|
20999
|
+
* the request pipeline to finish.
|
|
20263
21000
|
*/
|
|
20264
21001
|
stop: () => Promise<void>;
|
|
21002
|
+
/**
|
|
21003
|
+
* Stops active work and releases resources owned by the chat transport.
|
|
21004
|
+
*/
|
|
21005
|
+
dispose: () => Promise<void>;
|
|
20265
21006
|
private shouldSendAutomatically;
|
|
21007
|
+
private runAutomaticRequest;
|
|
20266
21008
|
private makeRequestForToolApproval;
|
|
20267
21009
|
private makeRequest;
|
|
21010
|
+
private makeRequestImpl;
|
|
20268
21011
|
}
|
|
20269
21012
|
//#endregion
|
|
20270
21013
|
//#region src/ui/convert-file-list-to-file-ui-parts.d.ts
|
|
@@ -20377,83 +21120,273 @@ declare abstract class HttpChatTransport<UI_MESSAGE extends UIMessage> implement
|
|
|
20377
21120
|
//#endregion
|
|
20378
21121
|
//#region src/ui/default-chat-transport.d.ts
|
|
20379
21122
|
declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
|
|
20380
|
-
|
|
21123
|
+
readonly resumeStreamIsReplay: boolean;
|
|
21124
|
+
constructor({ resumeStreamIsReplay, ...options }?: HttpChatTransportInitOptions<UI_MESSAGE> & {
|
|
21125
|
+
/**
|
|
21126
|
+
* Whether resumed streams replay the response from the beginning.
|
|
21127
|
+
* Defaults to true. Set to false for endpoints that only continue the
|
|
21128
|
+
* interrupted response, even when they emit a start chunk.
|
|
21129
|
+
*/
|
|
21130
|
+
resumeStreamIsReplay?: boolean;
|
|
21131
|
+
});
|
|
20381
21132
|
protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageChunk>;
|
|
20382
21133
|
}
|
|
20383
21134
|
//#endregion
|
|
20384
21135
|
//#region src/ui/direct-chat-transport.d.ts
|
|
20385
21136
|
/**
|
|
20386
|
-
* Options for the `DirectChatTransport` class.
|
|
21137
|
+
* Options for the `DirectChatTransport` class.
|
|
21138
|
+
*/
|
|
21139
|
+
type DirectChatTransportOptions<CALL_OPTIONS, TOOLS extends ToolSet, RUNTIME_CONTEXT extends Context$1, OUTPUT extends Output, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>>> = {
|
|
21140
|
+
/**
|
|
21141
|
+
* The agent to use for generating responses.
|
|
21142
|
+
*/
|
|
21143
|
+
agent: Agent$1<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
21144
|
+
/**
|
|
21145
|
+
* Options to pass to the agent when calling it.
|
|
21146
|
+
*/
|
|
21147
|
+
options?: CALL_OPTIONS;
|
|
21148
|
+
} & Omit<UIMessageStreamOptions<UI_MESSAGE>, 'onFinish'>;
|
|
21149
|
+
/**
|
|
21150
|
+
* A transport that directly communicates with an Agent in-process,
|
|
21151
|
+
* without going through HTTP. This is useful for:
|
|
21152
|
+
* - Server-side rendering scenarios
|
|
21153
|
+
* - Testing without network
|
|
21154
|
+
* - Single-process applications
|
|
21155
|
+
*
|
|
21156
|
+
* @example
|
|
21157
|
+
* ```tsx
|
|
21158
|
+
* import { useChat } from '@ai-sdk/react';
|
|
21159
|
+
* import { DirectChatTransport } from 'ai';
|
|
21160
|
+
* import { myAgent } from './my-agent';
|
|
21161
|
+
*
|
|
21162
|
+
* const { messages, sendMessage } = useChat({
|
|
21163
|
+
* transport: new DirectChatTransport({ agent: myAgent }),
|
|
21164
|
+
* });
|
|
21165
|
+
* ```
|
|
21166
|
+
*/
|
|
21167
|
+
declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = never, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>> = UIMessage<unknown, never, InferUITools<TOOLS>>> implements ChatTransport<UI_MESSAGE> {
|
|
21168
|
+
private readonly agent;
|
|
21169
|
+
private readonly agentOptions;
|
|
21170
|
+
private readonly uiMessageStreamOptions;
|
|
21171
|
+
constructor({ agent, options, ...uiMessageStreamOptions }: DirectChatTransportOptions<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT, UI_MESSAGE>);
|
|
21172
|
+
sendMessages({ messages, abortSignal }: Parameters<ChatTransport<UI_MESSAGE>['sendMessages']>[0]): Promise<ReadableStream<UIMessageChunk>>;
|
|
21173
|
+
/**
|
|
21174
|
+
* Direct transport does not support reconnection since there is no
|
|
21175
|
+
* persistent server-side stream to reconnect to.
|
|
21176
|
+
*
|
|
21177
|
+
* @returns Always returns `null`
|
|
21178
|
+
*/
|
|
21179
|
+
reconnectToStream(_options: Parameters<ChatTransport<UI_MESSAGE>['reconnectToStream']>[0]): Promise<ReadableStream<UIMessageChunk> | null>;
|
|
21180
|
+
}
|
|
21181
|
+
//#endregion
|
|
21182
|
+
//#region src/ui/last-assistant-message-is-complete-with-approval-responses.d.ts
|
|
21183
|
+
/**
|
|
21184
|
+
* Check if the last message is an assistant message with completed tool call approvals.
|
|
21185
|
+
* The last step of the message must have at least one tool approval response and
|
|
21186
|
+
* all tool approvals must have a response.
|
|
21187
|
+
*/
|
|
21188
|
+
declare function lastAssistantMessageIsCompleteWithApprovalResponses({ messages }: {
|
|
21189
|
+
messages: UIMessage[];
|
|
21190
|
+
}): boolean;
|
|
21191
|
+
//#endregion
|
|
21192
|
+
//#region src/ui/last-assistant-message-is-complete-with-tool-calls.d.ts
|
|
21193
|
+
/**
|
|
21194
|
+
* Check if the last message is an assistant message with completed tool calls.
|
|
21195
|
+
* The last step of the message must have at least one tool invocation and
|
|
21196
|
+
* all tool invocations must have a result. Completed model text may follow
|
|
21197
|
+
* the tool invocation because client-side tool results update parts in place,
|
|
21198
|
+
* but trailing text without a completed stream state prevents resubmission.
|
|
21199
|
+
*/
|
|
21200
|
+
declare function lastAssistantMessageIsCompleteWithToolCalls({ messages }: {
|
|
21201
|
+
messages: UIMessage[];
|
|
21202
|
+
}): boolean;
|
|
21203
|
+
//#endregion
|
|
21204
|
+
//#region src/ui/text-stream-chat-transport.d.ts
|
|
21205
|
+
declare class TextStreamChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
|
|
21206
|
+
constructor(options?: HttpChatTransportInitOptions<UI_MESSAGE>);
|
|
21207
|
+
protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageChunk>;
|
|
21208
|
+
}
|
|
21209
|
+
//#endregion
|
|
21210
|
+
//#region src/ui/websocket-chat-transport.d.ts
|
|
21211
|
+
type WebSocketChatTransportSendRequest<UI_MESSAGE extends UIMessage = UIMessage> = {
|
|
21212
|
+
type: 'send';
|
|
21213
|
+
requestId: string;
|
|
21214
|
+
id: string;
|
|
21215
|
+
trigger: 'submit-message' | 'regenerate-message';
|
|
21216
|
+
messageId: string | undefined;
|
|
21217
|
+
messages: UI_MESSAGE[];
|
|
21218
|
+
headers: Record<string, string>;
|
|
21219
|
+
body: object;
|
|
21220
|
+
metadata: unknown;
|
|
21221
|
+
};
|
|
21222
|
+
type WebSocketChatTransportResumeRequest = {
|
|
21223
|
+
type: 'resume';
|
|
21224
|
+
requestId: string;
|
|
21225
|
+
id: string;
|
|
21226
|
+
/** Omitted by this transport to request a complete UI message replay. */
|
|
21227
|
+
lastSequence: number | undefined;
|
|
21228
|
+
headers: Record<string, string>;
|
|
21229
|
+
body: object;
|
|
21230
|
+
metadata: unknown;
|
|
21231
|
+
};
|
|
21232
|
+
type WebSocketChatTransportAbortRequest = {
|
|
21233
|
+
type: 'abort';
|
|
21234
|
+
requestId: string;
|
|
21235
|
+
};
|
|
21236
|
+
/**
|
|
21237
|
+
* A client-to-server frame used by `WebSocketChatTransport`.
|
|
21238
|
+
*/
|
|
21239
|
+
type WebSocketChatTransportRequest<UI_MESSAGE extends UIMessage = UIMessage> = WebSocketChatTransportSendRequest<UI_MESSAGE> | WebSocketChatTransportResumeRequest | WebSocketChatTransportAbortRequest;
|
|
21240
|
+
/**
|
|
21241
|
+
* A server-to-client frame used by `WebSocketChatTransport`.
|
|
21242
|
+
*/
|
|
21243
|
+
type WebSocketChatTransportResponse = {
|
|
21244
|
+
type: 'start';
|
|
21245
|
+
requestId: string;
|
|
21246
|
+
} | {
|
|
21247
|
+
type: 'chunk';
|
|
21248
|
+
requestId: string;
|
|
21249
|
+
sequence: number;
|
|
21250
|
+
chunk: UIMessageChunk;
|
|
21251
|
+
} | {
|
|
21252
|
+
type: 'end';
|
|
21253
|
+
requestId: string;
|
|
21254
|
+
} | {
|
|
21255
|
+
type: 'error';
|
|
21256
|
+
requestId: string;
|
|
21257
|
+
errorText?: string;
|
|
21258
|
+
} | {
|
|
21259
|
+
type: 'no-active';
|
|
21260
|
+
requestId: string;
|
|
21261
|
+
};
|
|
21262
|
+
type SafeValidateWebSocketChatTransportRequestResult<UI_MESSAGE extends UIMessage> = {
|
|
21263
|
+
success: true;
|
|
21264
|
+
data: WebSocketChatTransportRequest<UI_MESSAGE>;
|
|
21265
|
+
} | {
|
|
21266
|
+
success: false;
|
|
21267
|
+
error: Error;
|
|
21268
|
+
};
|
|
21269
|
+
type PrepareWebSocketChatTransportSendMessagesRequest<UI_MESSAGE extends UIMessage> = (options: {
|
|
21270
|
+
id: string;
|
|
21271
|
+
messages: UI_MESSAGE[];
|
|
21272
|
+
requestMetadata: unknown;
|
|
21273
|
+
body: object;
|
|
21274
|
+
headers: Record<string, string>;
|
|
21275
|
+
trigger: 'submit-message' | 'regenerate-message';
|
|
21276
|
+
messageId: string | undefined;
|
|
21277
|
+
}) => {
|
|
21278
|
+
messages?: UI_MESSAGE[];
|
|
21279
|
+
body?: object;
|
|
21280
|
+
headers?: HeadersInit;
|
|
21281
|
+
} | PromiseLike<{
|
|
21282
|
+
messages?: UI_MESSAGE[];
|
|
21283
|
+
body?: object;
|
|
21284
|
+
headers?: HeadersInit;
|
|
21285
|
+
}>;
|
|
21286
|
+
type PrepareWebSocketChatTransportReconnectToStreamRequest = (options: {
|
|
21287
|
+
id: string;
|
|
21288
|
+
requestMetadata: unknown;
|
|
21289
|
+
body: object;
|
|
21290
|
+
headers: Record<string, string>;
|
|
21291
|
+
}) => {
|
|
21292
|
+
body?: object;
|
|
21293
|
+
headers?: HeadersInit;
|
|
21294
|
+
} | PromiseLike<{
|
|
21295
|
+
body?: object;
|
|
21296
|
+
headers?: HeadersInit;
|
|
21297
|
+
}>;
|
|
21298
|
+
/**
|
|
21299
|
+
* Options for `WebSocketChatTransport`.
|
|
20387
21300
|
*/
|
|
20388
|
-
type
|
|
21301
|
+
type WebSocketChatTransportInitOptions<UI_MESSAGE extends UIMessage> = {
|
|
20389
21302
|
/**
|
|
20390
|
-
*
|
|
21303
|
+
* WebSocket endpoint URL. HTTP(S) URLs are converted to WS(S), and relative
|
|
21304
|
+
* URLs are resolved against the current browser location.
|
|
20391
21305
|
*/
|
|
20392
|
-
|
|
21306
|
+
url: string;
|
|
20393
21307
|
/**
|
|
20394
|
-
*
|
|
21308
|
+
* Optional WebSocket subprotocols used during the connection handshake.
|
|
20395
21309
|
*/
|
|
20396
|
-
|
|
20397
|
-
} & Omit<UIMessageStreamOptions<UI_MESSAGE>, 'onFinish'>;
|
|
20398
|
-
/**
|
|
20399
|
-
* A transport that directly communicates with an Agent in-process,
|
|
20400
|
-
* without going through HTTP. This is useful for:
|
|
20401
|
-
* - Server-side rendering scenarios
|
|
20402
|
-
* - Testing without network
|
|
20403
|
-
* - Single-process applications
|
|
20404
|
-
*
|
|
20405
|
-
* @example
|
|
20406
|
-
* ```tsx
|
|
20407
|
-
* import { useChat } from '@ai-sdk/react';
|
|
20408
|
-
* import { DirectChatTransport } from 'ai';
|
|
20409
|
-
* import { myAgent } from './my-agent';
|
|
20410
|
-
*
|
|
20411
|
-
* const { messages, sendMessage } = useChat({
|
|
20412
|
-
* transport: new DirectChatTransport({ agent: myAgent }),
|
|
20413
|
-
* });
|
|
20414
|
-
* ```
|
|
20415
|
-
*/
|
|
20416
|
-
declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = never, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>> = UIMessage<unknown, never, InferUITools<TOOLS>>> implements ChatTransport<UI_MESSAGE> {
|
|
20417
|
-
private readonly agent;
|
|
20418
|
-
private readonly agentOptions;
|
|
20419
|
-
private readonly uiMessageStreamOptions;
|
|
20420
|
-
constructor({ agent, options, ...uiMessageStreamOptions }: DirectChatTransportOptions<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT, UI_MESSAGE>);
|
|
20421
|
-
sendMessages({ messages, abortSignal }: Parameters<ChatTransport<UI_MESSAGE>['sendMessages']>[0]): Promise<ReadableStream<UIMessageChunk>>;
|
|
21310
|
+
protocols?: string | string[];
|
|
20422
21311
|
/**
|
|
20423
|
-
*
|
|
20424
|
-
|
|
21312
|
+
* Query parameters appended when a new connection is opened.
|
|
21313
|
+
*/
|
|
21314
|
+
params?: Resolvable<Record<string, string>>;
|
|
21315
|
+
/**
|
|
21316
|
+
* Headers included in each application-level request frame.
|
|
20425
21317
|
*
|
|
20426
|
-
*
|
|
21318
|
+
* Browser WebSocket APIs cannot set handshake headers. Use cookies, query
|
|
21319
|
+
* parameters, or subprotocols for handshake authentication.
|
|
20427
21320
|
*/
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
21321
|
+
headers?: Resolvable<Record<string, string> | Headers>;
|
|
21322
|
+
/**
|
|
21323
|
+
* Extra application data included in each send and resume request.
|
|
21324
|
+
*/
|
|
21325
|
+
body?: Resolvable<object>;
|
|
21326
|
+
/**
|
|
21327
|
+
* Custom WebSocket implementation, for example the `ws` package in Node.js.
|
|
21328
|
+
*/
|
|
21329
|
+
webSocket?: WebSocketConstructor;
|
|
21330
|
+
/**
|
|
21331
|
+
* Customizes send request frames before they are transmitted.
|
|
21332
|
+
*/
|
|
21333
|
+
prepareSendMessagesRequest?: PrepareWebSocketChatTransportSendMessagesRequest<UI_MESSAGE>;
|
|
21334
|
+
/**
|
|
21335
|
+
* Customizes resume request frames before they are transmitted.
|
|
21336
|
+
*/
|
|
21337
|
+
prepareReconnectToStreamRequest?: PrepareWebSocketChatTransportReconnectToStreamRequest;
|
|
21338
|
+
};
|
|
20432
21339
|
/**
|
|
20433
|
-
*
|
|
20434
|
-
* The last step of the message must have at least one tool approval response and
|
|
20435
|
-
* all tool approvals must have a response.
|
|
21340
|
+
* Validates an untrusted client-to-server WebSocket chat frame.
|
|
20436
21341
|
*/
|
|
20437
|
-
declare function
|
|
20438
|
-
|
|
20439
|
-
}):
|
|
20440
|
-
//#endregion
|
|
20441
|
-
//#region src/ui/last-assistant-message-is-complete-with-tool-calls.d.ts
|
|
21342
|
+
declare function safeValidateWebSocketChatTransportRequest<UI_MESSAGE extends UIMessage = UIMessage>({ value }: {
|
|
21343
|
+
value: unknown;
|
|
21344
|
+
}): Promise<SafeValidateWebSocketChatTransportRequestResult<UI_MESSAGE>>;
|
|
20442
21345
|
/**
|
|
20443
|
-
*
|
|
20444
|
-
*
|
|
20445
|
-
*
|
|
20446
|
-
*
|
|
20447
|
-
*
|
|
21346
|
+
* A `ChatTransport` that multiplexes correlated UI message streams over one
|
|
21347
|
+
* persistent WebSocket connection.
|
|
21348
|
+
*
|
|
21349
|
+
* The server must implement the protocol represented by
|
|
21350
|
+
* `WebSocketChatTransportRequest` and `WebSocketChatTransportResponse`.
|
|
20448
21351
|
*/
|
|
20449
|
-
declare
|
|
20450
|
-
|
|
20451
|
-
|
|
20452
|
-
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
21352
|
+
declare class WebSocketChatTransport<UI_MESSAGE extends UIMessage> implements ChatTransport<UI_MESSAGE> {
|
|
21353
|
+
readonly resumeStreamIsReplay = true;
|
|
21354
|
+
private readonly url;
|
|
21355
|
+
private readonly protocols?;
|
|
21356
|
+
private readonly params?;
|
|
21357
|
+
private readonly headers?;
|
|
21358
|
+
private readonly body?;
|
|
21359
|
+
private readonly webSocket?;
|
|
21360
|
+
private readonly prepareSendMessagesRequest?;
|
|
21361
|
+
private readonly prepareReconnectToStreamRequest?;
|
|
21362
|
+
private connection?;
|
|
21363
|
+
private readonly activeRequests;
|
|
21364
|
+
private sendQueue;
|
|
21365
|
+
constructor(options: WebSocketChatTransportInitOptions<UI_MESSAGE>);
|
|
21366
|
+
sendMessages({ abortSignal, ...options }: Parameters<ChatTransport<UI_MESSAGE>['sendMessages']>[0]): Promise<ReadableStream<UIMessageChunk>>;
|
|
21367
|
+
reconnectToStream(options: Parameters<ChatTransport<UI_MESSAGE>['reconnectToStream']>[0]): Promise<ReadableStream<UIMessageChunk> | null>;
|
|
21368
|
+
/**
|
|
21369
|
+
* Closes the current connection and errors any active response streams.
|
|
21370
|
+
* A later request opens a new connection.
|
|
21371
|
+
*/
|
|
21372
|
+
close(): void;
|
|
21373
|
+
private throwIfAborted;
|
|
21374
|
+
private getSocket;
|
|
21375
|
+
private initializeConnection;
|
|
21376
|
+
private buildUrl;
|
|
21377
|
+
private waitForConnection;
|
|
21378
|
+
private resolveConnection;
|
|
21379
|
+
private rejectConnection;
|
|
21380
|
+
private terminateConnection;
|
|
21381
|
+
private createActiveRequest;
|
|
21382
|
+
private abortRequest;
|
|
21383
|
+
private cleanupRequest;
|
|
21384
|
+
private failRequest;
|
|
21385
|
+
private failAllRequests;
|
|
21386
|
+
private resolveResumeStream;
|
|
21387
|
+
private validateResponseChunk;
|
|
21388
|
+
private handleResponseFrame;
|
|
21389
|
+
private sendFrame;
|
|
20457
21390
|
}
|
|
20458
21391
|
//#endregion
|
|
20459
21392
|
//#region src/ui/use-completion.d.ts
|
|
@@ -20730,9 +21663,9 @@ declare function toUIMessageChunk<TOOLS extends ToolSet = ToolSet, UI_MESSAGE ex
|
|
|
20730
21663
|
* Converts a stream of `TextStreamPart<TOOLS>` chunks (as emitted by
|
|
20731
21664
|
* `streamText`'s `stream`) into a stream of `UIMessageChunk`s suitable for
|
|
20732
21665
|
* UI message streaming, including response message ID injection and
|
|
20733
|
-
*
|
|
21666
|
+
* step and stream end callbacks.
|
|
20734
21667
|
*/
|
|
20735
|
-
declare function toUIMessageStream<TOOLS extends ToolSet = ToolSet, UI_MESSAGE extends UIMessage = UIMessage>({ stream, tools, sendReasoning, sendSources, sendStart, sendFinish, onError, messageMetadata, originalMessages, generateMessageId, onEnd, onFinish }: {
|
|
21668
|
+
declare function toUIMessageStream<TOOLS extends ToolSet = ToolSet, UI_MESSAGE extends UIMessage = UIMessage>({ stream, tools, sendReasoning, sendSources, sendStart, sendFinish, onError, messageMetadata, originalMessages, generateMessageId, onStepEnd, onStepFinish, onEnd, onFinish }: {
|
|
20736
21669
|
stream: ReadableStream<TextStreamPart<TOOLS>>;
|
|
20737
21670
|
tools?: TOOLS;
|
|
20738
21671
|
} & UIMessageStreamOptions<UI_MESSAGE>): ReadableStream<InferUIMessageChunk<UI_MESSAGE>>;
|
|
@@ -20753,6 +21686,19 @@ declare const UI_MESSAGE_STREAM_HEADERS: {
|
|
|
20753
21686
|
type UIMessageStreamOnFinishCallback<UI_MESSAGE extends UIMessage> = UIMessageStreamOnEndCallback<UI_MESSAGE>;
|
|
20754
21687
|
//#endregion
|
|
20755
21688
|
//#region src/agent/create-agent-ui-stream.d.ts
|
|
21689
|
+
/**
|
|
21690
|
+
* UI stream options with separate generation and UI message step callbacks.
|
|
21691
|
+
*/
|
|
21692
|
+
type AgentUIMessageStreamOptions<TOOLS extends ToolSet, UI_MESSAGE extends UIMessage> = Omit<UIMessageStreamOptions<UI_MESSAGE>, 'onStepEnd' | 'onStepFinish'> & {
|
|
21693
|
+
onStepEnd?: GenerateTextOnStepEndCallback<TOOLS>;
|
|
21694
|
+
/** @deprecated Use `onStepEnd` instead. */
|
|
21695
|
+
onStepFinish?: GenerateTextOnStepFinishCallback<TOOLS>;
|
|
21696
|
+
/**
|
|
21697
|
+
* Called after each step is converted to UI message parts.
|
|
21698
|
+
* Receives the accumulated UI message for inspection or persistence.
|
|
21699
|
+
*/
|
|
21700
|
+
onUIMessageStepEnd?: UIMessageStreamOnStepEndCallback<UI_MESSAGE>;
|
|
21701
|
+
};
|
|
20756
21702
|
/**
|
|
20757
21703
|
* Runs the agent and stream the output as a UI message stream.
|
|
20758
21704
|
*
|
|
@@ -20762,14 +21708,16 @@ type UIMessageStreamOnFinishCallback<UI_MESSAGE extends UIMessage> = UIMessageSt
|
|
|
20762
21708
|
* @param abortSignal - The abort signal. Optional.
|
|
20763
21709
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
20764
21710
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
21711
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
20765
21712
|
* @param options - The options for the agent.
|
|
20766
21713
|
* @param experimental_transform - The stream transformations. Optional.
|
|
20767
21714
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
20768
21715
|
* @param onStepFinish - Deprecated alias for `onStepEnd`. Optional.
|
|
21716
|
+
* @param onUIMessageStepEnd - Callback with the accumulated UI message after each step. Optional.
|
|
20769
21717
|
*
|
|
20770
21718
|
* @returns The UI message stream.
|
|
20771
21719
|
*/
|
|
20772
|
-
declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, 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, ...uiMessageStreamOptions }: {
|
|
21720
|
+
declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, 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 }: {
|
|
20773
21721
|
agent: Agent$1<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
20774
21722
|
uiMessages: unknown[];
|
|
20775
21723
|
/**
|
|
@@ -20780,12 +21728,50 @@ declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet
|
|
|
20780
21728
|
abortSignal?: AbortSignal;
|
|
20781
21729
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
20782
21730
|
experimental_sandbox?: SandboxSession;
|
|
21731
|
+
experimental_steering?: Steering;
|
|
20783
21732
|
options?: CALL_OPTIONS;
|
|
20784
21733
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
20785
|
-
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
|
|
21734
|
+
} & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>>;
|
|
21735
|
+
//#endregion
|
|
21736
|
+
//#region src/agent/create-agent-ui-stream-response.d.ts
|
|
21737
|
+
/**
|
|
21738
|
+
* Runs the agent and returns a response object with a UI message stream.
|
|
21739
|
+
*
|
|
21740
|
+
* @param agent - The agent to run.
|
|
21741
|
+
* @param uiMessages - The input UI messages.
|
|
21742
|
+
* @param convertDataPart - Optional function to convert custom data parts to text or file model message parts.
|
|
21743
|
+
* @param abortSignal - Abort signal. Optional.
|
|
21744
|
+
* @param timeout - Timeout in milliseconds. Optional.
|
|
21745
|
+
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
21746
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
21747
|
+
* @param options - The options for the agent. Optional.
|
|
21748
|
+
* @param experimental_transform - Stream transformations. Optional.
|
|
21749
|
+
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
21750
|
+
* @param onStepFinish - Deprecated alias for `onStepEnd`. Optional.
|
|
21751
|
+
* @param onUIMessageStepEnd - Callback with the accumulated UI message after each step. Optional.
|
|
21752
|
+
* @param headers - Additional headers for the response. Optional.
|
|
21753
|
+
* @param status - The status code for the response. Optional.
|
|
21754
|
+
* @param statusText - The status text for the response. Optional.
|
|
21755
|
+
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
21756
|
+
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
21757
|
+
*
|
|
21758
|
+
* @returns The response object.
|
|
21759
|
+
*/
|
|
21760
|
+
declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, RUNTIME_CONTEXT extends Context$1 = Context$1, OUTPUT extends Output = never, MESSAGE_METADATA = unknown, UI_MESSAGE extends UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>> = UIMessage<MESSAGE_METADATA, UIDataTypes, InferUITools<TOOLS>>>({ headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
21761
|
+
agent: Agent$1<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>;
|
|
21762
|
+
uiMessages: unknown[];
|
|
21763
|
+
/**
|
|
21764
|
+
* Converts custom UI data parts to text or file model message parts.
|
|
21765
|
+
* Data parts are ignored when omitted or when the callback returns undefined.
|
|
21766
|
+
*/
|
|
21767
|
+
convertDataPart?: NonNullable<Parameters<typeof convertToModelMessages<UI_MESSAGE>>[1]>['convertDataPart'];
|
|
21768
|
+
abortSignal?: AbortSignal;
|
|
21769
|
+
timeout?: TimeoutConfiguration<TOOLS>;
|
|
21770
|
+
experimental_sandbox?: SandboxSession;
|
|
21771
|
+
experimental_steering?: Steering;
|
|
21772
|
+
options?: CALL_OPTIONS;
|
|
21773
|
+
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
21774
|
+
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<Response>;
|
|
20789
21775
|
//#endregion
|
|
20790
21776
|
//#region src/agent/pipe-agent-ui-stream-to-response.d.ts
|
|
20791
21777
|
/**
|
|
@@ -20798,10 +21784,12 @@ declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet
|
|
|
20798
21784
|
* @param abortSignal - Abort signal. Optional.
|
|
20799
21785
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
20800
21786
|
* @param experimental_sandbox - The sandbox environment that is passed through to tool execution. Optional.
|
|
21787
|
+
* @param experimental_steering - A steering object that adds user messages to the run at the next step boundary. Only supported by `ToolLoopAgent`. Optional.
|
|
20801
21788
|
* @param options - The options for the agent. Optional.
|
|
20802
21789
|
* @param experimental_transform - Stream transformations. Optional.
|
|
20803
21790
|
* @param onStepEnd - Callback that is called when each step ends. Optional.
|
|
20804
21791
|
* @param onStepFinish - Deprecated alias for `onStepEnd`. Optional.
|
|
21792
|
+
* @param onUIMessageStepEnd - Callback with the accumulated UI message after each step. Optional.
|
|
20805
21793
|
* @param headers - Additional headers for the response. Optional.
|
|
20806
21794
|
* @param status - The status code for the response. Optional.
|
|
20807
21795
|
* @param statusText - The status text for the response. Optional.
|
|
@@ -20820,12 +21808,10 @@ declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends
|
|
|
20820
21808
|
abortSignal?: AbortSignal;
|
|
20821
21809
|
timeout?: TimeoutConfiguration<TOOLS>;
|
|
20822
21810
|
experimental_sandbox?: SandboxSession;
|
|
21811
|
+
experimental_steering?: Steering;
|
|
20823
21812
|
options?: CALL_OPTIONS;
|
|
20824
21813
|
experimental_transform?: Arrayable<StreamTextTransform<TOOLS>>;
|
|
20825
|
-
|
|
20826
|
-
/** @deprecated Use `onStepEnd` instead. */
|
|
20827
|
-
onStepFinish?: GenerateTextOnStepFinishCallback<TOOLS>;
|
|
20828
|
-
} & UIMessageStreamResponseInit & UIMessageStreamOptions<UI_MESSAGE>): Promise<void>;
|
|
21814
|
+
} & UIMessageStreamResponseInit & AgentUIMessageStreamOptions<TOOLS, UI_MESSAGE>): Promise<void>;
|
|
20829
21815
|
//#endregion
|
|
20830
21816
|
//#region src/generate-text/filter-active-tools.d.ts
|
|
20831
21817
|
type ActiveToolSubset<TOOLS extends ToolSet | undefined, ACTIVE_TOOL_NAMES extends ActiveTools<NonNullable<TOOLS>>> = TOOLS extends undefined ? undefined : [ACTIVE_TOOL_NAMES] extends [NonNullable<ActiveTools<NonNullable<TOOLS>>>] ? Pick<NonNullable<TOOLS>, ACTIVE_TOOL_NAMES[number]> : TOOLS;
|
|
@@ -20978,7 +21964,7 @@ type LanguageModelStreamPart<TOOLS extends ToolSet = ToolSet> = Exclude<TextStre
|
|
|
20978
21964
|
*
|
|
20979
21965
|
* @returns A stream of model call parts together with request and response metadata when available.
|
|
20980
21966
|
*/
|
|
20981
|
-
declare function streamLanguageModelCall<TOOLS extends ToolSet, OUTPUT extends Output = Output>({ model, tools, toolOrder, output, toolChoice, prompt, system, instructions, messages, allowSystemInMessages, download, abortSignal, headers, includeRawChunks, providerOptions, repairToolCall, refineToolInput, executeLanguageModelCallInTelemetryContext, callId, toolsContext, experimental_sandbox: sandbox, _internal: { generateId, generateCallId, now }, onStart, onLanguageModelCallStart, onLanguageModelCallEnd, ...callSettings }: {
|
|
21967
|
+
declare function streamLanguageModelCall<TOOLS extends ToolSet, OUTPUT extends Output = Output>({ model, tools, toolOrder, output, toolChoice, prompt, system, instructions, messages, allowSystemInMessages, download, abortSignal, headers, includeRawChunks, providerOptions, repairToolCall, refineToolInput, executeLanguageModelCallInTelemetryContext, callId, toolsContext, experimental_sandbox: sandbox, _internal: { generateId, generateCallId, now, collectContent }, onStart, onLanguageModelCallStart, onLanguageModelCallEnd, ...callSettings }: {
|
|
20982
21968
|
model: LanguageModel;
|
|
20983
21969
|
tools?: TOOLS;
|
|
20984
21970
|
toolOrder?: ToolOrder<TOOLS>;
|
|
@@ -21006,6 +21992,8 @@ declare function streamLanguageModelCall<TOOLS extends ToolSet, OUTPUT extends O
|
|
|
21006
21992
|
generateId?: IdGenerator;
|
|
21007
21993
|
generateCallId?: IdGenerator;
|
|
21008
21994
|
now?: () => number;
|
|
21995
|
+
/** Internal: content is only needed by collectors and full-content callbacks. */
|
|
21996
|
+
collectContent?: boolean;
|
|
21009
21997
|
};
|
|
21010
21998
|
onLanguageModelCallStart?: Arrayable<OnLanguageModelCallStartCallback>;
|
|
21011
21999
|
onLanguageModelCallEnd?: Arrayable<OnLanguageModelCallEndCallback<TOOLS>>;
|
|
@@ -21491,6 +22479,8 @@ interface EmbedResult {
|
|
|
21491
22479
|
* @param model - The embedding model to use.
|
|
21492
22480
|
* @param value - The value that should be embedded.
|
|
21493
22481
|
*
|
|
22482
|
+
* @param dimensions - Requested output dimensions. Must be a positive integer. Requires provider support.
|
|
22483
|
+
*
|
|
21494
22484
|
* @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
|
|
21495
22485
|
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
21496
22486
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
@@ -21504,7 +22494,7 @@ interface EmbedResult {
|
|
|
21504
22494
|
*
|
|
21505
22495
|
* @returns A result object that contains the embedding, the value, and additional information.
|
|
21506
22496
|
*/
|
|
21507
|
-
declare function embed<RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: modelArg, value, providerOptions, maxRetries: maxRetriesArg, abortSignal, headers, experimental_telemetry, telemetry, runtimeContext, onStart, experimental_onStart, onEnd, experimental_onEnd, _internal: { generateCallId } }: {
|
|
22497
|
+
declare function embed<RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: modelArg, value, dimensions, providerOptions, maxRetries: maxRetriesArg, abortSignal, headers, experimental_telemetry, telemetry, runtimeContext, onStart, experimental_onStart, onEnd, experimental_onEnd, _internal: { generateCallId } }: {
|
|
21508
22498
|
/**
|
|
21509
22499
|
* The embedding model to use.
|
|
21510
22500
|
*/
|
|
@@ -21513,6 +22503,12 @@ declare function embed<RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: m
|
|
|
21513
22503
|
* The value that should be embedded.
|
|
21514
22504
|
*/
|
|
21515
22505
|
value: string;
|
|
22506
|
+
/**
|
|
22507
|
+
* The requested number of dimensions for the output embeddings.
|
|
22508
|
+
* Must be a positive integer. Support and allowed values depend on the model
|
|
22509
|
+
* and provider implementation.
|
|
22510
|
+
*/
|
|
22511
|
+
dimensions?: number;
|
|
21516
22512
|
/**
|
|
21517
22513
|
* Maximum number of retries per embedding model call. Set to 0 to disable retries.
|
|
21518
22514
|
*
|
|
@@ -21633,6 +22629,8 @@ interface EmbedManyResult {
|
|
|
21633
22629
|
* @param model - The embedding model to use.
|
|
21634
22630
|
* @param values - The values that should be embedded.
|
|
21635
22631
|
*
|
|
22632
|
+
* @param dimensions - Requested output dimensions. Must be a positive integer. Requires provider support.
|
|
22633
|
+
*
|
|
21636
22634
|
* @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
|
|
21637
22635
|
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
21638
22636
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
@@ -21650,7 +22648,7 @@ interface EmbedManyResult {
|
|
|
21650
22648
|
*
|
|
21651
22649
|
* @returns A result object that contains the embeddings, the value, and additional information.
|
|
21652
22650
|
*/
|
|
21653
|
-
declare function embedMany<RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: modelArg, values, maxParallelCalls, maxRetries: maxRetriesArg, abortSignal, headers, providerOptions, experimental_telemetry, telemetry, runtimeContext, onStart, experimental_onStart, onEnd, experimental_onEnd, _internal: { generateCallId } }: {
|
|
22651
|
+
declare function embedMany<RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: modelArg, values, dimensions, maxParallelCalls, maxRetries: maxRetriesArg, abortSignal, headers, providerOptions, experimental_telemetry, telemetry, runtimeContext, onStart, experimental_onStart, onEnd, experimental_onEnd, _internal: { generateCallId } }: {
|
|
21654
22652
|
/**
|
|
21655
22653
|
* The embedding model to use.
|
|
21656
22654
|
*/
|
|
@@ -21659,6 +22657,12 @@ declare function embedMany<RUNTIME_CONTEXT extends Context$1 = Context$1>({ mode
|
|
|
21659
22657
|
* The values that should be embedded.
|
|
21660
22658
|
*/
|
|
21661
22659
|
values: Array<string>;
|
|
22660
|
+
/**
|
|
22661
|
+
* The requested number of dimensions for the output embeddings.
|
|
22662
|
+
* Must be a positive integer. Support and allowed values depend on the model
|
|
22663
|
+
* and provider implementation.
|
|
22664
|
+
*/
|
|
22665
|
+
dimensions?: number;
|
|
21662
22666
|
/**
|
|
21663
22667
|
* Maximum number of retries per embedding model call. Set to 0 to disable retries.
|
|
21664
22668
|
*
|
|
@@ -21901,6 +22905,7 @@ declare class NoSpeechGeneratedError extends AISDKError {
|
|
|
21901
22905
|
readonly responses: Array<SpeechModelResponseMetadata>;
|
|
21902
22906
|
constructor(options: {
|
|
21903
22907
|
responses: Array<SpeechModelResponseMetadata>;
|
|
22908
|
+
cause?: unknown;
|
|
21904
22909
|
});
|
|
21905
22910
|
static isInstance(error: unknown): error is NoSpeechGeneratedError;
|
|
21906
22911
|
}
|
|
@@ -22063,6 +23068,8 @@ declare class ToolCallRepairError extends AISDKError {
|
|
|
22063
23068
|
//#region src/error/tool-choice-violation-error.d.ts
|
|
22064
23069
|
declare const symbol$6: unique symbol;
|
|
22065
23070
|
type EnforcedToolChoice = Extract<LanguageModelV4ToolChoice, {
|
|
23071
|
+
type: 'none';
|
|
23072
|
+
} | {
|
|
22066
23073
|
type: 'required';
|
|
22067
23074
|
} | {
|
|
22068
23075
|
type: 'tool';
|
|
@@ -22215,11 +23222,15 @@ type Experimental_EvaluationUnsupportedQuestionTypeError = DecisionUnsupportedQu
|
|
|
22215
23222
|
//#endregion
|
|
22216
23223
|
//#region src/decide/decide.d.ts
|
|
22217
23224
|
/** Decide answers to typed questions against one shared state. Experimental. */
|
|
22218
|
-
declare function decide<const QUESTIONS extends Record<string,
|
|
23225
|
+
declare function decide<const QUESTIONS extends Record<string, DecisionModelV4Question>, RUNTIME_CONTEXT extends Context$1 = Context$1>({ model: modelArg, state, questions, maxOutputTokens, reasoning, maxRetries, abortSignal, headers, providerOptions, telemetry, runtimeContext, onStart, onEnd, _internal: { generateCallId } }: {
|
|
22219
23226
|
/** A decision model instance or an ID resolved by the configured default provider. */
|
|
22220
23227
|
model: DecisionModel;
|
|
22221
|
-
state:
|
|
23228
|
+
state: DecisionState;
|
|
22222
23229
|
questions: QUESTIONS;
|
|
23230
|
+
/** Maximum output tokens for supported models. Must be an integer >= 1. */
|
|
23231
|
+
maxOutputTokens?: number;
|
|
23232
|
+
/** Reasoning effort for supported models. Language-model adapters default to none. */
|
|
23233
|
+
reasoning?: DecisionModelV4CallOptions['reasoning'];
|
|
22223
23234
|
/** Maximum retries for transient provider failures. Defaults to 2. */
|
|
22224
23235
|
maxRetries?: number;
|
|
22225
23236
|
abortSignal?: AbortSignal;
|
|
@@ -22253,11 +23264,11 @@ type Experimental_EvaluationModelCallEndEvent = DecisionModelCallEndEvent;
|
|
|
22253
23264
|
/** @deprecated Use `Experimental_DecisionModel` instead. */
|
|
22254
23265
|
type Experimental_EvaluationModel = DecisionModel;
|
|
22255
23266
|
/** @deprecated Use `Experimental_DecisionQuestion` instead. */
|
|
22256
|
-
type Experimental_EvaluationQuestion =
|
|
23267
|
+
type Experimental_EvaluationQuestion = DecisionModelV4Question;
|
|
22257
23268
|
/** @deprecated Use `Experimental_DecisionAnswer` instead. */
|
|
22258
|
-
type Experimental_EvaluationAnswer<QUESTION extends
|
|
23269
|
+
type Experimental_EvaluationAnswer<QUESTION extends DecisionModelV4Question> = DecisionAnswer<QUESTION>;
|
|
22259
23270
|
/** @deprecated Use `Experimental_DecisionResult` instead. */
|
|
22260
|
-
type Experimental_EvaluationResult<QUESTIONS extends Record<string,
|
|
23271
|
+
type Experimental_EvaluationResult<QUESTIONS extends Record<string, DecisionModelV4Question>> = DecisionResult<QUESTIONS>;
|
|
22261
23272
|
//#endregion
|
|
22262
23273
|
//#region src/generate-object/generate-object-result.d.ts
|
|
22263
23274
|
/**
|
|
@@ -22589,8 +23600,10 @@ type Job = () => Promise<void>;
|
|
|
22589
23600
|
declare class SerialJobExecutor {
|
|
22590
23601
|
private queue;
|
|
22591
23602
|
private isProcessing;
|
|
23603
|
+
private idleWaiters;
|
|
22592
23604
|
private processQueue;
|
|
22593
23605
|
run(job: Job): Promise<void>;
|
|
23606
|
+
waitForIdle(): Promise<void>;
|
|
22594
23607
|
}
|
|
22595
23608
|
//#endregion
|
|
22596
23609
|
//#region src/util/simulate-readable-stream.d.ts
|
|
@@ -23059,6 +24072,166 @@ declare function generateSpeech({ model, text, voice, outputFormat, instructions
|
|
|
23059
24072
|
};
|
|
23060
24073
|
}): Promise<SpeechResult>;
|
|
23061
24074
|
//#endregion
|
|
24075
|
+
//#region src/generate-speech/stream-speech-result.d.ts
|
|
24076
|
+
/**
|
|
24077
|
+
* A piece of text to synthesize. Pass a stream of these (or mix them with
|
|
24078
|
+
* plain strings) to give parts their own voice, e.g. for dialogue.
|
|
24079
|
+
*/
|
|
24080
|
+
type SpeechTextPart = {
|
|
24081
|
+
type: 'text';
|
|
24082
|
+
text: string;
|
|
24083
|
+
/**
|
|
24084
|
+
* The voice that speaks this part (provider-specific, like the call's
|
|
24085
|
+
* `voice`). Single-voice providers reject a voice that differs from the
|
|
24086
|
+
* call's voice.
|
|
24087
|
+
*/
|
|
24088
|
+
voice?: string;
|
|
24089
|
+
/**
|
|
24090
|
+
* Additional provider-specific options for this part.
|
|
24091
|
+
*/
|
|
24092
|
+
providerOptions?: ProviderOptions;
|
|
24093
|
+
};
|
|
24094
|
+
type SpeechStreamPart = {
|
|
24095
|
+
/**
|
|
24096
|
+
* Audio chunk in generation order. Chunks are not necessarily
|
|
24097
|
+
* standalone files; concatenate them to reconstruct the audio. A chunk
|
|
24098
|
+
* is empty only when it carries `providerMetadata` (e.g. a turn marker).
|
|
24099
|
+
*/
|
|
24100
|
+
type: 'audio';
|
|
24101
|
+
id?: string;
|
|
24102
|
+
audio: Uint8Array;
|
|
24103
|
+
audioFormat: SharedV4AudioFormat;
|
|
24104
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
24105
|
+
} | {
|
|
24106
|
+
type: 'raw';
|
|
24107
|
+
rawValue: unknown;
|
|
24108
|
+
} | {
|
|
24109
|
+
type: 'error';
|
|
24110
|
+
error: unknown;
|
|
24111
|
+
};
|
|
24112
|
+
type SpeechStreamUsage = SpeechModelV4StreamUsage;
|
|
24113
|
+
interface StreamSpeechResult {
|
|
24114
|
+
/**
|
|
24115
|
+
* Usage information reported for the call, if available.
|
|
24116
|
+
*/
|
|
24117
|
+
readonly usage: PromiseLike<SpeechStreamUsage>;
|
|
24118
|
+
/**
|
|
24119
|
+
* Warnings for the call, e.g. unsupported settings.
|
|
24120
|
+
*/
|
|
24121
|
+
readonly warnings: PromiseLike<Array<Warning>>;
|
|
24122
|
+
/**
|
|
24123
|
+
* Response metadata.
|
|
24124
|
+
*/
|
|
24125
|
+
readonly responses: PromiseLike<Array<SpeechModelResponseMetadata>>;
|
|
24126
|
+
/**
|
|
24127
|
+
* Additional provider-specific metadata.
|
|
24128
|
+
*/
|
|
24129
|
+
readonly providerMetadata: PromiseLike<Record<string, JSONObject$2>>;
|
|
24130
|
+
/**
|
|
24131
|
+
* Stream of audio bytes in generation order.
|
|
24132
|
+
*
|
|
24133
|
+
* `audioStream` and `fullStream` share one live stream: only one of them
|
|
24134
|
+
* can be accessed, and only once. Access it before any result promise;
|
|
24135
|
+
* accessing a result promise first consumes the stream internally.
|
|
24136
|
+
*/
|
|
24137
|
+
readonly audioStream: AsyncIterableStream<Uint8Array>;
|
|
24138
|
+
/**
|
|
24139
|
+
* Full stream of speech parts (audio, raw, and error parts).
|
|
24140
|
+
*
|
|
24141
|
+
* `audioStream` and `fullStream` share one live stream: only one of them
|
|
24142
|
+
* can be accessed, and only once. Access it before any result promise;
|
|
24143
|
+
* accessing a result promise first consumes the stream internally.
|
|
24144
|
+
*/
|
|
24145
|
+
readonly fullStream: AsyncIterableStream<SpeechStreamPart>;
|
|
24146
|
+
}
|
|
24147
|
+
//#endregion
|
|
24148
|
+
//#region src/generate-speech/stream-speech.d.ts
|
|
24149
|
+
/**
|
|
24150
|
+
* Streams speech audio using a speech model.
|
|
24151
|
+
*
|
|
24152
|
+
* @param model - The speech model to use. It must support streaming speech.
|
|
24153
|
+
* @param text - The text to convert to speech: a complete string, or a stream of text deltas
|
|
24154
|
+
* (e.g. the text stream of `streamText`) or text parts that is synthesized as it arrives.
|
|
24155
|
+
* A text part can set its own `voice` on providers that support several voices per stream.
|
|
24156
|
+
* @param voice - The voice to use for speech generation.
|
|
24157
|
+
* @param outputFormat - The format of the output audio chunks, e.g. `{ type: 'audio/pcm', rate: 24000 }`.
|
|
24158
|
+
* @param instructions - Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
24159
|
+
* @param speed - The speed of the speech generation.
|
|
24160
|
+
* @param language - The language for speech generation (ISO 639-1 code e.g. "en", "es", "fr") or "auto" for automatic detection.
|
|
24161
|
+
* @param providerOptions - Additional provider-specific options.
|
|
24162
|
+
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
24163
|
+
* @param headers - Additional HTTP/WebSocket headers to send when supported by the provider.
|
|
24164
|
+
* @param includeRawChunks - When true, raw provider chunks are included in `fullStream`.
|
|
24165
|
+
* @param onError - Called for each provider error part; defaults to `console.error`.
|
|
24166
|
+
*
|
|
24167
|
+
* @returns A result object with the audio stream and the final usage and metadata.
|
|
24168
|
+
*/
|
|
24169
|
+
declare function streamSpeech({ model, text, voice, outputFormat, instructions, speed, language, providerOptions, abortSignal, headers, includeRawChunks, onError, _internal: { currentDate } }: {
|
|
24170
|
+
/**
|
|
24171
|
+
* The speech model to use.
|
|
24172
|
+
*/
|
|
24173
|
+
model: SpeechModel;
|
|
24174
|
+
/**
|
|
24175
|
+
* The text to convert to speech: a complete string, or an array, iterable,
|
|
24176
|
+
* or stream of text deltas and/or text parts.
|
|
24177
|
+
*/
|
|
24178
|
+
text: string | Iterable<string | SpeechTextPart> | AsyncIterable<string | SpeechTextPart> | ReadableStream<string | SpeechTextPart>;
|
|
24179
|
+
/**
|
|
24180
|
+
* The voice to use for speech generation.
|
|
24181
|
+
*/
|
|
24182
|
+
voice?: string;
|
|
24183
|
+
/**
|
|
24184
|
+
* The desired format of the output audio chunks, e.g.
|
|
24185
|
+
* `{ type: 'audio/pcm', rate: 24000 }` or `{ type: 'audio/mpeg' }`.
|
|
24186
|
+
* Supported formats are provider-specific.
|
|
24187
|
+
*/
|
|
24188
|
+
outputFormat?: SharedV4AudioFormat;
|
|
24189
|
+
/**
|
|
24190
|
+
* Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
24191
|
+
*/
|
|
24192
|
+
instructions?: string;
|
|
24193
|
+
/**
|
|
24194
|
+
* The speed of the speech generation.
|
|
24195
|
+
*/
|
|
24196
|
+
speed?: number;
|
|
24197
|
+
/**
|
|
24198
|
+
* The language for speech generation. This should be an ISO 639-1 language code (e.g. "en", "es", "fr")
|
|
24199
|
+
* or "auto" for automatic language detection. Provider support varies.
|
|
24200
|
+
*/
|
|
24201
|
+
language?: string;
|
|
24202
|
+
/**
|
|
24203
|
+
* Additional provider-specific options.
|
|
24204
|
+
*/
|
|
24205
|
+
providerOptions?: ProviderOptions;
|
|
24206
|
+
/**
|
|
24207
|
+
* Abort signal.
|
|
24208
|
+
*/
|
|
24209
|
+
abortSignal?: AbortSignal;
|
|
24210
|
+
/**
|
|
24211
|
+
* Additional headers to include in the request, if supported by the provider.
|
|
24212
|
+
*/
|
|
24213
|
+
headers?: Record<string, string>;
|
|
24214
|
+
/**
|
|
24215
|
+
* When true, providers should include raw provider chunks in the stream.
|
|
24216
|
+
*/
|
|
24217
|
+
includeRawChunks?: boolean;
|
|
24218
|
+
/**
|
|
24219
|
+
* Called for each error part the provider reports. Error parts are not
|
|
24220
|
+
* fatal: `fullStream` includes them and `audioStream` skips them. The
|
|
24221
|
+
* callback is not awaited, and errors it throws are ignored.
|
|
24222
|
+
* Defaults to logging the error with `console.error`.
|
|
24223
|
+
*/
|
|
24224
|
+
onError?: (event: {
|
|
24225
|
+
error: unknown;
|
|
24226
|
+
}) => void | PromiseLike<void>;
|
|
24227
|
+
/**
|
|
24228
|
+
* Internal test hooks.
|
|
24229
|
+
*/
|
|
24230
|
+
_internal?: {
|
|
24231
|
+
currentDate?: () => Date;
|
|
24232
|
+
};
|
|
24233
|
+
}): StreamSpeechResult;
|
|
24234
|
+
//#endregion
|
|
23062
24235
|
//#region src/generate-speech/index.d.ts
|
|
23063
24236
|
/**
|
|
23064
24237
|
* @deprecated Use `generateSpeech` instead.
|
|
@@ -24762,14 +25935,10 @@ declare function uploadSkill({ api, files, displayTitle, providerOptions }: {
|
|
|
24762
25935
|
} & Omit<SkillsV4UploadSkillCallOptions, 'files'> & {
|
|
24763
25936
|
files: UploadSkillFile[];
|
|
24764
25937
|
}): Promise<UploadSkillResult>;
|
|
24765
|
-
//#endregion
|
|
24766
|
-
//#region src/opentelemetry-lib/instrumentation/aisdk/index.d.ts
|
|
24767
25938
|
export declare const wrapAISDK: (ai: typeof index_d_exports) => typeof index_d_exports;
|
|
24768
25939
|
export declare function wrapLanguageModel(languageModel: LanguageModelV4): LanguageModelV4;
|
|
24769
25940
|
export declare function wrapLanguageModel(languageModel: LanguageModelV3): LanguageModelV3;
|
|
24770
25941
|
export declare function wrapLanguageModel(languageModel: LanguageModelV2): LanguageModelV2;
|
|
24771
|
-
//#endregion
|
|
24772
|
-
//#region src/opentelemetry-lib/instrumentation/aisdk/v7-integration/index.d.ts
|
|
24773
25942
|
/**
|
|
24774
25943
|
* The AI SDK v7 diagnostics channel name. Every lifecycle event fires
|
|
24775
25944
|
* `{ type, event }` through this channel.
|
|
@@ -24812,7 +25981,6 @@ export declare class LaminarAiSdkTelemetry {
|
|
|
24812
25981
|
private readonly toolByCallId;
|
|
24813
25982
|
private readonly activeStreamStepByCallId;
|
|
24814
25983
|
private readonly promptByCallId;
|
|
24815
|
-
private readonly logger;
|
|
24816
25984
|
constructor(options?: LaminarAiSdkTelemetryOptions);
|
|
24817
25985
|
onStart: (event: any) => void;
|
|
24818
25986
|
onStepStart: (event: any) => void;
|
|
@@ -24912,8 +26080,6 @@ export declare const enableAiSdkTelemetryDebug: (log?: (entry: {
|
|
|
24912
26080
|
type: string;
|
|
24913
26081
|
event: unknown;
|
|
24914
26082
|
}) => void) => (() => void);
|
|
24915
|
-
//#endregion
|
|
24916
|
-
//#region src/opentelemetry-lib/instrumentation/claude-agent-sdk/index.d.ts
|
|
24917
26083
|
/**
|
|
24918
26084
|
* Create an instrumented version of the claude-agent-sdk query function.
|
|
24919
26085
|
* This can be used when importing the query function before Laminar initialization.
|
|
@@ -24922,8 +26088,6 @@ export declare const enableAiSdkTelemetryDebug: (log?: (entry: {
|
|
|
24922
26088
|
* @returns The instrumented query function
|
|
24923
26089
|
*/
|
|
24924
26090
|
export declare function instrumentClaudeAgentQuery(originalQuery: any): any;
|
|
24925
|
-
//#endregion
|
|
24926
|
-
//#region src/opentelemetry-lib/instrumentation/mastra/types.d.ts
|
|
24927
26091
|
interface MastraSpanErrorInfo {
|
|
24928
26092
|
message: string;
|
|
24929
26093
|
name?: string;
|
|
@@ -24971,8 +26135,6 @@ interface MastraExporterOptions {
|
|
|
24971
26135
|
*/
|
|
24972
26136
|
linkToActiveContext?: boolean;
|
|
24973
26137
|
}
|
|
24974
|
-
//#endregion
|
|
24975
|
-
//#region src/opentelemetry-lib/instrumentation/mastra/exporter.d.ts
|
|
24976
26138
|
/**
|
|
24977
26139
|
* Bridges Mastra's ObservabilityExporter contract to Laminar's OTLP ingestion.
|
|
24978
26140
|
*
|
|
@@ -25025,8 +26187,6 @@ export declare class MastraExporter {
|
|
|
25025
26187
|
private applyLlmAttributes;
|
|
25026
26188
|
private applyToolAttributes;
|
|
25027
26189
|
}
|
|
25028
|
-
//#endregion
|
|
25029
|
-
//#region src/opentelemetry-lib/instrumentation/temporal/interceptors.d.ts
|
|
25030
26190
|
/**
|
|
25031
26191
|
* Options for Laminar Temporal interceptors.
|
|
25032
26192
|
*/
|
|
@@ -25164,8 +26324,6 @@ declare class ActivityInboundInterceptor {
|
|
|
25164
26324
|
declare const ActivityInterceptorFactory: (options?: LaminarTemporalInterceptorOptions) => (ctx: any) => {
|
|
25165
26325
|
inbound: ActivityInboundInterceptor;
|
|
25166
26326
|
};
|
|
25167
|
-
//#endregion
|
|
25168
|
-
//#region src/opentelemetry-lib/instrumentation/temporal/index.d.ts
|
|
25169
26327
|
/** Namespace export: `LaminarTemporalInterceptors.WorkflowClientInterceptor`. */
|
|
25170
26328
|
export declare const LaminarTemporalInterceptors: {
|
|
25171
26329
|
WorkflowClientInterceptor: typeof WorkflowClientInterceptor;
|
|
@@ -25185,8 +26343,6 @@ export declare const LaminarTemporalInterceptors: {
|
|
|
25185
26343
|
};
|
|
25186
26344
|
};
|
|
25187
26345
|
};
|
|
25188
|
-
//#endregion
|
|
25189
|
-
//#region src/opentelemetry-lib/instrumentation/temporal/consts.d.ts
|
|
25190
26346
|
/** Header key used to carry the serialized Laminar span context through Temporal. */
|
|
25191
26347
|
declare const LAMINAR_SPAN_CONTEXT_HEADER = "x-lmnr-span-context";
|
|
25192
26348
|
/**
|
|
@@ -25194,8 +26350,6 @@ declare const LAMINAR_SPAN_CONTEXT_HEADER = "x-lmnr-span-context";
|
|
|
25194
26350
|
* interop with non-Laminar clients/workers that understand W3C trace context.
|
|
25195
26351
|
*/
|
|
25196
26352
|
declare const TRACEPARENT_HEADER = "traceparent";
|
|
25197
|
-
//#endregion
|
|
25198
|
-
//#region src/opentelemetry-lib/tracing/index.d.ts
|
|
25199
26353
|
/**
|
|
25200
26354
|
* Get the tracer provider. Returns Laminar's tracer provider if Laminar is initialized,
|
|
25201
26355
|
* otherwise returns the global tracer provider.
|
|
@@ -25227,8 +26381,6 @@ export declare const getTracerProvider: () => TracerProvider;
|
|
|
25227
26381
|
* })
|
|
25228
26382
|
*/
|
|
25229
26383
|
export declare const getTracer: () => Tracer;
|
|
25230
|
-
//#endregion
|
|
25231
|
-
//#region src/opentelemetry-lib/tracing/instrumentations.d.ts
|
|
25232
26384
|
/**
|
|
25233
26385
|
* Initialize and return Laminar instrumentations.
|
|
25234
26386
|
* Useful to use with libraries that initialize tracing and can register passed
|
|
@@ -25256,11 +26408,11 @@ export declare const getTracer: () => Tracer;
|
|
|
25256
26408
|
export declare const initializeLaminarInstrumentations: (options?: {
|
|
25257
26409
|
baseUrl?: string;
|
|
25258
26410
|
apiKey?: string;
|
|
26411
|
+
exportSpans?: boolean;
|
|
25259
26412
|
httpPort?: number;
|
|
25260
26413
|
suppressContentTracing?: boolean;
|
|
25261
26414
|
instrumentModules?: InitializeOptions["instrumentModules"];
|
|
25262
26415
|
sessionRecordingOptions?: SessionRecordingOptions;
|
|
25263
26416
|
}) => Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>[];
|
|
25264
|
-
//#endregion
|
|
25265
26417
|
export { type Datapoint, EvaluationDataset as Dataset, type Dataset as DatasetType, type EvalReporter, type EvaluationDatapoint, type EvaluationDatapointDatasetLink, type EvaluatorFunction, type EvaluatorFunctionReturn, type EveAssertionResult, type EveAssertionSeverity, type EveEval, type EveEvalDerivedFacts, type EveEvalResult, type EveEvalRunSummary, type EveEvalTarget, type EveEvalTaskResult, type EveEvalToolCall, type EveEvalVerdict, type EveRuntimeIdentity, type Event, HumanEvaluator, LAMINAR_SPAN_CONTEXT_HEADER as LAMINAR_TEMPORAL_SPAN_CONTEXT_HEADER, TRACEPARENT_HEADER as LAMINAR_TEMPORAL_TRACEPARENT_HEADER, type LaminarAiSdkTelemetryOptions, LaminarClient, LaminarDataset, type LaminarInitializeProps, type LaminarReporterOptions, type LaminarSpanContext, ActivityClientInterceptor as LaminarTemporalActivityClientInterceptor, ActivityInterceptorFactory as LaminarTemporalActivityInterceptorFactory, ScheduleClientInterceptor as LaminarTemporalScheduleClientInterceptor, WorkflowClientInterceptor as LaminarTemporalWorkflowClientInterceptor, type MaskInputOptions, type MastraExporterOptions, type PushDatapointsResponse, type SessionRecordingOptions, type Span, TracingLevel, evaluate };
|
|
25266
26418
|
//# sourceMappingURL=index.d.mts.map
|