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 +15 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +2 -2
- package/src/generate-text/stream-text.ts +9 -5
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.
|
|
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
|
|
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
|
|
6513
|
-
if (
|
|
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
|
-
|
|
6515
|
+
lastPublishedValue = currentValue;
|
|
6516
6516
|
}
|
|
6517
6517
|
}
|
|
6518
6518
|
}
|