feat:自定义历史聊天标题 (#41)
* feat:自定义历史聊天标题 * Update chat.ts * perf:自定义聊天标题 * feat: google auth * perf:将修改标题移入右键菜单 * perf:updatetitle --------- Co-authored-by: archer <545436317@qq.com>
This commit is contained in:
@@ -78,13 +78,14 @@ export async function saveChat({
|
||||
return _id;
|
||||
} else {
|
||||
// 已经有记录,追加入库
|
||||
const chat = await Chat.findById(chatId);
|
||||
await Chat.findByIdAndUpdate(chatId, {
|
||||
$push: {
|
||||
content: {
|
||||
$each: content
|
||||
}
|
||||
},
|
||||
title: content[0].value.slice(0, 20),
|
||||
...(chat && !chat.customTitle ? { title: content[0].value.slice(0, 20) } : {}),
|
||||
latestChat: content[1].value,
|
||||
updateTime: new Date()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user