ai 4.0.21 → 4.0.23
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 +16 -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/package.json +5 -5
package/dist/index.mjs
CHANGED
@@ -5192,11 +5192,11 @@ function smoothStream({
|
|
5192
5192
|
return;
|
5193
5193
|
}
|
5194
5194
|
buffer += chunk.textDelta;
|
5195
|
-
|
5196
|
-
|
5197
|
-
const
|
5198
|
-
controller.enqueue({ type: "text-delta", textDelta:
|
5199
|
-
buffer = buffer.slice(
|
5195
|
+
const regexp = /\s*\S+\s+/m;
|
5196
|
+
while (regexp.test(buffer)) {
|
5197
|
+
const chunk2 = buffer.match(regexp)[0];
|
5198
|
+
controller.enqueue({ type: "text-delta", textDelta: chunk2 });
|
5199
|
+
buffer = buffer.slice(chunk2.length);
|
5200
5200
|
if (delayInMs > 0) {
|
5201
5201
|
await delay2(delayInMs);
|
5202
5202
|
}
|