ai 6.0.149 → 6.0.151

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/dist/index.mjs CHANGED
@@ -1122,7 +1122,7 @@ import {
1122
1122
  } from "@ai-sdk/provider-utils";
1123
1123
 
1124
1124
  // src/version.ts
1125
- var VERSION = true ? "6.0.149" : "0.0.0-test";
1125
+ var VERSION = true ? "6.0.151" : "0.0.0-test";
1126
1126
 
1127
1127
  // src/util/download/download.ts
1128
1128
  var download = async ({
@@ -6461,7 +6461,7 @@ function createOutputTransformStream(output) {
6461
6461
  let text2 = "";
6462
6462
  let textChunk = "";
6463
6463
  let textProviderMetadata = void 0;
6464
- let lastPublishedJson = "";
6464
+ let lastPublishedValue = "";
6465
6465
  function publishTextChunk({
6466
6466
  controller,
6467
6467
  partialOutput = void 0
@@ -6509,10 +6509,10 @@ function createOutputTransformStream(output) {
6509
6509
  textProviderMetadata = (_a21 = chunk.providerMetadata) != null ? _a21 : textProviderMetadata;
6510
6510
  const result = await output.parsePartialOutput({ text: text2 });
6511
6511
  if (result !== void 0) {
6512
- const currentJson = JSON.stringify(result.partial);
6513
- if (currentJson !== lastPublishedJson) {
6512
+ const currentValue = typeof result.partial === "string" ? result.partial : JSON.stringify(result.partial);
6513
+ if (currentValue !== lastPublishedValue) {
6514
6514
  publishTextChunk({ controller, partialOutput: result.partial });
6515
- lastPublishedJson = currentJson;
6515
+ lastPublishedValue = currentValue;
6516
6516
  }
6517
6517
  }
6518
6518
  }