浏览代码

feat: title auto-generate for openai apis

Timothy J. Baek 1 年之前
父节点
当前提交
bd84753c6b
共有 1 个文件被更改,包括 6 次插入1 次删除
  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);
+			}
 		}
 	};