ai 7.0.0-beta.21 → 7.0.0-beta.22
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 +7 -0
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -37
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +6 -0
- package/docs/03-ai-sdk-core/35-image-generation.mdx +1 -1
- package/docs/03-ai-sdk-core/40-middleware.mdx +13 -13
- package/docs/03-ai-sdk-core/55-testing.mdx +10 -10
- package/docs/03-ai-sdk-core/65-event-listeners.mdx +1 -1
- package/docs/06-advanced/04-caching.mdx +10 -10
- package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +3 -3
- package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +3 -3
- package/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +7 -0
- package/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +2 -2
- package/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +4 -4
- package/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +4 -4
- package/docs/07-reference/01-ai-sdk-core/65-language-model-v2-middleware.mdx +9 -9
- package/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/68-default-settings-middleware.mdx +1 -1
- package/docs/08-migration-guides/23-migration-guide-7-0.mdx +29 -0
- package/docs/09-troubleshooting/30-model-is-not-assignable-to-type.mdx +1 -1
- package/package.json +2 -2
- package/src/generate-text/create-stream-text-part-transform.ts +64 -12
- package/src/generate-text/run-tools-transformation.ts +34 -53
- package/src/telemetry/open-telemetry-integration.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1377,7 +1377,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
|
1377
1377
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
1378
1378
|
|
|
1379
1379
|
// src/version.ts
|
|
1380
|
-
var VERSION = true ? "7.0.0-beta.
|
|
1380
|
+
var VERSION = true ? "7.0.0-beta.22" : "0.0.0-test";
|
|
1381
1381
|
|
|
1382
1382
|
// src/util/download/download.ts
|
|
1383
1383
|
var download = async ({
|
|
@@ -6490,15 +6490,38 @@ function createStitchableStream() {
|
|
|
6490
6490
|
function createStreamTextPartTransform() {
|
|
6491
6491
|
return new TransformStream({
|
|
6492
6492
|
async transform(chunk, controller) {
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6493
|
+
switch (chunk.type) {
|
|
6494
|
+
case "text-delta":
|
|
6495
|
+
controller.enqueue({
|
|
6496
|
+
type: "text-delta",
|
|
6497
|
+
id: chunk.id,
|
|
6498
|
+
text: chunk.delta,
|
|
6499
|
+
providerMetadata: chunk.providerMetadata
|
|
6500
|
+
});
|
|
6501
|
+
break;
|
|
6502
|
+
case "reasoning-delta":
|
|
6503
|
+
controller.enqueue({
|
|
6504
|
+
type: "reasoning-delta",
|
|
6505
|
+
id: chunk.id,
|
|
6506
|
+
text: chunk.delta,
|
|
6507
|
+
providerMetadata: chunk.providerMetadata
|
|
6508
|
+
});
|
|
6509
|
+
break;
|
|
6510
|
+
case "file":
|
|
6511
|
+
case "reasoning-file": {
|
|
6512
|
+
controller.enqueue({
|
|
6513
|
+
type: chunk.type,
|
|
6514
|
+
file: new DefaultGeneratedFileWithType({
|
|
6515
|
+
data: chunk.data,
|
|
6516
|
+
mediaType: chunk.mediaType
|
|
6517
|
+
}),
|
|
6518
|
+
providerMetadata: chunk.providerMetadata
|
|
6519
|
+
});
|
|
6520
|
+
break;
|
|
6521
|
+
}
|
|
6522
|
+
default:
|
|
6523
|
+
controller.enqueue(chunk);
|
|
6524
|
+
break;
|
|
6502
6525
|
}
|
|
6503
6526
|
}
|
|
6504
6527
|
});
|
|
@@ -6552,10 +6575,13 @@ function runToolsTransformation({
|
|
|
6552
6575
|
case "text-delta":
|
|
6553
6576
|
case "text-end":
|
|
6554
6577
|
case "reasoning-start":
|
|
6578
|
+
case "reasoning-delta":
|
|
6555
6579
|
case "reasoning-end":
|
|
6556
6580
|
case "tool-input-start":
|
|
6557
6581
|
case "tool-input-delta":
|
|
6558
6582
|
case "tool-input-end":
|
|
6583
|
+
case "file":
|
|
6584
|
+
case "reasoning-file":
|
|
6559
6585
|
case "source":
|
|
6560
6586
|
case "response-metadata":
|
|
6561
6587
|
case "error":
|
|
@@ -6563,26 +6589,6 @@ function runToolsTransformation({
|
|
|
6563
6589
|
controller.enqueue(chunk);
|
|
6564
6590
|
break;
|
|
6565
6591
|
}
|
|
6566
|
-
case "reasoning-delta":
|
|
6567
|
-
controller.enqueue({
|
|
6568
|
-
type: "reasoning-delta",
|
|
6569
|
-
id: chunk.id,
|
|
6570
|
-
text: chunk.delta,
|
|
6571
|
-
providerMetadata: chunk.providerMetadata
|
|
6572
|
-
});
|
|
6573
|
-
break;
|
|
6574
|
-
case "file":
|
|
6575
|
-
case "reasoning-file": {
|
|
6576
|
-
controller.enqueue({
|
|
6577
|
-
type: chunk.type,
|
|
6578
|
-
file: new DefaultGeneratedFileWithType({
|
|
6579
|
-
data: chunk.data,
|
|
6580
|
-
mediaType: chunk.mediaType
|
|
6581
|
-
}),
|
|
6582
|
-
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
6583
|
-
});
|
|
6584
|
-
break;
|
|
6585
|
-
}
|
|
6586
6592
|
case "finish": {
|
|
6587
6593
|
finishChunk = {
|
|
6588
6594
|
type: "finish",
|
|
@@ -6701,8 +6707,8 @@ function runToolsTransformation({
|
|
|
6701
6707
|
}
|
|
6702
6708
|
case "tool-result": {
|
|
6703
6709
|
const toolName = chunk.toolName;
|
|
6704
|
-
|
|
6705
|
-
|
|
6710
|
+
controller.enqueue(
|
|
6711
|
+
chunk.isError ? {
|
|
6706
6712
|
type: "tool-error",
|
|
6707
6713
|
toolCallId: chunk.toolCallId,
|
|
6708
6714
|
toolName,
|
|
@@ -6711,9 +6717,7 @@ function runToolsTransformation({
|
|
|
6711
6717
|
error: chunk.result,
|
|
6712
6718
|
dynamic: chunk.dynamic,
|
|
6713
6719
|
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
6714
|
-
}
|
|
6715
|
-
} else {
|
|
6716
|
-
controller.enqueue({
|
|
6720
|
+
} : {
|
|
6717
6721
|
type: "tool-result",
|
|
6718
6722
|
toolCallId: chunk.toolCallId,
|
|
6719
6723
|
toolName,
|
|
@@ -6722,8 +6726,8 @@ function runToolsTransformation({
|
|
|
6722
6726
|
providerExecuted: true,
|
|
6723
6727
|
dynamic: chunk.dynamic,
|
|
6724
6728
|
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
6725
|
-
}
|
|
6726
|
-
|
|
6729
|
+
}
|
|
6730
|
+
);
|
|
6727
6731
|
break;
|
|
6728
6732
|
}
|
|
6729
6733
|
default: {
|