Browse Source

update: 实现对embedding model & store 动态配置

tycoding 9 months ago
parent
commit
827cf0608c

+ 1 - 1
langchat-ui/src/views/app/base/index.vue

@@ -89,7 +89,7 @@
       >
         <template #1>
           <div class="p-2 h-full m-2 bg-white rounded-lg">
-            <SettingsPage />
+            <SettingsPage @update="onSave" />
           </div>
         </template>
         <template #2>

+ 0 - 1
langchat-ui/src/views/app/base/settings/KnowledgeList.vue

@@ -35,7 +35,6 @@
   });
 
   async function show() {
-    console.log(appStore.knowledgeIds);
     knowledges.value = await getList({});
     await nextTick();
     openModal();

+ 4 - 3
langchat-ui/src/views/app/base/settings/index.vue

@@ -21,12 +21,13 @@
   import { ref } from 'vue';
   import { useAppStore } from '@/views/app/store';
 
+  const emit = defineEmits(['update']);
   const appStore = useAppStore();
   const knowledgeRef = ref();
 
   async function onSaveModel(val) {
     appStore.modelId = val.id;
-    // await onSave();
+    emit('update');
   }
 
   function onShowKbPane() {
@@ -42,8 +43,8 @@
   <div class="p-2 py-4 flex flex-col gap-3">
     <n-collapse :default-expanded-names="['0', '1']">
       <n-collapse-item name="0" title="基础配置">
-        <div class="flex items-center gap-2">
-          <div class="w-20">模型选择</div>
+        <div class="flex items-center">
+          <div class="w-24">对话模型:</div>
           <ModelSelect :id="appStore.modelId" class="" @update="onSaveModel" />
         </div>
       </n-collapse-item>