ai 6.0.0-beta.152 → 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 +18 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +179 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -149
- 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/dist/index.mjs
CHANGED
|
@@ -866,7 +866,7 @@ import {
|
|
|
866
866
|
} from "@ai-sdk/provider-utils";
|
|
867
867
|
|
|
868
868
|
// src/version.ts
|
|
869
|
-
var VERSION = true ? "6.0.0-beta.
|
|
869
|
+
var VERSION = true ? "6.0.0-beta.154" : "0.0.0-test";
|
|
870
870
|
|
|
871
871
|
// src/util/download/download.ts
|
|
872
872
|
var download = async ({ url }) => {
|
|
@@ -1279,7 +1279,8 @@ function mapToolResultOutput(output) {
|
|
|
1279
1279
|
|
|
1280
1280
|
// src/prompt/create-tool-model-output.ts
|
|
1281
1281
|
import { getErrorMessage as getErrorMessage3 } from "@ai-sdk/provider";
|
|
1282
|
-
function createToolModelOutput({
|
|
1282
|
+
async function createToolModelOutput({
|
|
1283
|
+
toolCallId,
|
|
1283
1284
|
output,
|
|
1284
1285
|
tool: tool2,
|
|
1285
1286
|
errorMode
|
|
@@ -1290,7 +1291,7 @@ function createToolModelOutput({
|
|
|
1290
1291
|
return { type: "error-json", value: toJSONValue(output) };
|
|
1291
1292
|
}
|
|
1292
1293
|
if (tool2 == null ? void 0 : tool2.toModelOutput) {
|
|
1293
|
-
return tool2.toModelOutput({ output });
|
|
1294
|
+
return await tool2.toModelOutput({ toolCallId, output });
|
|
1294
1295
|
}
|
|
1295
1296
|
return typeof output === "string" ? { type: "text", value: output } : { type: "json", value: toJSONValue(output) };
|
|
1296
1297
|
}
|
|
@@ -3273,93 +3274,115 @@ async function isStopConditionMet({
|
|
|
3273
3274
|
}
|
|
3274
3275
|
|
|
3275
3276
|
// src/generate-text/to-response-messages.ts
|
|
3276
|
-
function toResponseMessages({
|
|
3277
|
+
async function toResponseMessages({
|
|
3277
3278
|
content: inputContent,
|
|
3278
3279
|
tools
|
|
3279
3280
|
}) {
|
|
3280
3281
|
const responseMessages = [];
|
|
3281
|
-
const content =
|
|
3282
|
-
|
|
3283
|
-
|
|
3282
|
+
const content = [];
|
|
3283
|
+
for (const part of inputContent) {
|
|
3284
|
+
if (part.type === "source" || (part.type === "tool-result" || part.type === "tool-error") && !part.providerExecuted || part.type === "text" && part.text.length === 0) {
|
|
3285
|
+
continue;
|
|
3286
|
+
}
|
|
3284
3287
|
switch (part.type) {
|
|
3285
3288
|
case "text":
|
|
3286
|
-
|
|
3289
|
+
content.push({
|
|
3287
3290
|
type: "text",
|
|
3288
3291
|
text: part.text,
|
|
3289
3292
|
providerOptions: part.providerMetadata
|
|
3290
|
-
};
|
|
3293
|
+
});
|
|
3294
|
+
break;
|
|
3291
3295
|
case "reasoning":
|
|
3292
|
-
|
|
3296
|
+
content.push({
|
|
3293
3297
|
type: "reasoning",
|
|
3294
3298
|
text: part.text,
|
|
3295
3299
|
providerOptions: part.providerMetadata
|
|
3296
|
-
};
|
|
3300
|
+
});
|
|
3301
|
+
break;
|
|
3297
3302
|
case "file":
|
|
3298
|
-
|
|
3303
|
+
content.push({
|
|
3299
3304
|
type: "file",
|
|
3300
3305
|
data: part.file.base64,
|
|
3301
3306
|
mediaType: part.file.mediaType,
|
|
3302
3307
|
providerOptions: part.providerMetadata
|
|
3303
|
-
};
|
|
3308
|
+
});
|
|
3309
|
+
break;
|
|
3304
3310
|
case "tool-call":
|
|
3305
|
-
|
|
3311
|
+
content.push({
|
|
3306
3312
|
type: "tool-call",
|
|
3307
3313
|
toolCallId: part.toolCallId,
|
|
3308
3314
|
toolName: part.toolName,
|
|
3309
3315
|
input: part.input,
|
|
3310
3316
|
providerExecuted: part.providerExecuted,
|
|
3311
3317
|
providerOptions: part.providerMetadata
|
|
3312
|
-
};
|
|
3313
|
-
|
|
3314
|
-
|
|
3318
|
+
});
|
|
3319
|
+
break;
|
|
3320
|
+
case "tool-result": {
|
|
3321
|
+
const output = await createToolModelOutput({
|
|
3322
|
+
toolCallId: part.toolCallId,
|
|
3323
|
+
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3324
|
+
output: part.output,
|
|
3325
|
+
errorMode: "none"
|
|
3326
|
+
});
|
|
3327
|
+
content.push({
|
|
3315
3328
|
type: "tool-result",
|
|
3316
3329
|
toolCallId: part.toolCallId,
|
|
3317
3330
|
toolName: part.toolName,
|
|
3318
|
-
output
|
|
3319
|
-
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3320
|
-
output: part.output,
|
|
3321
|
-
errorMode: "none"
|
|
3322
|
-
}),
|
|
3323
|
-
providerExecuted: true,
|
|
3331
|
+
output,
|
|
3324
3332
|
providerOptions: part.providerMetadata
|
|
3325
|
-
};
|
|
3326
|
-
|
|
3327
|
-
|
|
3333
|
+
});
|
|
3334
|
+
break;
|
|
3335
|
+
}
|
|
3336
|
+
case "tool-error": {
|
|
3337
|
+
const output = await createToolModelOutput({
|
|
3338
|
+
toolCallId: part.toolCallId,
|
|
3339
|
+
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3340
|
+
output: part.error,
|
|
3341
|
+
errorMode: "json"
|
|
3342
|
+
});
|
|
3343
|
+
content.push({
|
|
3328
3344
|
type: "tool-result",
|
|
3329
3345
|
toolCallId: part.toolCallId,
|
|
3330
3346
|
toolName: part.toolName,
|
|
3331
|
-
output
|
|
3332
|
-
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3333
|
-
output: part.error,
|
|
3334
|
-
errorMode: "json"
|
|
3335
|
-
}),
|
|
3347
|
+
output,
|
|
3336
3348
|
providerOptions: part.providerMetadata
|
|
3337
|
-
};
|
|
3349
|
+
});
|
|
3350
|
+
break;
|
|
3351
|
+
}
|
|
3338
3352
|
case "tool-approval-request":
|
|
3339
|
-
|
|
3353
|
+
content.push({
|
|
3340
3354
|
type: "tool-approval-request",
|
|
3341
3355
|
approvalId: part.approvalId,
|
|
3342
3356
|
toolCallId: part.toolCall.toolCallId
|
|
3343
|
-
};
|
|
3357
|
+
});
|
|
3358
|
+
break;
|
|
3344
3359
|
}
|
|
3345
|
-
}
|
|
3360
|
+
}
|
|
3346
3361
|
if (content.length > 0) {
|
|
3347
3362
|
responseMessages.push({
|
|
3348
3363
|
role: "assistant",
|
|
3349
3364
|
content
|
|
3350
3365
|
});
|
|
3351
3366
|
}
|
|
3352
|
-
const toolResultContent =
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3367
|
+
const toolResultContent = [];
|
|
3368
|
+
for (const part of inputContent) {
|
|
3369
|
+
if (!(part.type === "tool-result" || part.type === "tool-error") || part.providerExecuted) {
|
|
3370
|
+
continue;
|
|
3371
|
+
}
|
|
3372
|
+
const output = await createToolModelOutput({
|
|
3373
|
+
toolCallId: part.toolCallId,
|
|
3374
|
+
tool: tools == null ? void 0 : tools[part.toolName],
|
|
3375
|
+
output: part.type === "tool-result" ? part.output : part.error,
|
|
3376
|
+
errorMode: part.type === "tool-error" ? "text" : "none"
|
|
3377
|
+
});
|
|
3378
|
+
toolResultContent.push({
|
|
3379
|
+
type: "tool-result",
|
|
3380
|
+
toolCallId: part.toolCallId,
|
|
3381
|
+
toolName: part.toolName,
|
|
3382
|
+
output,
|
|
3383
|
+
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
3384
|
+
});
|
|
3385
|
+
}
|
|
3363
3386
|
if (toolResultContent.length > 0) {
|
|
3364
3387
|
responseMessages.push({
|
|
3365
3388
|
role: "tool",
|
|
@@ -3465,31 +3488,35 @@ async function generateText({
|
|
|
3465
3488
|
abortSignal,
|
|
3466
3489
|
experimental_context
|
|
3467
3490
|
});
|
|
3491
|
+
const toolContent = [];
|
|
3492
|
+
for (const output2 of toolOutputs) {
|
|
3493
|
+
const modelOutput = await createToolModelOutput({
|
|
3494
|
+
toolCallId: output2.toolCallId,
|
|
3495
|
+
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3496
|
+
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3497
|
+
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
3498
|
+
});
|
|
3499
|
+
toolContent.push({
|
|
3500
|
+
type: "tool-result",
|
|
3501
|
+
toolCallId: output2.toolCallId,
|
|
3502
|
+
toolName: output2.toolName,
|
|
3503
|
+
output: modelOutput
|
|
3504
|
+
});
|
|
3505
|
+
}
|
|
3506
|
+
for (const toolApproval of deniedToolApprovals) {
|
|
3507
|
+
toolContent.push({
|
|
3508
|
+
type: "tool-result",
|
|
3509
|
+
toolCallId: toolApproval.toolCall.toolCallId,
|
|
3510
|
+
toolName: toolApproval.toolCall.toolName,
|
|
3511
|
+
output: {
|
|
3512
|
+
type: "execution-denied",
|
|
3513
|
+
reason: toolApproval.approvalResponse.reason
|
|
3514
|
+
}
|
|
3515
|
+
});
|
|
3516
|
+
}
|
|
3468
3517
|
responseMessages.push({
|
|
3469
3518
|
role: "tool",
|
|
3470
|
-
content:
|
|
3471
|
-
// add regular tool results for approved tool calls:
|
|
3472
|
-
...toolOutputs.map((output2) => ({
|
|
3473
|
-
type: "tool-result",
|
|
3474
|
-
toolCallId: output2.toolCallId,
|
|
3475
|
-
toolName: output2.toolName,
|
|
3476
|
-
output: createToolModelOutput({
|
|
3477
|
-
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
3478
|
-
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
3479
|
-
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
3480
|
-
})
|
|
3481
|
-
})),
|
|
3482
|
-
// add execution denied tool results for denied tool approvals:
|
|
3483
|
-
...deniedToolApprovals.map((toolApproval) => ({
|
|
3484
|
-
type: "tool-result",
|
|
3485
|
-
toolCallId: toolApproval.toolCall.toolCallId,
|
|
3486
|
-
toolName: toolApproval.toolCall.toolName,
|
|
3487
|
-
output: {
|
|
3488
|
-
type: "execution-denied",
|
|
3489
|
-
reason: toolApproval.approvalResponse.reason
|
|
3490
|
-
}
|
|
3491
|
-
}))
|
|
3492
|
-
]
|
|
3519
|
+
content: toolContent
|
|
3493
3520
|
});
|
|
3494
3521
|
}
|
|
3495
3522
|
const callSettings2 = prepareCallSettings(settings);
|
|
@@ -3702,7 +3729,7 @@ async function generateText({
|
|
|
3702
3729
|
toolApprovalRequests: Object.values(toolApprovalRequests)
|
|
3703
3730
|
});
|
|
3704
3731
|
responseMessages.push(
|
|
3705
|
-
...toResponseMessages({
|
|
3732
|
+
...await toResponseMessages({
|
|
3706
3733
|
content: stepContent,
|
|
3707
3734
|
tools
|
|
3708
3735
|
})
|
|
@@ -5639,7 +5666,7 @@ var DefaultStreamTextResult = class {
|
|
|
5639
5666
|
recordedWarnings = part.warnings;
|
|
5640
5667
|
}
|
|
5641
5668
|
if (part.type === "finish-step") {
|
|
5642
|
-
const stepMessages = toResponseMessages({
|
|
5669
|
+
const stepMessages = await toResponseMessages({
|
|
5643
5670
|
content: recordedContent,
|
|
5644
5671
|
tools
|
|
5645
5672
|
});
|
|
@@ -5863,31 +5890,34 @@ var DefaultStreamTextResult = class {
|
|
|
5863
5890
|
}
|
|
5864
5891
|
})
|
|
5865
5892
|
);
|
|
5893
|
+
const content = [];
|
|
5894
|
+
for (const output2 of toolOutputs) {
|
|
5895
|
+
content.push({
|
|
5896
|
+
type: "tool-result",
|
|
5897
|
+
toolCallId: output2.toolCallId,
|
|
5898
|
+
toolName: output2.toolName,
|
|
5899
|
+
output: await createToolModelOutput({
|
|
5900
|
+
toolCallId: output2.toolCallId,
|
|
5901
|
+
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
5902
|
+
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
5903
|
+
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
5904
|
+
})
|
|
5905
|
+
});
|
|
5906
|
+
}
|
|
5907
|
+
for (const toolApproval of deniedToolApprovals) {
|
|
5908
|
+
content.push({
|
|
5909
|
+
type: "tool-result",
|
|
5910
|
+
toolCallId: toolApproval.toolCall.toolCallId,
|
|
5911
|
+
toolName: toolApproval.toolCall.toolName,
|
|
5912
|
+
output: {
|
|
5913
|
+
type: "execution-denied",
|
|
5914
|
+
reason: toolApproval.approvalResponse.reason
|
|
5915
|
+
}
|
|
5916
|
+
});
|
|
5917
|
+
}
|
|
5866
5918
|
initialResponseMessages.push({
|
|
5867
5919
|
role: "tool",
|
|
5868
|
-
content
|
|
5869
|
-
// add regular tool results for approved tool calls:
|
|
5870
|
-
...toolOutputs.map((output2) => ({
|
|
5871
|
-
type: "tool-result",
|
|
5872
|
-
toolCallId: output2.toolCallId,
|
|
5873
|
-
toolName: output2.toolName,
|
|
5874
|
-
output: createToolModelOutput({
|
|
5875
|
-
tool: tools == null ? void 0 : tools[output2.toolName],
|
|
5876
|
-
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
5877
|
-
errorMode: output2.type === "tool-error" ? "json" : "none"
|
|
5878
|
-
})
|
|
5879
|
-
})),
|
|
5880
|
-
// add execution denied tool results for denied tool approvals:
|
|
5881
|
-
...deniedToolApprovals.map((toolApproval) => ({
|
|
5882
|
-
type: "tool-result",
|
|
5883
|
-
toolCallId: toolApproval.toolCall.toolCallId,
|
|
5884
|
-
toolName: toolApproval.toolCall.toolName,
|
|
5885
|
-
output: {
|
|
5886
|
-
type: "execution-denied",
|
|
5887
|
-
reason: toolApproval.approvalResponse.reason
|
|
5888
|
-
}
|
|
5889
|
-
}))
|
|
5890
|
-
]
|
|
5920
|
+
content
|
|
5891
5921
|
});
|
|
5892
5922
|
} finally {
|
|
5893
5923
|
toolExecutionStepStreamController == null ? void 0 : toolExecutionStepStreamController.close();
|
|
@@ -6235,7 +6265,7 @@ var DefaultStreamTextResult = class {
|
|
|
6235
6265
|
steps: recordedSteps
|
|
6236
6266
|
})) {
|
|
6237
6267
|
responseMessages.push(
|
|
6238
|
-
...toResponseMessages({
|
|
6268
|
+
...await toResponseMessages({
|
|
6239
6269
|
content: (
|
|
6240
6270
|
// use transformed content to create the messages for the next step:
|
|
6241
6271
|
recordedSteps[recordedSteps.length - 1].content
|
|
@@ -6969,7 +6999,7 @@ function readUIMessageStream({
|
|
|
6969
6999
|
import {
|
|
6970
7000
|
isNonNullable
|
|
6971
7001
|
} from "@ai-sdk/provider-utils";
|
|
6972
|
-
function convertToModelMessages(messages, options) {
|
|
7002
|
+
async function convertToModelMessages(messages, options) {
|
|
6973
7003
|
const modelMessages = [];
|
|
6974
7004
|
if (options == null ? void 0 : options.ignoreIncompleteToolCalls) {
|
|
6975
7005
|
messages = messages.map((message) => ({
|
|
@@ -7031,8 +7061,9 @@ function convertToModelMessages(messages, options) {
|
|
|
7031
7061
|
}
|
|
7032
7062
|
case "assistant": {
|
|
7033
7063
|
if (message.parts != null) {
|
|
7034
|
-
let
|
|
7035
|
-
|
|
7064
|
+
let block = [];
|
|
7065
|
+
async function processBlock() {
|
|
7066
|
+
var _a15, _b, _c, _d, _e, _f;
|
|
7036
7067
|
if (block.length === 0) {
|
|
7037
7068
|
return;
|
|
7038
7069
|
}
|
|
@@ -7080,7 +7111,8 @@ function convertToModelMessages(messages, options) {
|
|
|
7080
7111
|
type: "tool-result",
|
|
7081
7112
|
toolCallId: part.toolCallId,
|
|
7082
7113
|
toolName,
|
|
7083
|
-
output: createToolModelOutput({
|
|
7114
|
+
output: await createToolModelOutput({
|
|
7115
|
+
toolCallId: part.toolCallId,
|
|
7084
7116
|
output: part.state === "output-error" ? part.errorText : part.output,
|
|
7085
7117
|
tool: (_b = options == null ? void 0 : options.tools) == null ? void 0 : _b[toolName],
|
|
7086
7118
|
errorMode: part.state === "output-error" ? "json" : "none"
|
|
@@ -7110,68 +7142,66 @@ function convertToModelMessages(messages, options) {
|
|
|
7110
7142
|
(part) => isToolUIPart(part) && part.providerExecuted !== true
|
|
7111
7143
|
);
|
|
7112
7144
|
if (toolParts.length > 0) {
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
(toolPart)
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7145
|
+
{
|
|
7146
|
+
const content2 = [];
|
|
7147
|
+
for (const toolPart of toolParts) {
|
|
7148
|
+
if (((_d = toolPart.approval) == null ? void 0 : _d.approved) != null) {
|
|
7149
|
+
content2.push({
|
|
7150
|
+
type: "tool-approval-response",
|
|
7151
|
+
approvalId: toolPart.approval.id,
|
|
7152
|
+
approved: toolPart.approval.approved,
|
|
7153
|
+
reason: toolPart.approval.reason
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
switch (toolPart.state) {
|
|
7157
|
+
case "output-denied": {
|
|
7158
|
+
content2.push({
|
|
7159
|
+
type: "tool-result",
|
|
7160
|
+
toolCallId: toolPart.toolCallId,
|
|
7161
|
+
toolName: getToolName(toolPart),
|
|
7162
|
+
output: {
|
|
7163
|
+
type: "error-text",
|
|
7164
|
+
value: (_e = toolPart.approval.reason) != null ? _e : "Tool execution denied."
|
|
7165
|
+
},
|
|
7166
|
+
...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}
|
|
7125
7167
|
});
|
|
7168
|
+
break;
|
|
7126
7169
|
}
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
value: (_b2 = toolPart.approval.reason) != null ? _b2 : "Tool execution denied."
|
|
7136
|
-
},
|
|
7137
|
-
...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}
|
|
7138
|
-
});
|
|
7139
|
-
break;
|
|
7140
|
-
}
|
|
7141
|
-
case "output-error":
|
|
7142
|
-
case "output-available": {
|
|
7143
|
-
const toolName = getToolName(toolPart);
|
|
7144
|
-
outputs.push({
|
|
7145
|
-
type: "tool-result",
|
|
7170
|
+
case "output-error":
|
|
7171
|
+
case "output-available": {
|
|
7172
|
+
const toolName = getToolName(toolPart);
|
|
7173
|
+
content2.push({
|
|
7174
|
+
type: "tool-result",
|
|
7175
|
+
toolCallId: toolPart.toolCallId,
|
|
7176
|
+
toolName,
|
|
7177
|
+
output: await createToolModelOutput({
|
|
7146
7178
|
toolCallId: toolPart.toolCallId,
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
});
|
|
7155
|
-
break;
|
|
7156
|
-
}
|
|
7179
|
+
output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
|
|
7180
|
+
tool: (_f = options == null ? void 0 : options.tools) == null ? void 0 : _f[toolName],
|
|
7181
|
+
errorMode: toolPart.state === "output-error" ? "text" : "none"
|
|
7182
|
+
}),
|
|
7183
|
+
...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}
|
|
7184
|
+
});
|
|
7185
|
+
break;
|
|
7157
7186
|
}
|
|
7158
|
-
return outputs;
|
|
7159
7187
|
}
|
|
7160
|
-
|
|
7161
|
-
|
|
7188
|
+
}
|
|
7189
|
+
modelMessages.push({
|
|
7190
|
+
role: "tool",
|
|
7191
|
+
content: content2
|
|
7192
|
+
});
|
|
7193
|
+
}
|
|
7162
7194
|
}
|
|
7163
7195
|
block = [];
|
|
7164
|
-
}
|
|
7165
|
-
var processBlock = processBlock2;
|
|
7166
|
-
let block = [];
|
|
7196
|
+
}
|
|
7167
7197
|
for (const part of message.parts) {
|
|
7168
7198
|
if (isTextUIPart(part) || isReasoningUIPart(part) || isFileUIPart(part) || isToolUIPart(part) || isDataUIPart(part)) {
|
|
7169
7199
|
block.push(part);
|
|
7170
7200
|
} else if (part.type === "step-start") {
|
|
7171
|
-
|
|
7201
|
+
await processBlock();
|
|
7172
7202
|
}
|
|
7173
7203
|
}
|
|
7174
|
-
|
|
7204
|
+
await processBlock();
|
|
7175
7205
|
break;
|
|
7176
7206
|
}
|
|
7177
7207
|
break;
|
|
@@ -7581,7 +7611,7 @@ async function createAgentUIStream({
|
|
|
7581
7611
|
messages,
|
|
7582
7612
|
tools: agent.tools
|
|
7583
7613
|
});
|
|
7584
|
-
const modelMessages = convertToModelMessages(validatedMessages, {
|
|
7614
|
+
const modelMessages = await convertToModelMessages(validatedMessages, {
|
|
7585
7615
|
tools: agent.tools
|
|
7586
7616
|
});
|
|
7587
7617
|
const result = await agent.stream({
|