Browse Source

feat: title auto-generate for openai apis

Timothy J. Baek 1 year ago
parent
commit
bd84753c6b
1 changed files with 6 additions and 1 deletions
  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);
+			}
 		}
 	};