ai 6.0.148 → 6.0.150
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.150
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1003609: fix(ai): skip stringifying text when streaming partial text
|
|
8
|
+
- Updated dependencies [9de7d7b]
|
|
9
|
+
- @ai-sdk/gateway@3.0.92
|
|
10
|
+
|
|
11
|
+
## 6.0.149
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [3aca847]
|
|
16
|
+
- @ai-sdk/gateway@3.0.91
|
|
17
|
+
|
|
3
18
|
## 6.0.148
|
|
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.
|
|
1234
|
+
var VERSION = true ? "6.0.150" : "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
|
|
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
|
|
6591
|
-
if (
|
|
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
|
-
|
|
6593
|
+
lastPublishedValue = currentValue;
|
|
6594
6594
|
}
|
|
6595
6595
|
}
|
|
6596
6596
|
}
|