ai 6.0.0-beta.153 → 6.0.0-beta.154
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 +9 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.0-beta.154
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 32223c8: feat: add toolCallId arg to toModelOutput
|
|
8
|
+
- Updated dependencies [32223c8]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.0-beta.50
|
|
10
|
+
- @ai-sdk/gateway@2.0.0-beta.81
|
|
11
|
+
|
|
3
12
|
## 6.0.0-beta.153
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -964,7 +964,7 @@ function detectMediaType({
|
|
|
964
964
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
965
965
|
|
|
966
966
|
// src/version.ts
|
|
967
|
-
var VERSION = true ? "6.0.0-beta.
|
|
967
|
+
var VERSION = true ? "6.0.0-beta.154" : "0.0.0-test";
|
|
968
968
|
|
|
969
969
|
// src/util/download/download.ts
|
|
970
970
|
var download = async ({ url }) => {
|
|
@@ -1375,6 +1375,7 @@ function mapToolResultOutput(output) {
|
|
|
1375
1375
|
// src/prompt/create-tool-model-output.ts
|
|
1376
1376
|
var import_provider18 = require("@ai-sdk/provider");
|
|
1377
1377
|
async function createToolModelOutput({
|
|
1378
|
+
toolCallId,
|
|
1378
1379
|
output,
|
|
1379
1380
|
tool: tool2,
|
|
1380
1381
|
errorMode
|
|
@@ -1385,7 +1386,7 @@ async function createToolModelOutput({
|
|
|
1385
1386
|
return { type: "error-json", value: toJSONValue(output) };
|
|
1386
1387
|
}
|
|
1387
1388
|
if (tool2 == null ? void 0 : tool2.toModelOutput) {
|
|
1388
|
-
return await tool2.toModelOutput({ output });
|
|
1389
|
+
return await tool2.toModelOutput({ toolCallId, output });
|
|
1389
1390
|
}
|
|
1390
1391
|
return typeof output === "string" ? { type: "text", value: output } : { type: "json", value: toJSONValue(output) };
|
|
1391
1392
|
}
|
|
@@ -3397,6 +3398,7 @@ async function toResponseMessages({
|
|
|
3397
3398
|
break;
|
|
3398
3399
|
case "tool-result": {
|
|
3399
3400
|
const output = await createToolModelOutput({
|
|
3401
|
+
toolCallId: part.toolCallId,
|
|
3400
3402
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3401
3403
|
output: part.output,
|
|
3402
3404
|
errorMode: "none"
|
|
@@ -3412,6 +3414,7 @@ async function toResponseMessages({
|
|
|
3412
3414
|
}
|
|
3413
3415
|
case "tool-error": {
|
|
3414
3416
|
const output = await createToolModelOutput({
|
|
3417
|
+
toolCallId: part.toolCallId,
|
|
3415
3418
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3416
3419
|
output: part.error,
|
|
3417
3420
|
errorMode: "json"
|
|
@@ -3446,6 +3449,7 @@ async function toResponseMessages({
|
|
|
3446
3449
|
continue;
|
|
3447
3450
|
}
|
|
3448
3451
|
const output = await createToolModelOutput({
|
|
3452
|
+
toolCallId: part.toolCallId,
|
|
3449
3453
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3450
3454
|
output: part.type === "tool-result" ? part.output : part.error,
|
|
3451
3455
|
errorMode: part.type === "tool-error" ? "text" : "none"
|
|
@@ -3566,6 +3570,7 @@ async function generateText({
|
|
|
3566
3570
|
const toolContent = [];
|
|
3567
3571
|
for (const output2 of toolOutputs) {
|
|
3568
3572
|
const modelOutput = await createToolModelOutput({
|
|
3573
|
+
toolCallId: output2.toolCallId,
|
|
3569
3574
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3570
3575
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3571
3576
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -5963,6 +5968,7 @@ var DefaultStreamTextResult = class {
|
|
|
5963
5968
|
toolCallId: output2.toolCallId,
|
|
5964
5969
|
toolName: output2.toolName,
|
|
5965
5970
|
output: await createToolModelOutput({
|
|
5971
|
+
toolCallId: output2.toolCallId,
|
|
5966
5972
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
5967
5973
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
5968
5974
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -7172,6 +7178,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7172
7178
|
toolCallId: part.toolCallId,
|
|
7173
7179
|
toolName,
|
|
7174
7180
|
output: await createToolModelOutput({
|
|
7181
|
+
toolCallId: part.toolCallId,
|
|
7175
7182
|
output: part.state === "output-error" ? part.errorText : part.output,
|
|
7176
7183
|
tool: (_b = options == null ? void 0 : options.tools) == null ? void 0 : _b[toolName],
|
|
7177
7184
|
errorMode: part.state === "output-error" ? "json" : "none"
|
|
@@ -7234,6 +7241,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7234
7241
|
toolCallId: toolPart.toolCallId,
|
|
7235
7242
|
toolName,
|
|
7236
7243
|
output: await createToolModelOutput({
|
|
7244
|
+
toolCallId: toolPart.toolCallId,
|
|
7237
7245
|
output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
|
|
7238
7246
|
tool: (_f = options == null ? void 0 : options.tools) == null ? void 0 : _f[toolName],
|
|
7239
7247
|
errorMode: toolPart.state === "output-error" ? "text" : "none"
|