ai 5.0.0-beta.30 → 5.0.0-beta.31
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 +13 -0
- package/dist/bin/ai.min.js +18 -18
- package/dist/index.d.mts +100 -37
- package/dist/index.d.ts +100 -37
- package/dist/index.js +64 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -112,7 +112,8 @@ __export(src_exports, {
|
|
112
112
|
toolModelMessageSchema: () => toolModelMessageSchema,
|
113
113
|
userModelMessageSchema: () => userModelMessageSchema,
|
114
114
|
wrapLanguageModel: () => wrapLanguageModel,
|
115
|
-
wrapProvider: () => wrapProvider
|
115
|
+
wrapProvider: () => wrapProvider,
|
116
|
+
zodSchema: () => import_provider_utils27.zodSchema
|
116
117
|
});
|
117
118
|
module.exports = __toCommonJS(src_exports);
|
118
119
|
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
@@ -414,6 +415,11 @@ var audioMediaTypeSignatures = [
|
|
414
415
|
mediaType: "audio/mp4",
|
415
416
|
bytesPrefix: [102, 116, 121, 112],
|
416
417
|
base64Prefix: "ZnR5cA"
|
418
|
+
},
|
419
|
+
{
|
420
|
+
mediaType: "audio/webm",
|
421
|
+
bytesPrefix: [26, 69, 223, 163],
|
422
|
+
base64Prefix: "GkXf"
|
417
423
|
}
|
418
424
|
];
|
419
425
|
var stripID3 = (data) => {
|
@@ -1835,9 +1841,29 @@ var DefaultStepResult = class {
|
|
1835
1841
|
get toolCalls() {
|
1836
1842
|
return this.content.filter((part) => part.type === "tool-call");
|
1837
1843
|
}
|
1844
|
+
get staticToolCalls() {
|
1845
|
+
return this.toolCalls.filter(
|
1846
|
+
(toolCall) => toolCall.dynamic === false
|
1847
|
+
);
|
1848
|
+
}
|
1849
|
+
get dynamicToolCalls() {
|
1850
|
+
return this.toolCalls.filter(
|
1851
|
+
(toolCall) => toolCall.dynamic === true
|
1852
|
+
);
|
1853
|
+
}
|
1838
1854
|
get toolResults() {
|
1839
1855
|
return this.content.filter((part) => part.type === "tool-result");
|
1840
1856
|
}
|
1857
|
+
get staticToolResults() {
|
1858
|
+
return this.toolResults.filter(
|
1859
|
+
(toolResult) => toolResult.dynamic === false
|
1860
|
+
);
|
1861
|
+
}
|
1862
|
+
get dynamicToolResults() {
|
1863
|
+
return this.toolResults.filter(
|
1864
|
+
(toolResult) => toolResult.dynamic === true
|
1865
|
+
);
|
1866
|
+
}
|
1841
1867
|
};
|
1842
1868
|
|
1843
1869
|
// src/generate-text/stop-condition.ts
|
@@ -2298,7 +2324,7 @@ async function executeTools({
|
|
2298
2324
|
}),
|
2299
2325
|
"ai.toolCall.name": toolName,
|
2300
2326
|
"ai.toolCall.id": toolCallId,
|
2301
|
-
"ai.toolCall.
|
2327
|
+
"ai.toolCall.args": {
|
2302
2328
|
output: () => JSON.stringify(input)
|
2303
2329
|
}
|
2304
2330
|
}
|
@@ -2306,7 +2332,7 @@ async function executeTools({
|
|
2306
2332
|
tracer,
|
2307
2333
|
fn: async (span) => {
|
2308
2334
|
try {
|
2309
|
-
const
|
2335
|
+
const output = await tool3.execute(input, {
|
2310
2336
|
toolCallId,
|
2311
2337
|
messages,
|
2312
2338
|
abortSignal
|
@@ -2317,7 +2343,7 @@ async function executeTools({
|
|
2317
2343
|
telemetry,
|
2318
2344
|
attributes: {
|
2319
2345
|
"ai.toolCall.result": {
|
2320
|
-
output: () => JSON.stringify(
|
2346
|
+
output: () => JSON.stringify(output)
|
2321
2347
|
}
|
2322
2348
|
}
|
2323
2349
|
})
|
@@ -2329,7 +2355,7 @@ async function executeTools({
|
|
2329
2355
|
toolCallId,
|
2330
2356
|
toolName,
|
2331
2357
|
input,
|
2332
|
-
output
|
2358
|
+
output,
|
2333
2359
|
dynamic: tool3.type === "dynamic"
|
2334
2360
|
};
|
2335
2361
|
} catch (error) {
|
@@ -2377,9 +2403,21 @@ var DefaultGenerateTextResult = class {
|
|
2377
2403
|
get toolCalls() {
|
2378
2404
|
return this.finalStep.toolCalls;
|
2379
2405
|
}
|
2406
|
+
get staticToolCalls() {
|
2407
|
+
return this.finalStep.staticToolCalls;
|
2408
|
+
}
|
2409
|
+
get dynamicToolCalls() {
|
2410
|
+
return this.finalStep.dynamicToolCalls;
|
2411
|
+
}
|
2380
2412
|
get toolResults() {
|
2381
2413
|
return this.finalStep.toolResults;
|
2382
2414
|
}
|
2415
|
+
get staticToolResults() {
|
2416
|
+
return this.finalStep.staticToolResults;
|
2417
|
+
}
|
2418
|
+
get dynamicToolResults() {
|
2419
|
+
return this.finalStep.dynamicToolResults;
|
2420
|
+
}
|
2383
2421
|
get sources() {
|
2384
2422
|
return this.finalStep.sources;
|
2385
2423
|
}
|
@@ -3431,7 +3469,7 @@ function processUIMessageStream({
|
|
3431
3469
|
});
|
3432
3470
|
}
|
3433
3471
|
write();
|
3434
|
-
if (onToolCall && !chunk.providerExecuted
|
3472
|
+
if (onToolCall && !chunk.providerExecuted) {
|
3435
3473
|
await onToolCall({
|
3436
3474
|
toolCall: chunk
|
3437
3475
|
});
|
@@ -3955,7 +3993,7 @@ function runToolsTransformation({
|
|
3955
3993
|
}),
|
3956
3994
|
"ai.toolCall.name": toolCall.toolName,
|
3957
3995
|
"ai.toolCall.id": toolCall.toolCallId,
|
3958
|
-
"ai.toolCall.
|
3996
|
+
"ai.toolCall.args": {
|
3959
3997
|
output: () => JSON.stringify(toolCall.input)
|
3960
3998
|
}
|
3961
3999
|
}
|
@@ -3992,7 +4030,7 @@ function runToolsTransformation({
|
|
3992
4030
|
selectTelemetryAttributes({
|
3993
4031
|
telemetry,
|
3994
4032
|
attributes: {
|
3995
|
-
"ai.toolCall.
|
4033
|
+
"ai.toolCall.result": {
|
3996
4034
|
output: () => JSON.stringify(output)
|
3997
4035
|
}
|
3998
4036
|
}
|
@@ -4399,7 +4437,11 @@ var DefaultStreamTextResult = class {
|
|
4399
4437
|
files: finalStep.files,
|
4400
4438
|
sources: finalStep.sources,
|
4401
4439
|
toolCalls: finalStep.toolCalls,
|
4440
|
+
staticToolCalls: finalStep.staticToolCalls,
|
4441
|
+
dynamicToolCalls: finalStep.dynamicToolCalls,
|
4402
4442
|
toolResults: finalStep.toolResults,
|
4443
|
+
staticToolResults: finalStep.staticToolResults,
|
4444
|
+
dynamicToolResults: finalStep.dynamicToolResults,
|
4403
4445
|
request: finalStep.request,
|
4404
4446
|
response: finalStep.response,
|
4405
4447
|
warnings: finalStep.warnings,
|
@@ -4929,9 +4971,21 @@ var DefaultStreamTextResult = class {
|
|
4929
4971
|
get toolCalls() {
|
4930
4972
|
return this.finalStep.then((step) => step.toolCalls);
|
4931
4973
|
}
|
4974
|
+
get staticToolCalls() {
|
4975
|
+
return this.finalStep.then((step) => step.staticToolCalls);
|
4976
|
+
}
|
4977
|
+
get dynamicToolCalls() {
|
4978
|
+
return this.finalStep.then((step) => step.dynamicToolCalls);
|
4979
|
+
}
|
4932
4980
|
get toolResults() {
|
4933
4981
|
return this.finalStep.then((step) => step.toolResults);
|
4934
4982
|
}
|
4983
|
+
get staticToolResults() {
|
4984
|
+
return this.finalStep.then((step) => step.staticToolResults);
|
4985
|
+
}
|
4986
|
+
get dynamicToolResults() {
|
4987
|
+
return this.finalStep.then((step) => step.dynamicToolResults);
|
4988
|
+
}
|
4935
4989
|
get usage() {
|
4936
4990
|
return this.finalStep.then((step) => step.usage);
|
4937
4991
|
}
|
@@ -9531,6 +9585,7 @@ function readUIMessageStream({
|
|
9531
9585
|
toolModelMessageSchema,
|
9532
9586
|
userModelMessageSchema,
|
9533
9587
|
wrapLanguageModel,
|
9534
|
-
wrapProvider
|
9588
|
+
wrapProvider,
|
9589
|
+
zodSchema
|
9535
9590
|
});
|
9536
9591
|
//# sourceMappingURL=index.js.map
|