Fixup merge

dnd
Stef Dunlap 2023-03-07 21:44:07 -05:00
parent daa97f9d86
commit 0a726b18c8
1 changed files with 8 additions and 10 deletions

View File

@ -98,9 +98,8 @@ async function chatgpt(query, callback) {
try {
let json = JSON.parse(jsonString);
let chunk = json.choices[0].delta.content;
if(!chunk) {
callback(line);
line = '';
if (!chunk) {
callback(context.end_line());
continue;
}
//split the chunk into lines leaving the delimiter in the array
@ -124,9 +123,8 @@ async function chatgpt(query, callback) {
callback(context.end_line());
}
if(line.length > 400) {
callback(line);
line = '';
if (line.length > 400) {
callback(context.end_line());
}
} catch (e) {
console.log(e);