feat: 对话总结标题改为不超过20字

This commit is contained in:
2026-04-26 22:44:44 +08:00
parent 83bdab3205
commit fb09560259
2 changed files with 5 additions and 5 deletions

View File

@@ -1010,7 +1010,7 @@ async function generateConversationTitle() {
`${m.role === 'user' ? '用户' : 'AI'}: ${m.content.slice(0, 200)}`
).join('\n');
const titlePrompt = `请用不超过10个字总结以下对话的主题只输出标题不要其他内容
const titlePrompt = `请用不超过20个字总结以下对话的主题只输出标题不要其他内容
${conversationText}`;
try {
@@ -1039,7 +1039,7 @@ ${conversationText}`;
if (newTitle && newTitle.length > 0) {
// 去掉可能的引号和多余符号
const cleanTitle = newTitle.replace(/^["'"']+|["'"']+$/g, '').trim();
if (cleanTitle.length > 0 && cleanTitle.length <= 20) {
if (cleanTitle.length > 0 && cleanTitle.length <= 30) {
currentConversation.title = cleanTitle;
currentConversation.updatedAt = Date.now();
saveConversations();

View File

@@ -8,12 +8,12 @@
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>AI助手</title>
<link rel="stylesheet" href="style.css?v=2.7.6">
<link rel="stylesheet" href="style.css?v=2.7.7">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="app"></div>
<script src="marked.min.js?v=2.7.6"></script>
<script src="app.js?v=2.7.6"></script>
<script src="marked.min.js?v=2.7.7"></script>
<script src="app.js?v=2.7.7"></script>
</body>
</html>