ai 5.0.55 → 5.0.56
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 +6 -0
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -768,7 +768,7 @@ function detectMediaType({
|
|
|
768
768
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
769
769
|
|
|
770
770
|
// src/version.ts
|
|
771
|
-
var VERSION = true ? "5.0.
|
|
771
|
+
var VERSION = true ? "5.0.56" : "0.0.0-test";
|
|
772
772
|
|
|
773
773
|
// src/util/download/download.ts
|
|
774
774
|
var download = async ({ url }) => {
|
|
@@ -4656,7 +4656,7 @@ var DefaultStreamTextResult = class {
|
|
|
4656
4656
|
let activeReasoningContent = {};
|
|
4657
4657
|
const eventProcessor = new TransformStream({
|
|
4658
4658
|
async transform(chunk, controller) {
|
|
4659
|
-
var _a17, _b, _c;
|
|
4659
|
+
var _a17, _b, _c, _d;
|
|
4660
4660
|
controller.enqueue(chunk);
|
|
4661
4661
|
const { part } = chunk;
|
|
4662
4662
|
if (part.type === "text-delta" || part.type === "reasoning-delta" || part.type === "source" || part.type === "tool-call" || part.type === "tool-result" || part.type === "tool-input-start" || part.type === "tool-input-delta" || part.type === "raw") {
|
|
@@ -4689,6 +4689,18 @@ var DefaultStreamTextResult = class {
|
|
|
4689
4689
|
activeText.providerMetadata = (_a17 = part.providerMetadata) != null ? _a17 : activeText.providerMetadata;
|
|
4690
4690
|
}
|
|
4691
4691
|
if (part.type === "text-end") {
|
|
4692
|
+
const activeText = activeTextContent[part.id];
|
|
4693
|
+
if (activeText == null) {
|
|
4694
|
+
controller.enqueue({
|
|
4695
|
+
part: {
|
|
4696
|
+
type: "error",
|
|
4697
|
+
error: `text part ${part.id} not found`
|
|
4698
|
+
},
|
|
4699
|
+
partialOutput: void 0
|
|
4700
|
+
});
|
|
4701
|
+
return;
|
|
4702
|
+
}
|
|
4703
|
+
activeText.providerMetadata = (_b = part.providerMetadata) != null ? _b : activeText.providerMetadata;
|
|
4692
4704
|
delete activeTextContent[part.id];
|
|
4693
4705
|
}
|
|
4694
4706
|
if (part.type === "reasoning-start") {
|
|
@@ -4712,7 +4724,7 @@ var DefaultStreamTextResult = class {
|
|
|
4712
4724
|
return;
|
|
4713
4725
|
}
|
|
4714
4726
|
activeReasoning.text += part.text;
|
|
4715
|
-
activeReasoning.providerMetadata = (
|
|
4727
|
+
activeReasoning.providerMetadata = (_c = part.providerMetadata) != null ? _c : activeReasoning.providerMetadata;
|
|
4716
4728
|
}
|
|
4717
4729
|
if (part.type === "reasoning-end") {
|
|
4718
4730
|
const activeReasoning = activeReasoningContent[part.id];
|
|
@@ -4726,7 +4738,7 @@ var DefaultStreamTextResult = class {
|
|
|
4726
4738
|
});
|
|
4727
4739
|
return;
|
|
4728
4740
|
}
|
|
4729
|
-
activeReasoning.providerMetadata = (
|
|
4741
|
+
activeReasoning.providerMetadata = (_d = part.providerMetadata) != null ? _d : activeReasoning.providerMetadata;
|
|
4730
4742
|
delete activeReasoningContent[part.id];
|
|
4731
4743
|
}
|
|
4732
4744
|
if (part.type === "file") {
|