refac: title generation logic

This commit is contained in:
Timothy Jaeryang Baek 2024-12-25 22:51:08 -08:00
parent 96a06effe2
commit 4b3e1bb747

View File

@ -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,