ai 6.0.0-beta.154 → 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 +8 -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
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 }) => {
|
|
@@ -1376,6 +1376,7 @@ function mapToolResultOutput(output) {
|
|
|
1376
1376
|
var import_provider18 = require("@ai-sdk/provider");
|
|
1377
1377
|
async function createToolModelOutput({
|
|
1378
1378
|
toolCallId,
|
|
1379
|
+
input,
|
|
1379
1380
|
output,
|
|
1380
1381
|
tool: tool2,
|
|
1381
1382
|
errorMode
|
|
@@ -1386,7 +1387,7 @@ async function createToolModelOutput({
|
|
|
1386
1387
|
return { type: "error-json", value: toJSONValue(output) };
|
|
1387
1388
|
}
|
|
1388
1389
|
if (tool2 == null ? void 0 : tool2.toModelOutput) {
|
|
1389
|
-
return await tool2.toModelOutput({ toolCallId, output });
|
|
1390
|
+
return await tool2.toModelOutput({ toolCallId, input, output });
|
|
1390
1391
|
}
|
|
1391
1392
|
return typeof output === "string" ? { type: "text", value: output } : { type: "json", value: toJSONValue(output) };
|
|
1392
1393
|
}
|
|
@@ -3399,6 +3400,7 @@ async function toResponseMessages({
|
|
|
3399
3400
|
case "tool-result": {
|
|
3400
3401
|
const output = await createToolModelOutput({
|
|
3401
3402
|
toolCallId: part.toolCallId,
|
|
3403
|
+
input: part.input,
|
|
3402
3404
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3403
3405
|
output: part.output,
|
|
3404
3406
|
errorMode: "none"
|
|
@@ -3415,6 +3417,7 @@ async function toResponseMessages({
|
|
|
3415
3417
|
case "tool-error": {
|
|
3416
3418
|
const output = await createToolModelOutput({
|
|
3417
3419
|
toolCallId: part.toolCallId,
|
|
3420
|
+
input: part.input,
|
|
3418
3421
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3419
3422
|
output: part.error,
|
|
3420
3423
|
errorMode: "json"
|
|
@@ -3450,6 +3453,7 @@ async function toResponseMessages({
|
|
|
3450
3453
|
}
|
|
3451
3454
|
const output = await createToolModelOutput({
|
|
3452
3455
|
toolCallId: part.toolCallId,
|
|
3456
|
+
input: part.input,
|
|
3453
3457
|
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3454
3458
|
output: part.type === "tool-result" ? part.output : part.error,
|
|
3455
3459
|
errorMode: part.type === "tool-error" ? "text" : "none"
|
|
@@ -3571,6 +3575,7 @@ async function generateText({
|
|
|
3571
3575
|
for (const output2 of toolOutputs) {
|
|
3572
3576
|
const modelOutput = await createToolModelOutput({
|
|
3573
3577
|
toolCallId: output2.toolCallId,
|
|
3578
|
+
input: output2.input,
|
|
3574
3579
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3575
3580
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3576
3581
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -5969,6 +5974,7 @@ var DefaultStreamTextResult = class {
|
|
|
5969
5974
|
toolName: output2.toolName,
|
|
5970
5975
|
output: await createToolModelOutput({
|
|
5971
5976
|
toolCallId: output2.toolCallId,
|
|
5977
|
+
input: output2.input,
|
|
5972
5978
|
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
5973
5979
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
5974
5980
|
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
@@ -7179,6 +7185,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7179
7185
|
toolName,
|
|
7180
7186
|
output: await createToolModelOutput({
|
|
7181
7187
|
toolCallId: part.toolCallId,
|
|
7188
|
+
input: part.input,
|
|
7182
7189
|
output: part.state === "output-error" ? part.errorText : part.output,
|
|
7183
7190
|
tool: (_b = options == null ? void 0 : options.tools) == null ? void 0 : _b[toolName],
|
|
7184
7191
|
errorMode: part.state === "output-error" ? "json" : "none"
|
|
@@ -7242,6 +7249,7 @@ async function convertToModelMessages(messages, options) {
|
|
|
7242
7249
|
toolName,
|
|
7243
7250
|
output: await createToolModelOutput({
|
|
7244
7251
|
toolCallId: toolPart.toolCallId,
|
|
7252
|
+
input: toolPart.input,
|
|
7245
7253
|
output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
|
|
7246
7254
|
tool: (_f = options == null ? void 0 : options.tools) == null ? void 0 : _f[toolName],
|
|
7247
7255
|
errorMode: toolPart.state === "output-error" ? "text" : "none"
|