Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
Francisco Javier Arceo 2025-08-19 11:43:40 -04:00
parent 39fc124f65
commit 92f2944cdc
2 changed files with 14 additions and 8 deletions

View file

@ -194,9 +194,9 @@ export default function ChatPlaygroundPage() {
);
setInput("");
// Use the helper function with the content
await handleSubmitWithContent(userMessage.content);
};
// Use the helper function with the content
await handleSubmitWithContent(userMessage.content);
};
const handleSubmitWithContent = async (content: string) => {
setIsGenerating(true);
@ -264,11 +264,15 @@ export default function ChatPlaygroundPage() {
createdAt: new Date(),
};
setCurrentSession(prev => prev ? {
...prev,
messages: [...prev.messages, assistantMessage],
updatedAt: Date.now()
} : null);
setCurrentSession(prev =>
prev
? {
...prev,
messages: [...prev.messages, assistantMessage],
updatedAt: Date.now(),
}
: null
);
let fullContent = "";
for await (const chunk of response) {