Added if statement

This commit is contained in:
Malik 2024-12-07 15:09:19 -05:00
parent 3573fa8e7b
commit 78357f630e

View file

@ -339,7 +339,7 @@ const mainApp = createApp({
endpoint: '/chat/completions',
};
for await (const chunk of llama(prompt, params, config)) {
const stop = chunk.data.stop;
if (chunk.data.choices) {
const addedContent = chunk.data.choices[0].delta.content;
const lastContent = this.pendingMsg.content || '';
if (addedContent) {
@ -350,6 +350,7 @@ const mainApp = createApp({
};
}
}
}
StorageUtils.appendMsg(currConvId, this.pendingMsg);
this.fetchConversation();