@langchain/google-common 0.0.25 → 0.0.26
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/dist/utils/stream.cjs +2 -2
- package/dist/utils/stream.js +2 -2
- package/package.json +1 -1
package/dist/utils/stream.cjs
CHANGED
|
@@ -277,7 +277,7 @@ class ReadableJsonStream extends JsonStream {
|
|
|
277
277
|
writable: true,
|
|
278
278
|
value: void 0
|
|
279
279
|
});
|
|
280
|
-
this.decoder = new TextDecoder();
|
|
280
|
+
this.decoder = new TextDecoder("utf-8");
|
|
281
281
|
if (body) {
|
|
282
282
|
void this.run(body);
|
|
283
283
|
}
|
|
@@ -291,7 +291,7 @@ class ReadableJsonStream extends JsonStream {
|
|
|
291
291
|
while (!isDone) {
|
|
292
292
|
const { value, done } = await reader.read();
|
|
293
293
|
if (!done) {
|
|
294
|
-
const svalue = this.decoder.decode(value);
|
|
294
|
+
const svalue = this.decoder.decode(value, { stream: true });
|
|
295
295
|
this.appendBuffer(svalue);
|
|
296
296
|
}
|
|
297
297
|
else {
|
package/dist/utils/stream.js
CHANGED
|
@@ -270,7 +270,7 @@ export class ReadableJsonStream extends JsonStream {
|
|
|
270
270
|
writable: true,
|
|
271
271
|
value: void 0
|
|
272
272
|
});
|
|
273
|
-
this.decoder = new TextDecoder();
|
|
273
|
+
this.decoder = new TextDecoder("utf-8");
|
|
274
274
|
if (body) {
|
|
275
275
|
void this.run(body);
|
|
276
276
|
}
|
|
@@ -284,7 +284,7 @@ export class ReadableJsonStream extends JsonStream {
|
|
|
284
284
|
while (!isDone) {
|
|
285
285
|
const { value, done } = await reader.read();
|
|
286
286
|
if (!done) {
|
|
287
|
-
const svalue = this.decoder.decode(value);
|
|
287
|
+
const svalue = this.decoder.decode(value, { stream: true });
|
|
288
288
|
this.appendBuffer(svalue);
|
|
289
289
|
}
|
|
290
290
|
else {
|