ai 6.0.323 → 6.0.325
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 +21 -0
- package/dist/index.js +27 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -22
- 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/docs/03-ai-sdk-core/16-mcp-tools.mdx +6 -1
- package/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +1 -1
- package/package.json +5 -4
- package/src/generate-object/generate-object.ts +6 -6
- package/src/generate-object/stream-object.ts +6 -4
- package/src/generate-text/generate-text.ts +7 -6
- package/src/generate-text/stream-text.ts +7 -6
- package/src/prompt/prepare-tools-and-tool-choice.ts +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1225,7 +1225,7 @@ import {
|
|
|
1225
1225
|
} from "@ai-sdk/provider-utils";
|
|
1226
1226
|
|
|
1227
1227
|
// src/version.ts
|
|
1228
|
-
var VERSION = true ? "6.0.
|
|
1228
|
+
var VERSION = true ? "6.0.325" : "0.0.0-test";
|
|
1229
1229
|
|
|
1230
1230
|
// src/util/download/download.ts
|
|
1231
1231
|
var download = async ({
|
|
@@ -1954,7 +1954,8 @@ async function prepareToolsAndToolChoice({
|
|
|
1954
1954
|
if (!isNonEmptyObject(tools)) {
|
|
1955
1955
|
return {
|
|
1956
1956
|
tools: void 0,
|
|
1957
|
-
|
|
1957
|
+
// Providers can configure native tools without SDK tools.
|
|
1958
|
+
toolChoice: toolChoice === "none" ? { type: "none" } : void 0
|
|
1958
1959
|
};
|
|
1959
1960
|
}
|
|
1960
1961
|
const filteredTools = activeTools != null ? Object.entries(tools).filter(
|
|
@@ -4935,9 +4936,9 @@ async function generateText({
|
|
|
4935
4936
|
"ai.response.id": responseData.id,
|
|
4936
4937
|
"ai.response.model": responseData.modelId,
|
|
4937
4938
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
4938
|
-
"ai.response.providerMetadata":
|
|
4939
|
-
result.providerMetadata
|
|
4940
|
-
|
|
4939
|
+
"ai.response.providerMetadata": {
|
|
4940
|
+
output: () => JSON.stringify(result.providerMetadata)
|
|
4941
|
+
},
|
|
4941
4942
|
"ai.usage.inputTokens": result.usage.inputTokens.total,
|
|
4942
4943
|
"ai.usage.inputTokenDetails.noCacheTokens": result.usage.inputTokens.noCache,
|
|
4943
4944
|
"ai.usage.inputTokenDetails.cacheReadTokens": result.usage.inputTokens.cacheRead,
|
|
@@ -5178,9 +5179,9 @@ async function generateText({
|
|
|
5178
5179
|
return toolCalls == null ? void 0 : JSON.stringify(toolCalls);
|
|
5179
5180
|
}
|
|
5180
5181
|
},
|
|
5181
|
-
"ai.response.providerMetadata":
|
|
5182
|
-
currentModelResponse.providerMetadata
|
|
5183
|
-
|
|
5182
|
+
"ai.response.providerMetadata": {
|
|
5183
|
+
output: () => JSON.stringify(currentModelResponse.providerMetadata)
|
|
5184
|
+
}
|
|
5184
5185
|
}
|
|
5185
5186
|
})
|
|
5186
5187
|
);
|
|
@@ -7927,9 +7928,9 @@ var DefaultStreamTextResult = class {
|
|
|
7927
7928
|
return ((_a24 = finalStep.toolCalls) == null ? void 0 : _a24.length) ? JSON.stringify(finalStep.toolCalls) : void 0;
|
|
7928
7929
|
}
|
|
7929
7930
|
},
|
|
7930
|
-
"ai.response.providerMetadata":
|
|
7931
|
-
finalStep.providerMetadata
|
|
7932
|
-
|
|
7931
|
+
"ai.response.providerMetadata": {
|
|
7932
|
+
output: () => JSON.stringify(finalStep.providerMetadata)
|
|
7933
|
+
},
|
|
7933
7934
|
"ai.usage.inputTokens": totalUsage.inputTokens,
|
|
7934
7935
|
"ai.usage.inputTokenDetails.noCacheTokens": (_a23 = totalUsage.inputTokenDetails) == null ? void 0 : _a23.noCacheTokens,
|
|
7935
7936
|
"ai.usage.inputTokenDetails.cacheReadTokens": (_b = totalUsage.inputTokenDetails) == null ? void 0 : _b.cacheReadTokens,
|
|
@@ -8697,9 +8698,9 @@ var DefaultStreamTextResult = class {
|
|
|
8697
8698
|
"ai.response.reasoning": {
|
|
8698
8699
|
output: () => processedStep.reasoningText
|
|
8699
8700
|
},
|
|
8700
|
-
"ai.response.providerMetadata":
|
|
8701
|
-
processedStep.providerMetadata
|
|
8702
|
-
|
|
8701
|
+
"ai.response.providerMetadata": {
|
|
8702
|
+
output: () => JSON.stringify(processedStep.providerMetadata)
|
|
8703
|
+
}
|
|
8703
8704
|
}
|
|
8704
8705
|
})
|
|
8705
8706
|
);
|
|
@@ -11851,9 +11852,9 @@ async function generateObject(options) {
|
|
|
11851
11852
|
"ai.response.id": responseData.id,
|
|
11852
11853
|
"ai.response.model": responseData.modelId,
|
|
11853
11854
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
11854
|
-
"ai.response.providerMetadata":
|
|
11855
|
-
result2.providerMetadata
|
|
11856
|
-
|
|
11855
|
+
"ai.response.providerMetadata": {
|
|
11856
|
+
output: () => JSON.stringify(result2.providerMetadata)
|
|
11857
|
+
},
|
|
11857
11858
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
11858
11859
|
"ai.usage.promptTokens": result2.usage.inputTokens.total,
|
|
11859
11860
|
"ai.usage.completionTokens": result2.usage.outputTokens.total,
|
|
@@ -11908,9 +11909,9 @@ async function generateObject(options) {
|
|
|
11908
11909
|
"ai.response.object": {
|
|
11909
11910
|
output: () => JSON.stringify(object2)
|
|
11910
11911
|
},
|
|
11911
|
-
"ai.response.providerMetadata":
|
|
11912
|
-
resultProviderMetadata
|
|
11913
|
-
|
|
11912
|
+
"ai.response.providerMetadata": {
|
|
11913
|
+
output: () => JSON.stringify(resultProviderMetadata)
|
|
11914
|
+
},
|
|
11914
11915
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
11915
11916
|
"ai.usage.promptTokens": usage.inputTokens,
|
|
11916
11917
|
"ai.usage.completionTokens": usage.outputTokens
|
|
@@ -12477,7 +12478,9 @@ var DefaultStreamObjectResult = class {
|
|
|
12477
12478
|
"ai.response.id": fullResponse.id,
|
|
12478
12479
|
"ai.response.model": fullResponse.modelId,
|
|
12479
12480
|
"ai.response.timestamp": fullResponse.timestamp.toISOString(),
|
|
12480
|
-
"ai.response.providerMetadata":
|
|
12481
|
+
"ai.response.providerMetadata": {
|
|
12482
|
+
output: () => JSON.stringify(providerMetadata)
|
|
12483
|
+
},
|
|
12481
12484
|
"ai.usage.inputTokens": finalUsage.inputTokens,
|
|
12482
12485
|
"ai.usage.outputTokens": finalUsage.outputTokens,
|
|
12483
12486
|
"ai.usage.totalTokens": finalUsage.totalTokens,
|
|
@@ -12505,7 +12508,9 @@ var DefaultStreamObjectResult = class {
|
|
|
12505
12508
|
"ai.response.object": {
|
|
12506
12509
|
output: () => JSON.stringify(object2)
|
|
12507
12510
|
},
|
|
12508
|
-
"ai.response.providerMetadata":
|
|
12511
|
+
"ai.response.providerMetadata": {
|
|
12512
|
+
output: () => JSON.stringify(providerMetadata)
|
|
12513
|
+
}
|
|
12509
12514
|
}
|
|
12510
12515
|
})
|
|
12511
12516
|
);
|