1
0
Fork 0

fix minichat

This commit is contained in:
Pabloader 2026-02-24 07:17:44 +00:00
parent 3f41cea5eb
commit 4d2b1e26f7
2 changed files with 11 additions and 3 deletions

View File

@ -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();

View File

@ -251,7 +251,9 @@ export namespace Connection {
}
}
} catch (e) {
if (!signal.aborted) {
console.error('Error in horde generation:', e);
}
return yield deleteRequest();
}
}