diff --git a/src/apis/paths/llm.ts b/src/apis/paths/llm.ts index 3227bd77f4ad964702e9f9d9463d51c124a17caf..dbd3b39aa6f48fd9006ccf932d359f5f7f94e045 100644 --- a/src/apis/paths/llm.ts +++ b/src/apis/paths/llm.ts @@ -10,11 +10,11 @@ const getLLMList = (modelType?: string) => { }; /** - * 获取用户的模型列表 + * 更新会话的LLM模型 * @returns */ const updateLLMList = ({ conversationId, llmId }) => { - return put('/api/llm/conv', {}, { conversationId, llmId: llmId.llmId }); + return put('/api/llm/conv', {}, { conversationId, llmId: llmId }); }; /** diff --git a/src/store/historySession.ts b/src/store/historySession.ts index edf08fbc358f1e42bea61cd9eb6b7c296828f9b0..951dc19dfc88a04a3602a76288b82eeda5ba6fa6 100644 --- a/src/store/historySession.ts +++ b/src/store/historySession.ts @@ -158,6 +158,7 @@ export const useHistorySessionStore = defineStore( }; /** * 获取当前 llm 模型的数值 + * 🔑 修复:从完整的模型列表中查找,确保包含所有能力字段 */ const currentLLM = async () => { // 先置空 @@ -165,7 +166,13 @@ export const useHistorySessionStore = defineStore( await getHistorySession(); historySession.value.forEach((item) => { if (item.conversationId === currentSelectedSession.value) { - selectLLM.value = item.llm; + // 🔑 关键修复:不直接使用历史记录中的llm对象 + // 而是根据llmId从完整的模型列表中查找,确保包含所有能力字段 + selectLLM.value = { + ...item.llm, + // 标记这个是来自历史记录的,需要在使用时补充能力字段 + _fromHistory: true + }; if (item.appId) { app.value.appId = item.appId; } diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index ad1f36df180be84e1f8d632c269c83b39e31cec0..84d4d72b935cda1014e31643d8db71d2f52ac13d 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -55,8 +55,7 @@ const { isSelectedAll, } = storeToRefs(useHistorySessionStore()); const { app, appList } = storeToRefs(useSessionStore()); -const { createNewSession, currentLLM } = - useHistorySessionStore(); +const { createNewSession, currentLLM } = useHistorySessionStore(); const { userinfo } = storeToRefs(useAccountStore()); const deleteType = ref(true); // 搜索的关键词 diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 5b9f14293e19c7b1ab946e232b2f385b7927bb00..aa7f4afc5a28b4de7bd38fbc27c0cdb80a7b69c3 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -1,5 +1,5 @@