Fix smooth streaming for 01.AI

This commit is contained in:
Cohee 2024-06-30 22:50:41 +03:00
parent 5dba4fa448
commit ddc3848b26

View File

@ -160,7 +160,7 @@ async function* parseStreamData(json) {
return;
}
// llama.cpp?
else if (typeof json.content === 'string' && json.content.length > 0) {
else if (typeof json.content === 'string' && json.content.length > 0 && json.object !== 'chat.completion.chunk') {
for (let i = 0; i < json.content.length; i++) {
const str = json.content[i];
yield {