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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 5.0.287
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [e0eb120]
|
|
8
|
+
- Updated dependencies [5111655]
|
|
9
|
+
- @ai-sdk/gateway@2.0.178
|
|
10
|
+
|
|
11
|
+
## 5.0.286
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- f15d448: hide provider metadata from telemetry when recordOutputs is false
|
|
16
|
+
- 417a92c: Preserve `toolChoice: 'none'` when SDK tools are omitted or empty so providers can disable native tools configured through provider options.
|
|
17
|
+
|
|
18
|
+
For Perplexity native tools, also update `@ai-sdk/perplexity` to `2.1.6` or a later compatible version, which includes the provider-side guard.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [c6c7ae0]
|
|
21
|
+
- Updated dependencies [49c554d]
|
|
22
|
+
- Updated dependencies [ebc2cd9]
|
|
23
|
+
- Updated dependencies [b753c03]
|
|
24
|
+
- Updated dependencies [a7ebf30]
|
|
25
|
+
- @ai-sdk/gateway@2.0.177
|
|
26
|
+
- @ai-sdk/provider-utils@3.0.45
|
|
27
|
+
|
|
3
28
|
## 5.0.285
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -847,7 +847,7 @@ function detectMediaType({
|
|
|
847
847
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
848
848
|
|
|
849
849
|
// src/version.ts
|
|
850
|
-
var VERSION = true ? "5.0.
|
|
850
|
+
var VERSION = true ? "5.0.287" : "0.0.0-test";
|
|
851
851
|
|
|
852
852
|
// src/util/download/download.ts
|
|
853
853
|
var download = async ({
|
|
@@ -1341,7 +1341,8 @@ function prepareToolsAndToolChoice({
|
|
|
1341
1341
|
if (!isNonEmptyObject(tools)) {
|
|
1342
1342
|
return {
|
|
1343
1343
|
tools: void 0,
|
|
1344
|
-
|
|
1344
|
+
// Providers can configure native tools without SDK tools.
|
|
1345
|
+
toolChoice: toolChoice === "none" ? { type: "none" } : void 0
|
|
1345
1346
|
};
|
|
1346
1347
|
}
|
|
1347
1348
|
const filteredTools = activeTools != null ? Object.entries(tools).filter(
|
|
@@ -2583,9 +2584,9 @@ async function generateText({
|
|
|
2583
2584
|
"ai.response.id": responseData.id,
|
|
2584
2585
|
"ai.response.model": responseData.modelId,
|
|
2585
2586
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
2586
|
-
"ai.response.providerMetadata":
|
|
2587
|
-
result.providerMetadata
|
|
2588
|
-
|
|
2587
|
+
"ai.response.providerMetadata": {
|
|
2588
|
+
output: () => JSON.stringify(result.providerMetadata)
|
|
2589
|
+
},
|
|
2589
2590
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
2590
2591
|
"ai.usage.promptTokens": result.usage.inputTokens,
|
|
2591
2592
|
"ai.usage.completionTokens": result.usage.outputTokens,
|
|
@@ -2731,9 +2732,9 @@ async function generateText({
|
|
|
2731
2732
|
return toolCalls == null ? void 0 : JSON.stringify(toolCalls);
|
|
2732
2733
|
}
|
|
2733
2734
|
},
|
|
2734
|
-
"ai.response.providerMetadata":
|
|
2735
|
-
currentModelResponse.providerMetadata
|
|
2736
|
-
|
|
2735
|
+
"ai.response.providerMetadata": {
|
|
2736
|
+
output: () => JSON.stringify(currentModelResponse.providerMetadata)
|
|
2737
|
+
},
|
|
2737
2738
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
2738
2739
|
"ai.usage.promptTokens": currentModelResponse.usage.inputTokens,
|
|
2739
2740
|
"ai.usage.completionTokens": currentModelResponse.usage.outputTokens
|
|
@@ -5428,9 +5429,9 @@ var DefaultStreamTextResult = class {
|
|
|
5428
5429
|
return ((_a17 = finalStep.toolCalls) == null ? void 0 : _a17.length) ? JSON.stringify(finalStep.toolCalls) : void 0;
|
|
5429
5430
|
}
|
|
5430
5431
|
},
|
|
5431
|
-
"ai.response.providerMetadata":
|
|
5432
|
-
finalStep.providerMetadata
|
|
5433
|
-
|
|
5432
|
+
"ai.response.providerMetadata": {
|
|
5433
|
+
output: () => JSON.stringify(finalStep.providerMetadata)
|
|
5434
|
+
},
|
|
5434
5435
|
"ai.usage.inputTokens": totalUsage.inputTokens,
|
|
5435
5436
|
"ai.usage.outputTokens": totalUsage.outputTokens,
|
|
5436
5437
|
"ai.usage.totalTokens": totalUsage.totalTokens,
|
|
@@ -5829,7 +5830,9 @@ var DefaultStreamTextResult = class {
|
|
|
5829
5830
|
"ai.response.id": stepResponse.id,
|
|
5830
5831
|
"ai.response.model": stepResponse.modelId,
|
|
5831
5832
|
"ai.response.timestamp": stepResponse.timestamp.toISOString(),
|
|
5832
|
-
"ai.response.providerMetadata":
|
|
5833
|
+
"ai.response.providerMetadata": {
|
|
5834
|
+
output: () => JSON.stringify(stepProviderMetadata)
|
|
5835
|
+
},
|
|
5833
5836
|
"ai.usage.inputTokens": stepUsage.inputTokens,
|
|
5834
5837
|
"ai.usage.outputTokens": stepUsage.outputTokens,
|
|
5835
5838
|
"ai.usage.totalTokens": stepUsage.totalTokens,
|
|
@@ -7941,9 +7944,9 @@ async function generateObject(options) {
|
|
|
7941
7944
|
"ai.response.id": responseData.id,
|
|
7942
7945
|
"ai.response.model": responseData.modelId,
|
|
7943
7946
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
7944
|
-
"ai.response.providerMetadata":
|
|
7945
|
-
result2.providerMetadata
|
|
7946
|
-
|
|
7947
|
+
"ai.response.providerMetadata": {
|
|
7948
|
+
output: () => JSON.stringify(result2.providerMetadata)
|
|
7949
|
+
},
|
|
7947
7950
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
7948
7951
|
"ai.usage.promptTokens": result2.usage.inputTokens,
|
|
7949
7952
|
"ai.usage.completionTokens": result2.usage.outputTokens,
|
|
@@ -7992,9 +7995,9 @@ async function generateObject(options) {
|
|
|
7992
7995
|
"ai.response.object": {
|
|
7993
7996
|
output: () => JSON.stringify(object2)
|
|
7994
7997
|
},
|
|
7995
|
-
"ai.response.providerMetadata":
|
|
7996
|
-
resultProviderMetadata
|
|
7997
|
-
|
|
7998
|
+
"ai.response.providerMetadata": {
|
|
7999
|
+
output: () => JSON.stringify(resultProviderMetadata)
|
|
8000
|
+
},
|
|
7998
8001
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
7999
8002
|
"ai.usage.promptTokens": usage.inputTokens,
|
|
8000
8003
|
"ai.usage.completionTokens": usage.outputTokens
|
|
@@ -8589,7 +8592,9 @@ var DefaultStreamObjectResult = class {
|
|
|
8589
8592
|
"ai.response.id": fullResponse.id,
|
|
8590
8593
|
"ai.response.model": fullResponse.modelId,
|
|
8591
8594
|
"ai.response.timestamp": fullResponse.timestamp.toISOString(),
|
|
8592
|
-
"ai.response.providerMetadata":
|
|
8595
|
+
"ai.response.providerMetadata": {
|
|
8596
|
+
output: () => JSON.stringify(providerMetadata)
|
|
8597
|
+
},
|
|
8593
8598
|
"ai.usage.inputTokens": finalUsage.inputTokens,
|
|
8594
8599
|
"ai.usage.outputTokens": finalUsage.outputTokens,
|
|
8595
8600
|
"ai.usage.totalTokens": finalUsage.totalTokens,
|
|
@@ -8617,7 +8622,9 @@ var DefaultStreamObjectResult = class {
|
|
|
8617
8622
|
"ai.response.object": {
|
|
8618
8623
|
output: () => JSON.stringify(object2)
|
|
8619
8624
|
},
|
|
8620
|
-
"ai.response.providerMetadata":
|
|
8625
|
+
"ai.response.providerMetadata": {
|
|
8626
|
+
output: () => JSON.stringify(providerMetadata)
|
|
8627
|
+
}
|
|
8621
8628
|
}
|
|
8622
8629
|
})
|
|
8623
8630
|
);
|