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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.151
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ec18852]
8
+ - @ai-sdk/gateway@3.0.93
9
+
10
+ ## 6.0.150
11
+
12
+ ### Patch Changes
13
+
14
+ - 1003609: fix(ai): skip stringifying text when streaming partial text
15
+ - Updated dependencies [9de7d7b]
16
+ - @ai-sdk/gateway@3.0.92
17
+
3
18
  ## 6.0.149
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1231,7 +1231,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1231
1231
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1232
1232
 
1233
1233
  // src/version.ts
1234
- var VERSION = true ? "6.0.149" : "0.0.0-test";
1234
+ var VERSION = true ? "6.0.151" : "0.0.0-test";
1235
1235
 
1236
1236
  // src/util/download/download.ts
1237
1237
  var download = async ({
@@ -6539,7 +6539,7 @@ function createOutputTransformStream(output) {
6539
6539
  let text2 = "";
6540
6540
  let textChunk = "";
6541
6541
  let textProviderMetadata = void 0;
6542
- let lastPublishedJson = "";
6542
+ let lastPublishedValue = "";
6543
6543
  function publishTextChunk({
6544
6544
  controller,
6545
6545
  partialOutput = void 0
@@ -6587,10 +6587,10 @@ function createOutputTransformStream(output) {
6587
6587
  textProviderMetadata = (_a21 = chunk.providerMetadata) != null ? _a21 : textProviderMetadata;
6588
6588
  const result = await output.parsePartialOutput({ text: text2 });
6589
6589
  if (result !== void 0) {
6590
- const currentJson = JSON.stringify(result.partial);
6591
- if (currentJson !== lastPublishedJson) {
6590
+ const currentValue = typeof result.partial === "string" ? result.partial : JSON.stringify(result.partial);
6591
+ if (currentValue !== lastPublishedValue) {
6592
6592
  publishTextChunk({ controller, partialOutput: result.partial });
6593
- lastPublishedJson = currentJson;
6593
+ lastPublishedValue = currentValue;
6594
6594
  }
6595
6595
  }
6596
6596
  }