mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
simple mode tool reason (#3984)
* simple mode tool reason * model config cannot set empty * perf: read files code * perf: mongo gridfs chunks * perf: doc
This commit is contained in:
@@ -43,13 +43,13 @@ export async function text2Speech({
|
||||
const readableStream = response.body as unknown as NodeJS.ReadableStream;
|
||||
readableStream.pipe(res);
|
||||
|
||||
let bufferStore = Buffer.from([]);
|
||||
const chunks: Uint8Array[] = [];
|
||||
|
||||
readableStream.on('data', (chunk) => {
|
||||
bufferStore = Buffer.concat([bufferStore, chunk]);
|
||||
chunks.push(chunk);
|
||||
});
|
||||
readableStream.on('end', () => {
|
||||
onSuccess({ model, buffer: bufferStore });
|
||||
onSuccess({ model, buffer: Buffer.concat(chunks) });
|
||||
});
|
||||
readableStream.on('error', (e) => {
|
||||
onError(e);
|
||||
|
Reference in New Issue
Block a user