ai 3.4.11 → 3.4.12
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 +6 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -3278,7 +3278,8 @@ async function generateText({
|
|
3278
3278
|
toolCalls: currentToolCalls,
|
3279
3279
|
tools,
|
3280
3280
|
tracer,
|
3281
|
-
telemetry
|
3281
|
+
telemetry,
|
3282
|
+
abortSignal
|
3282
3283
|
});
|
3283
3284
|
const currentUsage = calculateLanguageModelUsage(
|
3284
3285
|
currentModelResponse.usage
|
@@ -3408,7 +3409,8 @@ async function executeTools({
|
|
3408
3409
|
toolCalls,
|
3409
3410
|
tools,
|
3410
3411
|
tracer,
|
3411
|
-
telemetry
|
3412
|
+
telemetry,
|
3413
|
+
abortSignal
|
3412
3414
|
}) {
|
3413
3415
|
const toolResults = await Promise.all(
|
3414
3416
|
toolCalls.map(async (toolCall) => {
|
@@ -3434,7 +3436,7 @@ async function executeTools({
|
|
3434
3436
|
}),
|
3435
3437
|
tracer,
|
3436
3438
|
fn: async (span) => {
|
3437
|
-
const result2 = await tool2.execute(toolCall.args);
|
3439
|
+
const result2 = await tool2.execute(toolCall.args, { abortSignal });
|
3438
3440
|
try {
|
3439
3441
|
span.setAttributes(
|
3440
3442
|
selectTelemetryAttributes({
|
@@ -3644,7 +3646,8 @@ function runToolsTransformation({
|
|
3644
3646
|
generatorStream,
|
3645
3647
|
toolCallStreaming,
|
3646
3648
|
tracer,
|
3647
|
-
telemetry
|
3649
|
+
telemetry,
|
3650
|
+
abortSignal
|
3648
3651
|
}) {
|
3649
3652
|
let canClose = false;
|
3650
3653
|
const outstandingToolCalls = /* @__PURE__ */ new Set();
|
@@ -3730,7 +3733,7 @@ function runToolsTransformation({
|
|
3730
3733
|
}
|
3731
3734
|
}),
|
3732
3735
|
tracer,
|
3733
|
-
fn: async (span) => tool2.execute(toolCall.args).then(
|
3736
|
+
fn: async (span) => tool2.execute(toolCall.args, { abortSignal }).then(
|
3734
3737
|
(result) => {
|
3735
3738
|
toolResultsStreamController.enqueue({
|
3736
3739
|
...toolCall,
|
@@ -3951,7 +3954,8 @@ async function streamText({
|
|
3951
3954
|
generatorStream: stream2,
|
3952
3955
|
toolCallStreaming,
|
3953
3956
|
tracer,
|
3954
|
-
telemetry
|
3957
|
+
telemetry,
|
3958
|
+
abortSignal
|
3955
3959
|
}),
|
3956
3960
|
warnings: warnings2,
|
3957
3961
|
rawResponse: rawResponse2
|