Skip to content

Commit a2c2736

Browse files
authored
feat: new chat room default enable web search feature (#617)
Signed-off-by: Bob Du <[email protected]>
1 parent 59f9b31 commit a2c2736

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

service/src/storage/mongo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export async function insertChatUsage(userId: ObjectId, roomId: number, chatId:
143143
}
144144

145145
export async function createChatRoom(userId: string, title: string, roomId: number, chatModel: string) {
146-
const room = new ChatRoom(userId, title, roomId, chatModel, false, false)
146+
const room = new ChatRoom(userId, title, roomId, chatModel, true, false)
147147
await roomCol.insertOne(room)
148148
return room
149149
}

src/store/modules/chat/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ export const useChatStore = defineStore('chat-store', {
133133
},
134134

135135
async addHistory(history: Chat.History, chatData: Chat.Chat[] = []) {
136-
await fetchCreateChatRoom(history.title, history.uuid, history.chatModel)
136+
const result = await fetchCreateChatRoom(history.title, history.uuid, history.chatModel)
137+
history.searchEnabled = result.data?.searchEnabled
138+
history.thinkEnabled = result.data?.thinkEnabled
137139
this.history.unshift(history)
138140
this.chat.unshift({ uuid: history.uuid, data: chatData })
139141
this.active = history.uuid

0 commit comments

Comments
 (0)