diff --git a/frontend/src/components/localchat/AiChatMain.vue b/frontend/src/components/localchat/AiChatMain.vue index 09b97a0..a4892fe 100644 --- a/frontend/src/components/localchat/AiChatMain.vue +++ b/frontend/src/components/localchat/AiChatMain.vue @@ -132,7 +132,7 @@ const createCompletion = async () => { }; const chatConfig = modelStore.chatConfig.chat; - const knowledgeId = win?.config?.knowledgeId * 1 || 0; + const knowledgeId = chatStore.chatInfo.knowledgeId; let postMsg: any = { messages: requestMessages.value, model: chatStore.chatInfo.model, diff --git a/frontend/src/stores/aichat.ts b/frontend/src/stores/aichat.ts index cb7138d..2a42d1d 100644 --- a/frontend/src/stores/aichat.ts +++ b/frontend/src/stores/aichat.ts @@ -104,7 +104,7 @@ export const useAiChatStore = defineStore( model: modelData.model, engine: modelData.info.engine, createdAt: Date.now(), - knowledgeId, + knowledgeId: knowledgeId || 0, } //console.log(newChat) activeId.value = await db.addOne('aichatlist', newChat)