From 4b3e1bb7479b9044e17b5b3926b5a8de4115a388 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 25 Dec 2024 22:51:08 -0800 Subject: [PATCH] refac: title generation logic --- src/lib/components/chat/Chat.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index f22f4c4fc..9bec3934d 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1511,7 +1511,12 @@ chat_id: $chatId, id: responseMessageId, - ...(!$temporaryChatEnabled && messages.length == 1 && selectedModels[0] === model.id + ...(!$temporaryChatEnabled && + (messages.length == 1 || + (messages.length == 2 && + messages.at(0)?.role === 'system' && + messages.at(1)?.role === 'user')) && + selectedModels[0] === model.id ? { background_tasks: { title_generation: $settings?.title?.auto ?? true,