ai 6.0.0-beta.153 → 6.0.0-beta.155
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 +17 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -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,22 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.0-beta.155
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [c1efac4]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.0-beta.51
|
|
9
|
+
- @ai-sdk/gateway@2.0.0-beta.82
|
|
10
|
+
|
|
11
|
+
## 6.0.0-beta.154
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 32223c8: feat: add toolCallId arg to toModelOutput
|
|
16
|
+
- Updated dependencies [32223c8]
|
|
17
|
+
- @ai-sdk/provider-utils@4.0.0-beta.50
|
|
18
|
+
- @ai-sdk/gateway@2.0.0-beta.81
|
|
19
|
+
|
|
3
20
|
## 6.0.0-beta.153
|
|
4
21
|
|
|
5
22
|
### 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.155" : "0.0.0-test";
|
|
968
968
|
|
|
969
969
|
// src/util/download/download.ts
|
|
970
970
|
var download = async ({ url }) => {
|
|
@@ -1375,6 +1375,8 @@ 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,
|
|
1379
|
+
input,
|
|
1378
1380
|
output,
|
|
1379
1381
|
tool: tool2,
|
|
1380
1382
|
errorMode
|
|
@@ -1385,7 +1387,7 @@ async function createToolModelOutput({
|
|
|
1385
1387
|
return { type: "error-json", value: toJSONValue(output) };
|
|
1386
1388
|
}
|
|
1387
1389
|
if (tool2 == null ? void 0 : tool2.toModelOutput) {
|
|
1388
|
-
return await tool2.toModelOutput({ output });
|
|
1390
|
+
return await tool2.toModelOutput({ toolCallId, input, output });
|
|
1389
1391
|
}
|
|
1390
1392
|
return typeof output === "string" ? { type: "text", value: output } : { type: "json", value: toJSONValue(output) };
|
|
1391
1393
|
}
|
|
@@ -3397,6 +3399,8 @@ async function toResponseMessages({
|
|
|
3397
3399
|
break;
|
|
3398
3400
|
case "tool-result": {
|
|
3399
3401
|
const output = await createToolModelOutput({
|
|
3402
|
+
toolCallId: part.toolCallId,
|
|
3403
|
+
input: part.input,
|
|
3400
3404
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3401
3405
|
output: part.output,
|
|
3402
3406
|
errorMode: "none"
|
|
@@ -3412,6 +3416,8 @@ async function toResponseMessages({
|
|
|
3412
3416
|
}
|
|
3413
3417
|
case "tool-error": {
|
|
3414
3418
|
const output = await createToolModelOutput({
|
|
3419
|
+
toolCallId: part.toolCallId,
|
|
3420
|
+
input: part.input,
|
|
3415
3421
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3416
3422
|
output: part.error,
|
|
3417
3423
|
errorMode: "json"
|
|
@@ -3446,6 +3452,8 @@ async function toResponseMessages({
|
|
|
3446
3452
|
continue;
|
|
3447
3453
|
}
|
|
3448
3454
|
const output = await createToolModelOutput({
|
|
3455
|
+
toolCallId: part.toolCallId,
|
|
3456
|
+
input: part.input,
|
|
3449
3457
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3450
3458
|
output: part.type === "tool-result" ? part.output : part.error,
|
|
3451
3459
|
errorMode: part.type === "tool-error" ? "text" : "none"
|
|
@@ -3566,6 +3574,8 @@ async function generateText({
|
|
|
3566
3574
|
const toolContent = [];
|
|
3567
3575
|
for (const output2 of toolOutputs) {
|
|
3568
3576
|
const modelOutput = await createToolModelOutput({
|
|
3577
|
+
toolCallId: output2.toolCallId,
|
|
3578
|
+
input: output2.input,
|
|
3569
3579
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3570
3580
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3571
3581
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -5963,6 +5973,8 @@ var DefaultStreamTextResult = class {
|
|
|
5963
5973
|
toolCallId: output2.toolCallId,
|
|
5964
5974
|
toolName: output2.toolName,
|
|
5965
5975
|
output: await createToolModelOutput({
|
|
5976
|
+
toolCallId: output2.toolCallId,
|
|
5977
|
+
input: output2.input,
|
|
5966
5978
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
5967
5979
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
5968
5980
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -7172,6 +7184,8 @@ async function convertToModelMessages(messages, options) {
|
|
|
7172
7184
|
toolCallId: part.toolCallId,
|
|
7173
7185
|
toolName,
|
|
7174
7186
|
output: await createToolModelOutput({
|
|
7187
|
+
toolCallId: part.toolCallId,
|
|
7188
|
+
input: part.input,
|
|
7175
7189
|
output: part.state === "output-error" ? part.errorText : part.output,
|
|
7176
7190
|
tool: (_b = options == null ? void 0 : options.tools) == null ? void 0 : _b[toolName],
|
|
7177
7191
|
errorMode: part.state === "output-error" ? "json" : "none"
|
|
@@ -7234,6 +7248,8 @@ async function convertToModelMessages(messages, options) {
|
|
|
7234
7248
|
toolCallId: toolPart.toolCallId,
|
|
7235
7249
|
toolName,
|
|
7236
7250
|
output: await createToolModelOutput({
|
|
7251
|
+
toolCallId: toolPart.toolCallId,
|
|
7252
|
+
input: toolPart.input,
|
|
7237
7253
|
output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
|
|
7238
7254
|
tool: (_f = options == null ? void 0 : options.tools) == null ? void 0 : _f[toolName],
|
|
7239
7255
|
errorMode: toolPart.state === "output-error" ? "text" : "none"
|