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/dist/internal/index.js
CHANGED
|
@@ -153,7 +153,7 @@ var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
|
153
153
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
154
154
|
|
|
155
155
|
// src/version.ts
|
|
156
|
-
var VERSION = true ? "6.0.
|
|
156
|
+
var VERSION = true ? "6.0.150" : "0.0.0-test";
|
|
157
157
|
|
|
158
158
|
// src/util/download/download.ts
|
|
159
159
|
var download = async ({
|
package/dist/internal/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.150",
|
|
4
4
|
"description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@opentelemetry/api": "1.9.0",
|
|
48
|
-
"@ai-sdk/gateway": "3.0.
|
|
48
|
+
"@ai-sdk/gateway": "3.0.92",
|
|
49
49
|
"@ai-sdk/provider": "3.0.8",
|
|
50
50
|
"@ai-sdk/provider-utils": "4.0.23"
|
|
51
51
|
},
|
|
@@ -600,7 +600,7 @@ function createOutputTransformStream<
|
|
|
600
600
|
let text = '';
|
|
601
601
|
let textChunk = '';
|
|
602
602
|
let textProviderMetadata: ProviderMetadata | undefined = undefined;
|
|
603
|
-
let
|
|
603
|
+
let lastPublishedValue = '';
|
|
604
604
|
|
|
605
605
|
function publishTextChunk({
|
|
606
606
|
controller,
|
|
@@ -673,11 +673,15 @@ function createOutputTransformStream<
|
|
|
673
673
|
|
|
674
674
|
// null should be allowed (valid JSON value) but undefined should not:
|
|
675
675
|
if (result !== undefined) {
|
|
676
|
-
// only send new
|
|
677
|
-
|
|
678
|
-
|
|
676
|
+
// only send new value if it has changed:
|
|
677
|
+
// For string partials (text output), compare directly to avoid unnecessary JSON.stringify overhead
|
|
678
|
+
const currentValue =
|
|
679
|
+
typeof result.partial === 'string'
|
|
680
|
+
? result.partial
|
|
681
|
+
: JSON.stringify(result.partial);
|
|
682
|
+
if (currentValue !== lastPublishedValue) {
|
|
679
683
|
publishTextChunk({ controller, partialOutput: result.partial });
|
|
680
|
-
|
|
684
|
+
lastPublishedValue = currentValue;
|
|
681
685
|
}
|
|
682
686
|
}
|
|
683
687
|
},
|