Do not erase partial message when generation stopped via button on web app

Previously, we'd replace the generated message with an error message
when message generation stopped via stop button on chat page of web app.
So the partially generated message (which could be useful) gets lost.

This change just stops generation, while keeping the generated
response so any useful information from the partially generated
message can be retrieved.
This commit is contained in:
Debanjum 2024-11-17 16:29:18 -08:00
parent 285006d6c9
commit 48567fd468

View file

@ -303,7 +303,6 @@ export default function Chat() {
const currentMessage = messages.find((message) => !message.completed); const currentMessage = messages.find((message) => !message.completed);
if (!currentMessage) return; if (!currentMessage) return;
currentMessage.rawResponse = `I've stopped processing this message. If you'd like to continue, please send another message.`;
currentMessage.completed = true; currentMessage.completed = true;
setMessages([...messages]); setMessages([...messages]);
setQueryToProcess(""); setQueryToProcess("");