浏览代码

新增获取可用列表的接口

yangdr 4 周之前
父节点
当前提交
688912bb0c
共有 3 个文件被更改,包括 11 次插入3 次删除
  1. 6 1
      src/api/AgentApi.ts
  2. 1 1
      src/components/SideMenu.vue
  3. 4 1
      src/views/ConfigurationView.vue

+ 6 - 1
src/api/AgentApi.ts

@@ -339,8 +339,13 @@ export function getKnowledgeBaseFilesList(params: any): Promise<StandardResponse
     return serverGetRequest(`/open-platform/knowledge-base/${params.kbId}/files/?file_name=${params.file_name}&pageNo=${params.pageNo}&pageSize=${params.pageSize}`)
 }
 
+//获取可用文件列表
+export function getKnowledgeBaseEnableFiles(kbId: number | string): Promise<StandardResponse> {
+    return serverGetRequest(`/open-platform/knowledge-base/${kbId}/files/enable/?status=1`)
+}
+
 export function getConfig(params: any): Promise<StandardResponse> {
-    console.log(params)
+    // console.log(params)
     var data: RequestBody = {
         id: getRequestId(),
         action: 'get_config',

+ 1 - 1
src/components/SideMenu.vue

@@ -115,7 +115,7 @@ const queueClicked = (queue: any) => {
 }
 
 const handleMenuClick = (menu: string) => {
-  console.log("handleMenuClick called with menu:", menu); // 调试输出
+  // console.log("handleMenuClick called with menu:", menu); // 调试输出
   emit('selectMenu', { name: menu });
 }
 const selectWorker = (worker: Worker) => {

+ 4 - 1
src/views/ConfigurationView.vue

@@ -204,6 +204,9 @@ function handleSaveLLMConfig() {
         }
     })
 
+}
+function handleSaveConfig(queue: QueueData) {
+
 }
 function handleSetLLMConfigDefault(item: LLMConfigItemData) {
     llmConfig.value.items.forEach((item) => {
@@ -225,7 +228,7 @@ function handleCancelEditLLMConfig(item: LLMConfigItemData) {
     llmConfigEditFlag.value.set(item, false)
 }
 function handleAddLLMConfig() {
-    var item: LLMConfigItemData = { api_key: "", api_host: "", api_name: "", is_default: false }
+    var item: LLMConfigItemData = { api_key: "", api_host: "", api_name: "", is_default: false, model_name: "" }
     item.api_name = "openai"
 
     llmConfig.value.items.push(item)