ai 5.0.285 → 5.0.287
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 +25 -0
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -20
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +3 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +3 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -758,7 +758,7 @@ import {
|
|
|
758
758
|
} from "@ai-sdk/provider-utils";
|
|
759
759
|
|
|
760
760
|
// src/version.ts
|
|
761
|
-
var VERSION = true ? "5.0.
|
|
761
|
+
var VERSION = true ? "5.0.287" : "0.0.0-test";
|
|
762
762
|
|
|
763
763
|
// src/util/download/download.ts
|
|
764
764
|
var download = async ({
|
|
@@ -1257,7 +1257,8 @@ function prepareToolsAndToolChoice({
|
|
|
1257
1257
|
if (!isNonEmptyObject(tools)) {
|
|
1258
1258
|
return {
|
|
1259
1259
|
tools: void 0,
|
|
1260
|
-
|
|
1260
|
+
// Providers can configure native tools without SDK tools.
|
|
1261
|
+
toolChoice: toolChoice === "none" ? { type: "none" } : void 0
|
|
1261
1262
|
};
|
|
1262
1263
|
}
|
|
1263
1264
|
const filteredTools = activeTools != null ? Object.entries(tools).filter(
|
|
@@ -2510,9 +2511,9 @@ async function generateText({
|
|
|
2510
2511
|
"ai.response.id": responseData.id,
|
|
2511
2512
|
"ai.response.model": responseData.modelId,
|
|
2512
2513
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
2513
|
-
"ai.response.providerMetadata":
|
|
2514
|
-
result.providerMetadata
|
|
2515
|
-
|
|
2514
|
+
"ai.response.providerMetadata": {
|
|
2515
|
+
output: () => JSON.stringify(result.providerMetadata)
|
|
2516
|
+
},
|
|
2516
2517
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
2517
2518
|
"ai.usage.promptTokens": result.usage.inputTokens,
|
|
2518
2519
|
"ai.usage.completionTokens": result.usage.outputTokens,
|
|
@@ -2658,9 +2659,9 @@ async function generateText({
|
|
|
2658
2659
|
return toolCalls == null ? void 0 : JSON.stringify(toolCalls);
|
|
2659
2660
|
}
|
|
2660
2661
|
},
|
|
2661
|
-
"ai.response.providerMetadata":
|
|
2662
|
-
currentModelResponse.providerMetadata
|
|
2663
|
-
|
|
2662
|
+
"ai.response.providerMetadata": {
|
|
2663
|
+
output: () => JSON.stringify(currentModelResponse.providerMetadata)
|
|
2664
|
+
},
|
|
2664
2665
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
2665
2666
|
"ai.usage.promptTokens": currentModelResponse.usage.inputTokens,
|
|
2666
2667
|
"ai.usage.completionTokens": currentModelResponse.usage.outputTokens
|
|
@@ -5365,9 +5366,9 @@ var DefaultStreamTextResult = class {
|
|
|
5365
5366
|
return ((_a17 = finalStep.toolCalls) == null ? void 0 : _a17.length) ? JSON.stringify(finalStep.toolCalls) : void 0;
|
|
5366
5367
|
}
|
|
5367
5368
|
},
|
|
5368
|
-
"ai.response.providerMetadata":
|
|
5369
|
-
finalStep.providerMetadata
|
|
5370
|
-
|
|
5369
|
+
"ai.response.providerMetadata": {
|
|
5370
|
+
output: () => JSON.stringify(finalStep.providerMetadata)
|
|
5371
|
+
},
|
|
5371
5372
|
"ai.usage.inputTokens": totalUsage.inputTokens,
|
|
5372
5373
|
"ai.usage.outputTokens": totalUsage.outputTokens,
|
|
5373
5374
|
"ai.usage.totalTokens": totalUsage.totalTokens,
|
|
@@ -5766,7 +5767,9 @@ var DefaultStreamTextResult = class {
|
|
|
5766
5767
|
"ai.response.id": stepResponse.id,
|
|
5767
5768
|
"ai.response.model": stepResponse.modelId,
|
|
5768
5769
|
"ai.response.timestamp": stepResponse.timestamp.toISOString(),
|
|
5769
|
-
"ai.response.providerMetadata":
|
|
5770
|
+
"ai.response.providerMetadata": {
|
|
5771
|
+
output: () => JSON.stringify(stepProviderMetadata)
|
|
5772
|
+
},
|
|
5770
5773
|
"ai.usage.inputTokens": stepUsage.inputTokens,
|
|
5771
5774
|
"ai.usage.outputTokens": stepUsage.outputTokens,
|
|
5772
5775
|
"ai.usage.totalTokens": stepUsage.totalTokens,
|
|
@@ -7895,9 +7898,9 @@ async function generateObject(options) {
|
|
|
7895
7898
|
"ai.response.id": responseData.id,
|
|
7896
7899
|
"ai.response.model": responseData.modelId,
|
|
7897
7900
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
7898
|
-
"ai.response.providerMetadata":
|
|
7899
|
-
result2.providerMetadata
|
|
7900
|
-
|
|
7901
|
+
"ai.response.providerMetadata": {
|
|
7902
|
+
output: () => JSON.stringify(result2.providerMetadata)
|
|
7903
|
+
},
|
|
7901
7904
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
7902
7905
|
"ai.usage.promptTokens": result2.usage.inputTokens,
|
|
7903
7906
|
"ai.usage.completionTokens": result2.usage.outputTokens,
|
|
@@ -7946,9 +7949,9 @@ async function generateObject(options) {
|
|
|
7946
7949
|
"ai.response.object": {
|
|
7947
7950
|
output: () => JSON.stringify(object2)
|
|
7948
7951
|
},
|
|
7949
|
-
"ai.response.providerMetadata":
|
|
7950
|
-
resultProviderMetadata
|
|
7951
|
-
|
|
7952
|
+
"ai.response.providerMetadata": {
|
|
7953
|
+
output: () => JSON.stringify(resultProviderMetadata)
|
|
7954
|
+
},
|
|
7952
7955
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
7953
7956
|
"ai.usage.promptTokens": usage.inputTokens,
|
|
7954
7957
|
"ai.usage.completionTokens": usage.outputTokens
|
|
@@ -8546,7 +8549,9 @@ var DefaultStreamObjectResult = class {
|
|
|
8546
8549
|
"ai.response.id": fullResponse.id,
|
|
8547
8550
|
"ai.response.model": fullResponse.modelId,
|
|
8548
8551
|
"ai.response.timestamp": fullResponse.timestamp.toISOString(),
|
|
8549
|
-
"ai.response.providerMetadata":
|
|
8552
|
+
"ai.response.providerMetadata": {
|
|
8553
|
+
output: () => JSON.stringify(providerMetadata)
|
|
8554
|
+
},
|
|
8550
8555
|
"ai.usage.inputTokens": finalUsage.inputTokens,
|
|
8551
8556
|
"ai.usage.outputTokens": finalUsage.outputTokens,
|
|
8552
8557
|
"ai.usage.totalTokens": finalUsage.totalTokens,
|
|
@@ -8574,7 +8579,9 @@ var DefaultStreamObjectResult = class {
|
|
|
8574
8579
|
"ai.response.object": {
|
|
8575
8580
|
output: () => JSON.stringify(object2)
|
|
8576
8581
|
},
|
|
8577
|
-
"ai.response.providerMetadata":
|
|
8582
|
+
"ai.response.providerMetadata": {
|
|
8583
|
+
output: () => JSON.stringify(providerMetadata)
|
|
8584
|
+
}
|
|
8578
8585
|
}
|
|
8579
8586
|
})
|
|
8580
8587
|
);
|