Browse Source

feat: title auto-generate for openai apis

Timothy J. Baek 1 năm trước cách đây
mục cha
commit
bd84753c6b
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/routes/(app)/+page.svelte

+ 6 - 1
src/routes/(app)/+page.svelte

@@ -675,7 +675,12 @@
 
 		if (messages.length == 2) {
 			window.history.replaceState(history.state, '', `/c/${_chatId}`);
-			await setChatTitle(_chatId, userPrompt);
+
+			if ($settings?.titleAutoGenerateModel) {
+				await generateChatTitle(_chatId, userPrompt);
+			} else {
+				await setChatTitle(_chatId, userPrompt);
+			}
 		}
 	};