From 1241bc3e89239814149dc05352ae5e1f80d35151 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 10 Jun 2024 17:58:07 -0700 Subject: [PATCH] fix: regeneration --- src/lib/components/chat/Chat.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 47e1075df..1a0b0d894 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -365,7 +365,7 @@ return _responses; }; - const sendPrompt = async (prompt, parentId, modelId = null) => { + const sendPrompt = async (prompt, parentId, modelId = null, newChat = true) => { let _responses = []; // If modelId is provided, use it, else use selected model @@ -412,7 +412,7 @@ await tick(); // Create new chat if only one message in messages - if (messages.length == 2) { + if (newChat && messages.length == 2) { if ($settings.saveChatHistory ?? true) { chat = await createNewChat(localStorage.token, { id: $chatId, @@ -1116,9 +1116,9 @@ let userPrompt = userMessage.content; if ((userMessage?.models ?? [...selectedModels]).length == 1) { - await sendPrompt(userPrompt, userMessage.id); + await sendPrompt(userPrompt, userMessage.id, undefined, false); } else { - await sendPrompt(userPrompt, userMessage.id, message.model); + await sendPrompt(userPrompt, userMessage.id, message.model, false); } } };