fix minichat
This commit is contained in:
parent
3f41cea5eb
commit
4d2b1e26f7
|
|
@ -60,8 +60,14 @@ export const MiniChat = ({ history = [], buttons = {}, open, onClose }: IProps)
|
|||
|
||||
generating.setTrue();
|
||||
for await (const chunk of generate(prompt)) {
|
||||
text += chunk;
|
||||
setMessages(MessageTools.updateSwipe(newMessages, messageId, { content: text.trim() }));
|
||||
text += chunk.text;
|
||||
setMessages(MessageTools.updateSwipe(
|
||||
newMessages,
|
||||
messageId,
|
||||
{
|
||||
content: text.trim(),
|
||||
cost: chunk.cost,
|
||||
}));
|
||||
}
|
||||
generating.setFalse();
|
||||
|
||||
|
|
|
|||
|
|
@ -251,7 +251,9 @@ export namespace Connection {
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (!signal.aborted) {
|
||||
console.error('Error in horde generation:', e);
|
||||
}
|
||||
return yield deleteRequest();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue