Compare commits

...

2 Commits

Author SHA1 Message Date
thucpn fdd4a4ef08 check vison model to append empty data 2024-04-05 15:51:28 +07:00
thucpn e2a26d4088 fix: remove empty object at start and end of streaming 2024-04-05 13:55:41 +07:00
2 changed files with 12 additions and 4 deletions
@@ -31,14 +31,18 @@ function createParser(
};
data.append(message);
} else {
data.append({}); // send an empty image response for the user's message
if (process.env.MODEL === "gpt-4-vision-preview") {
data.append({}); // send an empty image response for the user's message
}
}
},
async pull(controller): Promise<void> {
const { value, done } = await it.next();
if (done) {
controller.close();
data.append({}); // send an empty image response for the assistant's message
if (process.env.MODEL === "gpt-4-vision-preview") {
data.append({}); // send an empty image response for the user's message
}
data.close();
return;
}
@@ -31,14 +31,18 @@ function createParser(
};
data.append(message);
} else {
data.append({}); // send an empty image response for the user's message
if (process.env.MODEL === "gpt-4-vision-preview") {
data.append({}); // send an empty image response for the user's message
}
}
},
async pull(controller): Promise<void> {
const { value, done } = await it.next();
if (done) {
controller.close();
data.append({}); // send an empty image response for the assistant's message
if (process.env.MODEL === "gpt-4-vision-preview") {
data.append({}); // send an empty image response for the user's message
}
data.close();
return;
}