Added if statement
This commit is contained in:
parent
3573fa8e7b
commit
78357f630e
1 changed files with 10 additions and 9 deletions
|
@ -339,7 +339,7 @@ const mainApp = createApp({
|
||||||
endpoint: '/chat/completions',
|
endpoint: '/chat/completions',
|
||||||
};
|
};
|
||||||
for await (const chunk of llama(prompt, params, config)) {
|
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 addedContent = chunk.data.choices[0].delta.content;
|
||||||
const lastContent = this.pendingMsg.content || '';
|
const lastContent = this.pendingMsg.content || '';
|
||||||
if (addedContent) {
|
if (addedContent) {
|
||||||
|
@ -350,6 +350,7 @@ const mainApp = createApp({
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StorageUtils.appendMsg(currConvId, this.pendingMsg);
|
StorageUtils.appendMsg(currConvId, this.pendingMsg);
|
||||||
this.fetchConversation();
|
this.fetchConversation();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue