ai 7.0.0-beta.93 → 7.0.0-beta.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +6 -52
- package/dist/index.js +24 -57
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +5 -39
- package/dist/internal/index.js +1 -1
- package/docs/03-agents/02-building-agents.mdx +2 -2
- package/docs/03-ai-sdk-core/05-generating-text.mdx +2 -2
- package/docs/03-ai-sdk-core/60-telemetry.mdx +7 -7
- package/docs/03-ai-sdk-core/65-event-listeners.mdx +0 -50
- package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +0 -42
- package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +0 -27
- package/docs/07-reference/01-ai-sdk-core/05-embed.mdx +0 -17
- package/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +0 -17
- package/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +0 -7
- package/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +1 -21
- package/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +29 -4
- package/docs/08-migration-guides/23-migration-guide-7-0.mdx +22 -0
- package/package.json +1 -1
- package/src/embed/embed-events.ts +0 -10
- package/src/embed/embed-many.ts +0 -5
- package/src/embed/embed.ts +0 -3
- package/src/generate-object/generate-object.ts +0 -4
- package/src/generate-object/stream-object.ts +0 -8
- package/src/generate-object/structured-output-events.ts +1 -13
- package/src/generate-text/core-events.ts +4 -20
- package/src/generate-text/execute-tool-call.ts +0 -1
- package/src/generate-text/generate-text.ts +1 -13
- package/src/generate-text/step-result.ts +0 -9
- package/src/generate-text/stream-text.ts +1 -10
- package/src/rerank/rerank-events.ts +1 -10
- package/src/rerank/rerank.ts +0 -5
- package/src/telemetry/telemetry-settings.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.0-beta.95
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c4f4b5f: refactoring(ai): remove deprecated experimental_activeTools option
|
|
8
|
+
|
|
9
|
+
## 7.0.0-beta.94
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1582efa: chore(ai): remove the metadata field from the telemetry settings
|
|
14
|
+
|
|
3
15
|
## 7.0.0-beta.93
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -840,8 +840,6 @@ interface EmbedOnStartEvent {
|
|
|
840
840
|
readonly recordOutputs: boolean | undefined;
|
|
841
841
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
842
842
|
readonly functionId: string | undefined;
|
|
843
|
-
/** Additional metadata from telemetry settings. */
|
|
844
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
845
843
|
}
|
|
846
844
|
/**
|
|
847
845
|
* Event passed to the `onFinish` callback for embed and embedMany operations.
|
|
@@ -883,8 +881,6 @@ interface EmbedOnFinishEvent {
|
|
|
883
881
|
readonly recordOutputs: boolean | undefined;
|
|
884
882
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
885
883
|
readonly functionId: string | undefined;
|
|
886
|
-
/** Additional metadata from telemetry settings. */
|
|
887
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
888
884
|
}
|
|
889
885
|
/**
|
|
890
886
|
* Event fired when an individual embedding model call (inner operation doEmbed) begins.
|
|
@@ -913,8 +909,6 @@ interface EmbedStartEvent {
|
|
|
913
909
|
readonly recordOutputs: boolean | undefined;
|
|
914
910
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
915
911
|
readonly functionId: string | undefined;
|
|
916
|
-
/** Additional metadata from telemetry settings. */
|
|
917
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
918
912
|
}
|
|
919
913
|
/**
|
|
920
914
|
* Event fired when an individual embedding model call (doEmbed) completes.
|
|
@@ -999,8 +993,6 @@ interface ObjectOnStartEvent {
|
|
|
999
993
|
readonly recordOutputs: boolean | undefined;
|
|
1000
994
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
1001
995
|
readonly functionId: string | undefined;
|
|
1002
|
-
/** Additional metadata from telemetry settings. */
|
|
1003
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
1004
996
|
}
|
|
1005
997
|
/**
|
|
1006
998
|
* Event passed to the `experimental_onStepStart` callback of
|
|
@@ -1026,8 +1018,6 @@ interface ObjectOnStepStartEvent {
|
|
|
1026
1018
|
readonly headers: Record<string, string | undefined> | undefined;
|
|
1027
1019
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
1028
1020
|
readonly functionId: string | undefined;
|
|
1029
|
-
/** Additional metadata from telemetry settings. */
|
|
1030
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
1031
1021
|
/** The prompt messages in provider format (for telemetry). */
|
|
1032
1022
|
readonly promptMessages?: LanguageModelV4Prompt;
|
|
1033
1023
|
}
|
|
@@ -1069,8 +1059,6 @@ interface ObjectOnStepFinishEvent {
|
|
|
1069
1059
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
1070
1060
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
1071
1061
|
readonly functionId: string | undefined;
|
|
1072
|
-
/** Additional metadata from telemetry settings. */
|
|
1073
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
1074
1062
|
/** Milliseconds from the start of the stream to the first chunk (streaming only). */
|
|
1075
1063
|
readonly msToFirstChunk: number | undefined;
|
|
1076
1064
|
}
|
|
@@ -1116,8 +1104,6 @@ interface ObjectOnFinishEvent<RESULT> {
|
|
|
1116
1104
|
readonly providerMetadata: ProviderMetadata | undefined;
|
|
1117
1105
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
1118
1106
|
readonly functionId: string | undefined;
|
|
1119
|
-
/** Additional metadata from telemetry settings. */
|
|
1120
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
1121
1107
|
}
|
|
1122
1108
|
|
|
1123
1109
|
/**
|
|
@@ -1151,10 +1137,6 @@ type StepResult<TOOLS extends ToolSet, USER_CONTEXT extends Context = Context> =
|
|
|
1151
1137
|
* Identifier from telemetry settings for grouping related operations.
|
|
1152
1138
|
*/
|
|
1153
1139
|
readonly functionId: string | undefined;
|
|
1154
|
-
/**
|
|
1155
|
-
* Additional metadata from telemetry settings.
|
|
1156
|
-
*/
|
|
1157
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
1158
1140
|
/**
|
|
1159
1141
|
* User-defined context object flowing through the generation.
|
|
1160
1142
|
*
|
|
@@ -2540,13 +2522,11 @@ interface OnStartEvent<TOOLS extends ToolSet = ToolSet, USER_CONTEXT extends Con
|
|
|
2540
2522
|
readonly recordOutputs: boolean | undefined;
|
|
2541
2523
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2542
2524
|
readonly functionId: string | undefined;
|
|
2543
|
-
/** Additional metadata from telemetry settings. */
|
|
2544
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
2545
2525
|
/**
|
|
2546
2526
|
* User-defined context object that flows through the entire generation lifecycle.
|
|
2547
2527
|
* Can be accessed and modified in `prepareStep` and tool `execute` functions.
|
|
2548
2528
|
*/
|
|
2549
|
-
readonly context:
|
|
2529
|
+
readonly context: InferToolSetContext<TOOLS> & USER_CONTEXT;
|
|
2550
2530
|
}
|
|
2551
2531
|
/**
|
|
2552
2532
|
* Event passed to the `onStepStart` callback.
|
|
@@ -2599,12 +2579,10 @@ interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, USER_CONTEXT extends
|
|
|
2599
2579
|
readonly output: OUTPUT | undefined;
|
|
2600
2580
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2601
2581
|
readonly functionId: string | undefined;
|
|
2602
|
-
/** Additional metadata from telemetry settings. */
|
|
2603
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
2604
2582
|
/**
|
|
2605
2583
|
* User-defined context object. May be updated from `prepareStep` between steps.
|
|
2606
2584
|
*/
|
|
2607
|
-
readonly context:
|
|
2585
|
+
readonly context: InferToolSetContext<TOOLS> & USER_CONTEXT;
|
|
2608
2586
|
}
|
|
2609
2587
|
/**
|
|
2610
2588
|
* Event passed to the `onToolCallStart` callback.
|
|
@@ -2626,10 +2604,8 @@ interface OnToolCallStartEvent<TOOLS extends ToolSet = ToolSet> {
|
|
|
2626
2604
|
readonly messages: Array<ModelMessage>;
|
|
2627
2605
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2628
2606
|
readonly functionId: string | undefined;
|
|
2629
|
-
/** Additional metadata from telemetry settings. */
|
|
2630
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
2631
2607
|
/** User-defined context object flowing through the generation. */
|
|
2632
|
-
readonly context:
|
|
2608
|
+
readonly context: InferToolSetContext<TOOLS>;
|
|
2633
2609
|
}
|
|
2634
2610
|
/**
|
|
2635
2611
|
* Event passed to the `onToolCallFinish` callback.
|
|
@@ -2654,10 +2630,8 @@ type OnToolCallFinishEvent<TOOLS extends ToolSet = ToolSet> = {
|
|
|
2654
2630
|
readonly durationMs: number;
|
|
2655
2631
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2656
2632
|
readonly functionId: string | undefined;
|
|
2657
|
-
/** Additional metadata from telemetry settings. */
|
|
2658
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
2659
2633
|
/** User-defined context object flowing through the generation. */
|
|
2660
|
-
readonly context:
|
|
2634
|
+
readonly context: InferToolSetContext<TOOLS>;
|
|
2661
2635
|
} & ({
|
|
2662
2636
|
/** Indicates the tool call succeeded. */
|
|
2663
2637
|
readonly success: true;
|
|
@@ -2714,8 +2688,6 @@ type OnFinishEvent<TOOLS extends ToolSet = ToolSet, USER_CONTEXT extends Context
|
|
|
2714
2688
|
context: InferToolSetContext<TOOLS> & USER_CONTEXT;
|
|
2715
2689
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2716
2690
|
readonly functionId: string | undefined;
|
|
2717
|
-
/** Additional metadata from telemetry settings. */
|
|
2718
|
-
readonly metadata: Record<string, unknown> | undefined;
|
|
2719
2691
|
};
|
|
2720
2692
|
|
|
2721
2693
|
/**
|
|
@@ -2751,8 +2723,6 @@ interface RerankOnStartEvent {
|
|
|
2751
2723
|
readonly recordOutputs: boolean | undefined;
|
|
2752
2724
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2753
2725
|
readonly functionId: string | undefined;
|
|
2754
|
-
/** Additional metadata from telemetry settings. */
|
|
2755
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
2756
2726
|
}
|
|
2757
2727
|
/**
|
|
2758
2728
|
* Event passed to the `onFinish` callback for rerank operations.
|
|
@@ -2797,8 +2767,6 @@ interface RerankOnFinishEvent {
|
|
|
2797
2767
|
readonly recordOutputs: boolean | undefined;
|
|
2798
2768
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2799
2769
|
readonly functionId: string | undefined;
|
|
2800
|
-
/** Additional metadata from telemetry settings. */
|
|
2801
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
2802
2770
|
}
|
|
2803
2771
|
/**
|
|
2804
2772
|
* Event fired when an individual reranking model call (inner doRerank) begins.
|
|
@@ -2828,8 +2796,6 @@ interface RerankStartEvent {
|
|
|
2828
2796
|
readonly recordOutputs: boolean | undefined;
|
|
2829
2797
|
/** Identifier from telemetry settings for grouping related operations. */
|
|
2830
2798
|
readonly functionId: string | undefined;
|
|
2831
|
-
/** Additional metadata from telemetry settings. */
|
|
2832
|
-
readonly metadata: Record<string, JSONValue$1> | undefined;
|
|
2833
2799
|
}
|
|
2834
2800
|
/**
|
|
2835
2801
|
* Event fired when an individual reranking model call (doRerank) completes.
|
|
@@ -3000,10 +2966,6 @@ type TelemetrySettings = {
|
|
|
3000
2966
|
* Identifier for this function. Used to group telemetry data by function.
|
|
3001
2967
|
*/
|
|
3002
2968
|
functionId?: string;
|
|
3003
|
-
/**
|
|
3004
|
-
* Additional information to include in the telemetry data.
|
|
3005
|
-
*/
|
|
3006
|
-
metadata?: Record<string, JSONValue$1>;
|
|
3007
2969
|
/**
|
|
3008
2970
|
* Per-call telemetry integrations that receive lifecycle events during generation.
|
|
3009
2971
|
*
|
|
@@ -3340,7 +3302,7 @@ type StreamTextOnToolCallFinishCallback<TOOLS extends ToolSet = ToolSet> = Callb
|
|
|
3340
3302
|
* @returns
|
|
3341
3303
|
* A result object for accessing different stream types and additional information.
|
|
3342
3304
|
*/
|
|
3343
|
-
declare function streamText<TOOLS extends ToolSet, USER_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions,
|
|
3305
|
+
declare function streamText<TOOLS extends ToolSet, USER_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, context: contextArg, experimental_include: include, _internal: { now, generateId, generateCallId, }, ...settings }: LanguageModelCallOptions & RequestOptions<TOOLS> & Prompt & ContextParameter<TOOLS, USER_CONTEXT> & {
|
|
3344
3306
|
/**
|
|
3345
3307
|
* The language model to use.
|
|
3346
3308
|
*/
|
|
@@ -3366,10 +3328,6 @@ declare function streamText<TOOLS extends ToolSet, USER_CONTEXT extends Context
|
|
|
3366
3328
|
* functionality that can be fully encapsulated in the provider.
|
|
3367
3329
|
*/
|
|
3368
3330
|
providerOptions?: ProviderOptions;
|
|
3369
|
-
/**
|
|
3370
|
-
* @deprecated Use `activeTools` instead.
|
|
3371
|
-
*/
|
|
3372
|
-
experimental_activeTools?: Array<keyof NoInfer<TOOLS>>;
|
|
3373
3331
|
/**
|
|
3374
3332
|
* Limits the tools that are available for the model to call without
|
|
3375
3333
|
* changing the tool call and result types in the result.
|
|
@@ -4151,7 +4109,7 @@ type GenerateTextOnFinishCallback<TOOLS extends ToolSet = ToolSet, USER_CONTEXT
|
|
|
4151
4109
|
* @returns
|
|
4152
4110
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
4153
4111
|
*/
|
|
4154
|
-
declare function generateText<TOOLS extends ToolSet, USER_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions,
|
|
4112
|
+
declare function generateText<TOOLS extends ToolSet, USER_CONTEXT extends Context = Context, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, context: contextArg, experimental_include: include, _internal: { generateId, generateCallId, }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: LanguageModelCallOptions & RequestOptions<TOOLS> & Prompt & ContextParameter<TOOLS, USER_CONTEXT> & {
|
|
4155
4113
|
/**
|
|
4156
4114
|
* The language model to use.
|
|
4157
4115
|
*/
|
|
@@ -4177,10 +4135,6 @@ declare function generateText<TOOLS extends ToolSet, USER_CONTEXT extends Contex
|
|
|
4177
4135
|
* functionality that can be fully encapsulated in the provider.
|
|
4178
4136
|
*/
|
|
4179
4137
|
providerOptions?: ProviderOptions;
|
|
4180
|
-
/**
|
|
4181
|
-
* @deprecated Use `activeTools` instead.
|
|
4182
|
-
*/
|
|
4183
|
-
experimental_activeTools?: Array<keyof NoInfer<TOOLS>>;
|
|
4184
4138
|
/**
|
|
4185
4139
|
* Limits the tools that are available for the model to call without
|
|
4186
4140
|
* changing the tool call and result types in the result.
|
package/dist/index.js
CHANGED
|
@@ -1380,7 +1380,7 @@ import {
|
|
|
1380
1380
|
} from "@ai-sdk/provider-utils";
|
|
1381
1381
|
|
|
1382
1382
|
// src/version.ts
|
|
1383
|
-
var VERSION = true ? "7.0.0-beta.
|
|
1383
|
+
var VERSION = true ? "7.0.0-beta.95" : "0.0.0-test";
|
|
1384
1384
|
|
|
1385
1385
|
// src/util/download/download.ts
|
|
1386
1386
|
var download = async ({
|
|
@@ -2922,7 +2922,6 @@ async function executeToolCall({
|
|
|
2922
2922
|
toolCall,
|
|
2923
2923
|
messages,
|
|
2924
2924
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
2925
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
2926
2925
|
context
|
|
2927
2926
|
};
|
|
2928
2927
|
let output;
|
|
@@ -3927,7 +3926,6 @@ var DefaultStepResult = class {
|
|
|
3927
3926
|
provider,
|
|
3928
3927
|
modelId,
|
|
3929
3928
|
functionId,
|
|
3930
|
-
metadata,
|
|
3931
3929
|
context,
|
|
3932
3930
|
content,
|
|
3933
3931
|
finishReason,
|
|
@@ -3942,7 +3940,6 @@ var DefaultStepResult = class {
|
|
|
3942
3940
|
this.stepNumber = stepNumber;
|
|
3943
3941
|
this.model = { provider, modelId };
|
|
3944
3942
|
this.functionId = functionId;
|
|
3945
|
-
this.metadata = metadata;
|
|
3946
3943
|
this.context = context;
|
|
3947
3944
|
this.content = content;
|
|
3948
3945
|
this.finishReason = finishReason;
|
|
@@ -4190,8 +4187,7 @@ async function generateText({
|
|
|
4190
4187
|
output = experimental_output,
|
|
4191
4188
|
experimental_telemetry: telemetry,
|
|
4192
4189
|
providerOptions,
|
|
4193
|
-
|
|
4194
|
-
activeTools = experimental_activeTools,
|
|
4190
|
+
activeTools,
|
|
4195
4191
|
experimental_prepareStep,
|
|
4196
4192
|
prepareStep = experimental_prepareStep,
|
|
4197
4193
|
experimental_repairToolCall: repairToolCall,
|
|
@@ -4271,7 +4267,6 @@ async function generateText({
|
|
|
4271
4267
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
4272
4268
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
4273
4269
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4274
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4275
4270
|
context
|
|
4276
4271
|
},
|
|
4277
4272
|
callbacks: [
|
|
@@ -4420,7 +4415,6 @@ async function generateText({
|
|
|
4420
4415
|
stopWhen,
|
|
4421
4416
|
output,
|
|
4422
4417
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4423
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4424
4418
|
context,
|
|
4425
4419
|
promptMessages,
|
|
4426
4420
|
stepTools,
|
|
@@ -4597,7 +4591,6 @@ async function generateText({
|
|
|
4597
4591
|
provider: stepModel.provider,
|
|
4598
4592
|
modelId: stepModel.modelId,
|
|
4599
4593
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
4600
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
4601
4594
|
context,
|
|
4602
4595
|
content: stepContent,
|
|
4603
4596
|
finishReason: currentModelResponse.finishReason.unified,
|
|
@@ -4651,7 +4644,6 @@ async function generateText({
|
|
|
4651
4644
|
stepNumber: lastStep.stepNumber,
|
|
4652
4645
|
model: lastStep.model,
|
|
4653
4646
|
functionId: lastStep.functionId,
|
|
4654
|
-
metadata: lastStep.metadata,
|
|
4655
4647
|
context: lastStep.context,
|
|
4656
4648
|
finishReason: lastStep.finishReason,
|
|
4657
4649
|
rawFinishReason: lastStep.rawFinishReason,
|
|
@@ -6576,8 +6568,7 @@ function streamText({
|
|
|
6576
6568
|
experimental_telemetry: telemetry,
|
|
6577
6569
|
prepareStep,
|
|
6578
6570
|
providerOptions,
|
|
6579
|
-
|
|
6580
|
-
activeTools = experimental_activeTools,
|
|
6571
|
+
activeTools,
|
|
6581
6572
|
experimental_repairToolCall: repairToolCall,
|
|
6582
6573
|
experimental_transform: transform,
|
|
6583
6574
|
experimental_download: download2,
|
|
@@ -6970,7 +6961,6 @@ var DefaultStreamTextResult = class {
|
|
|
6970
6961
|
stepNumber: finalStep.stepNumber,
|
|
6971
6962
|
model: finalStep.model,
|
|
6972
6963
|
functionId: finalStep.functionId,
|
|
6973
|
-
metadata: finalStep.metadata,
|
|
6974
6964
|
context: finalStep.context,
|
|
6975
6965
|
finishReason: finalStep.finishReason,
|
|
6976
6966
|
rawFinishReason: finalStep.rawFinishReason,
|
|
@@ -7077,15 +7067,13 @@ var DefaultStreamTextResult = class {
|
|
|
7077
7067
|
const self = this;
|
|
7078
7068
|
const callId = generateCallId();
|
|
7079
7069
|
const callbackTelemetryProps = {
|
|
7080
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
7081
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
7070
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
7082
7071
|
};
|
|
7083
7072
|
const onStartTelemetryProps = {
|
|
7084
7073
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
7085
7074
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
7086
7075
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
7087
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
7088
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
7076
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
7089
7077
|
};
|
|
7090
7078
|
(async () => {
|
|
7091
7079
|
const initialPrompt = await standardizePrompt({
|
|
@@ -9221,8 +9209,7 @@ async function embed({
|
|
|
9221
9209
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9222
9210
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9223
9211
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9224
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9225
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9212
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9226
9213
|
},
|
|
9227
9214
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
9228
9215
|
});
|
|
@@ -9241,8 +9228,7 @@ async function embed({
|
|
|
9241
9228
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9242
9229
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9243
9230
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9244
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9245
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9231
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9246
9232
|
},
|
|
9247
9233
|
callbacks: [unifiedTelemetry.onEmbedStart]
|
|
9248
9234
|
});
|
|
@@ -9291,8 +9277,7 @@ async function embed({
|
|
|
9291
9277
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9292
9278
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9293
9279
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9294
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9295
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9280
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9296
9281
|
},
|
|
9297
9282
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
9298
9283
|
});
|
|
@@ -9383,8 +9368,7 @@ async function embedMany({
|
|
|
9383
9368
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9384
9369
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9385
9370
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9386
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9387
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9371
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9388
9372
|
},
|
|
9389
9373
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
9390
9374
|
});
|
|
@@ -9408,8 +9392,7 @@ async function embedMany({
|
|
|
9408
9392
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9409
9393
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9410
9394
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9411
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9412
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9395
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9413
9396
|
},
|
|
9414
9397
|
callbacks: [unifiedTelemetry.onEmbedStart]
|
|
9415
9398
|
});
|
|
@@ -9462,8 +9445,7 @@ async function embedMany({
|
|
|
9462
9445
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9463
9446
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9464
9447
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9465
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9466
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9448
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9467
9449
|
},
|
|
9468
9450
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
9469
9451
|
});
|
|
@@ -9503,8 +9485,7 @@ async function embedMany({
|
|
|
9503
9485
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9504
9486
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9505
9487
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9506
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9507
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9488
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9508
9489
|
},
|
|
9509
9490
|
callbacks: [unifiedTelemetry.onEmbedStart]
|
|
9510
9491
|
});
|
|
@@ -9580,8 +9561,7 @@ async function embedMany({
|
|
|
9580
9561
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
9581
9562
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
9582
9563
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
9583
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9584
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
9564
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
9585
9565
|
},
|
|
9586
9566
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
9587
9567
|
});
|
|
@@ -10351,8 +10331,7 @@ async function generateObject(options) {
|
|
|
10351
10331
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
10352
10332
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
10353
10333
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
10354
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10355
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
10334
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10356
10335
|
},
|
|
10357
10336
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
10358
10337
|
});
|
|
@@ -10377,7 +10356,6 @@ async function generateObject(options) {
|
|
|
10377
10356
|
providerOptions,
|
|
10378
10357
|
headers: headersWithUserAgent,
|
|
10379
10358
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
10380
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
10381
10359
|
promptMessages
|
|
10382
10360
|
},
|
|
10383
10361
|
callbacks: [onStepStart, unifiedTelemetry.onObjectStepStart]
|
|
@@ -10439,8 +10417,7 @@ async function generateObject(options) {
|
|
|
10439
10417
|
request,
|
|
10440
10418
|
response,
|
|
10441
10419
|
providerMetadata: resultProviderMetadata,
|
|
10442
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10443
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
10420
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10444
10421
|
};
|
|
10445
10422
|
await notify({
|
|
10446
10423
|
event: stepFinishEvent,
|
|
@@ -10468,8 +10445,7 @@ async function generateObject(options) {
|
|
|
10468
10445
|
request,
|
|
10469
10446
|
response,
|
|
10470
10447
|
providerMetadata: resultProviderMetadata,
|
|
10471
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10472
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
10448
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10473
10449
|
},
|
|
10474
10450
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
10475
10451
|
});
|
|
@@ -10807,8 +10783,7 @@ var DefaultStreamObjectResult = class {
|
|
|
10807
10783
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
10808
10784
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
10809
10785
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
10810
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10811
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
10786
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
10812
10787
|
},
|
|
10813
10788
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
10814
10789
|
});
|
|
@@ -10845,7 +10820,6 @@ var DefaultStreamObjectResult = class {
|
|
|
10845
10820
|
providerOptions,
|
|
10846
10821
|
headers,
|
|
10847
10822
|
functionId: telemetry == null ? void 0 : telemetry.functionId,
|
|
10848
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata,
|
|
10849
10823
|
promptMessages: callOptions.prompt
|
|
10850
10824
|
},
|
|
10851
10825
|
callbacks: [onStepStart, unifiedTelemetry.onObjectStepStart]
|
|
@@ -11016,8 +10990,7 @@ var DefaultStreamObjectResult = class {
|
|
|
11016
10990
|
headers: response == null ? void 0 : response.headers
|
|
11017
10991
|
},
|
|
11018
10992
|
providerMetadata,
|
|
11019
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
11020
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
10993
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
11021
10994
|
},
|
|
11022
10995
|
callbacks: [
|
|
11023
10996
|
onStepFinish,
|
|
@@ -11039,8 +11012,7 @@ var DefaultStreamObjectResult = class {
|
|
|
11039
11012
|
headers: response == null ? void 0 : response.headers
|
|
11040
11013
|
},
|
|
11041
11014
|
providerMetadata,
|
|
11042
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
11043
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
11015
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
11044
11016
|
},
|
|
11045
11017
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
11046
11018
|
});
|
|
@@ -12607,8 +12579,7 @@ async function rerank({
|
|
|
12607
12579
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
12608
12580
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
12609
12581
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
12610
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12611
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
12582
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12612
12583
|
},
|
|
12613
12584
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
12614
12585
|
});
|
|
@@ -12630,8 +12601,7 @@ async function rerank({
|
|
|
12630
12601
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
12631
12602
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
12632
12603
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
12633
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12634
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
12604
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12635
12605
|
},
|
|
12636
12606
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
12637
12607
|
});
|
|
@@ -12665,8 +12635,7 @@ async function rerank({
|
|
|
12665
12635
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
12666
12636
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
12667
12637
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
12668
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12669
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
12638
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12670
12639
|
},
|
|
12671
12640
|
callbacks: [onStart, unifiedTelemetry.onStart]
|
|
12672
12641
|
});
|
|
@@ -12686,8 +12655,7 @@ async function rerank({
|
|
|
12686
12655
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
12687
12656
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
12688
12657
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
12689
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12690
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
12658
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12691
12659
|
},
|
|
12692
12660
|
callbacks: [unifiedTelemetry.onRerankStart]
|
|
12693
12661
|
});
|
|
@@ -12749,8 +12717,7 @@ async function rerank({
|
|
|
12749
12717
|
isEnabled: telemetry == null ? void 0 : telemetry.isEnabled,
|
|
12750
12718
|
recordInputs: telemetry == null ? void 0 : telemetry.recordInputs,
|
|
12751
12719
|
recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs,
|
|
12752
|
-
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12753
|
-
metadata: telemetry == null ? void 0 : telemetry.metadata
|
|
12720
|
+
functionId: telemetry == null ? void 0 : telemetry.functionId
|
|
12754
12721
|
},
|
|
12755
12722
|
callbacks: [onFinish, unifiedTelemetry.onFinish]
|
|
12756
12723
|
});
|