Просмотр исходного кода

feat: 添加知识库相关内容

jiaxing.liao 1 месяц назад
Родитель
Сommit
5e4f6d3c84

+ 8 - 0
apps/web/src/components/Sidebar/index.vue

@@ -82,6 +82,14 @@
 				<span v-if="!collapsed" class="label">{{ t('sidebar.menu.orchestration') }}</span>
 			</el-menu-item>
 
+			<el-menu-item index="/knowledge">
+				<el-tooltip v-if="collapsed" :content="t('sidebar.menu.knowledge')" placement="right">
+					<span><SvgIcon name="book" /></span>
+				</el-tooltip>
+				<SvgIcon v-else name="book" />
+				<span v-if="!collapsed" class="label">{{ t('sidebar.menu.knowledge') }}</span>
+			</el-menu-item>
+
 			<el-menu-item index="/management">
 				<el-tooltip v-if="collapsed" :content="t('sidebar.menu.management')" placement="right">
 					<span><SvgIcon name="platForm" /></span>

+ 1 - 1
apps/web/src/features/fileUpload/FileUploadInput.vue

@@ -351,7 +351,7 @@ const ensureImagePreviewUrl = async (file: WorkflowUploadFile) => {
 
 	loadingImageKeys.add(file.id)
 	try {
-		const blob = (await GetImage({ fileId: file.path })) as Blob | undefined
+		const blob = (await GetImage({ fileId: file.path })) as unknown as Blob
 		if (!blob || !normalizedFiles.value.some((item) => item.id === file.id)) {
 			return
 		}

+ 2 - 1
apps/web/src/i18n/locales/en-us.ts

@@ -177,7 +177,8 @@ export default {
 			templates: 'Templates',
 			statistics: 'Statistics',
 			help: 'Help',
-			settings: 'Settings'
+			settings: 'Settings',
+			knowledge: 'Knowledge'
 		}
 	},
 	settings: {

+ 2 - 1
apps/web/src/i18n/locales/zh-cn.ts

@@ -177,7 +177,8 @@ export default {
 			templates: '模板',
 			statistics: '统计',
 			help: '帮助',
-			settings: '设置'
+			settings: '设置',
+			knowledge: '知识库'
 		}
 	},
 	settings: {

+ 6 - 0
apps/web/src/router/index.ts

@@ -19,6 +19,7 @@ const WorkflowOrchestration = () => import('@/views/WorkflowOrchestration.vue')
 const WorkflowExecution = () => import('@/views/WorkflowExecution.vue')
 const FlowManagement = () => import('@/views/FlowManagement.vue')
 const ModelManager = () => import('@/views/model/index.vue')
+const KnowledgeManager = () => import('@/views/knowledge/index.vue')
 
 const routes = [
 	{
@@ -100,6 +101,11 @@ const routes = [
 				path: 'model',
 				name: 'ModelManager',
 				component: ModelManager
+			},
+			{
+				path: 'knowledge',
+				name: 'KnowledgeManager',
+				component: KnowledgeManager
 			}
 		]
 	}

+ 84 - 0
apps/web/src/views/knowledge/index.vue

@@ -0,0 +1,84 @@
+<template>
+	<div class="knowledge-management-page">
+		<div class="header">
+			<div>
+				<h1>知识库管理</h1>
+				<p class="subtitle">管理知识库的知识文档与问答对,用于RAG问答检索</p>
+			</div>
+		</div>
+		<div class="main-container">
+			<!-- 左侧知识库列表侧边栏 -->
+			<KnowledgeBaseSidebar :current-base-id="currentBaseId" @select-base="handleSelectBase" />
+			<!-- 右侧内容区域:双模块切换 -->
+			<div class="content-container" v-if="currentBaseId">
+				<el-tabs v-model="currentModule" type="border-card">
+					<el-tab-pane label="知识管理" name="document">
+						<DocumentManage :current-base-id="currentBaseId" />
+					</el-tab-pane>
+					<el-tab-pane label="问答管理" name="qa">
+						<QaManage :current-base-id="currentBaseId" />
+					</el-tab-pane>
+				</el-tabs>
+			</div>
+			<el-empty v-else description="请在左侧选择一个知识库" class="empty-container" />
+		</div>
+	</div>
+</template>
+
+<script setup lang="ts">
+import KnowledgeBaseSidebar from './KnowledgeBaseSidebar.vue'
+import DocumentManage from './DocumentManage.vue'
+import QaManage from './QaManage.vue'
+import { ref } from 'vue'
+
+// 共享状态
+const currentBaseId = ref<string>('')
+const currentModule = ref<'document' | 'qa'>('document')
+
+const handleSelectBase = (baseId: string) => {
+	currentBaseId.value = baseId
+}
+</script>
+
+<style lang="less" scoped>
+.knowledge-management-page {
+	padding: 16px;
+	background: #f5f7fa;
+	min-height: 100%;
+}
+.header {
+	margin-bottom: 16px;
+	h1 {
+		font-size: 28px;
+		margin: 0;
+		color: var(--text-primary);
+	}
+	.subtitle {
+		margin: 6px 0 0;
+		color: var(--text-secondary);
+		font-size: 14px;
+	}
+}
+.main-container {
+	display: flex;
+	gap: 16px;
+	background: #fff;
+	border-radius: 8px;
+	overflow: hidden;
+	min-height: calc(100vh - 180px);
+}
+.content-container {
+	flex: 1;
+	padding: 16px;
+	:deep(.el-tabs__content) {
+		padding-top: 16px;
+	}
+}
+.empty-container {
+	flex: 1;
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
+}
+</style>

+ 0 - 0
apps/web/src/views/knowledge/types.d.ts


Разница между файлами не показана из-за своего большого размера
+ 3516 - 0
packages/api-service/agent.openapi.json


+ 2 - 1
packages/api-service/index.ts

@@ -4,5 +4,6 @@ const agent = api.agent
 const tools = api.tools
 const aiModel = api.aiModel
 const ollama = api.ollama
+const knowledge = api.knowledge
 
-export { agent, tools, aiModel, ollama }
+export { agent, tools, aiModel, ollama, knowledge }

+ 169 - 167
packages/api-service/servers/api/aiModel.ts

@@ -4,200 +4,202 @@ import request from '@repo/api-client'
 
 /** 检查模型 POST /api/ai/model/check */
 export async function postAiModelCheck(
-	body: {
-		name: string
-		type: string
-		source: string
-		provider: string
-		api_key: string
-	},
-	options?: { [key: string]: any }
+  body: {
+    name: string
+    type: string
+    source: string
+    provider: string
+    api_key: string
+  },
+  options?: { [key: string]: any }
 ) {
-	return request<{ isSuccess: boolean; code: number; isAuthorized: boolean; result?: any }>(
-		'/api/ai/model/check',
-		{
-			method: 'POST',
-			headers: {
-				'Content-Type': 'application/json'
-			},
-			data: body,
-			...(options || {})
-		}
-	)
+  return request<{
+    isSuccess: boolean
+    code: number
+    isAuthorized: boolean
+    result?: Record<string, any>
+  }>('/api/ai/model/check', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
 }
 
 /** 创建模型 POST /api/ai/model/create */
 export async function postAiModelCreate(
-	body: {
-		name: string
-		title: string
-		description: string
-		type: string
-		source: string
-		provider: string
-		base_url: string
-		api_key: string
-		custom_headers: Record<string, any>
-	},
-	options?: { [key: string]: any }
+  body: {
+    name: string
+    title: string
+    description: string
+    type: string
+    source: string
+    provider: string
+    base_url: string
+    api_key: string
+    custom_headers: Record<string, any>
+  },
+  options?: { [key: string]: any }
 ) {
-	return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
-		'/api/ai/model/create',
-		{
-			method: 'POST',
-			headers: {
-				'Content-Type': 'application/json'
-			},
-			data: body,
-			...(options || {})
-		}
-	)
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/model/create',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
 }
 
 /** 删除模型 POST /api/ai/model/delete */
 export async function postAiModelOpenApiDelete(
-	body: {
-		id: string
-	},
-	options?: { [key: string]: any }
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
 ) {
-	return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
-		'/api/ai/model/delete',
-		{
-			method: 'POST',
-			headers: {
-				'Content-Type': 'application/json'
-			},
-			data: body,
-			...(options || {})
-		}
-	)
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/model/delete',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
 }
 
 /** 模型详情 POST /api/ai/model/info */
 export async function postAiModelInfo(
-	body: {
-		id: string
-	},
-	options?: { [key: string]: any }
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
 ) {
-	return request<{
-		isSuccess: boolean
-		code: number
-		result: {
-			creationTime: string
-			creatorUserId: string
-			description: string
-			id: string
-			isDeleted: boolean
-			is_default: boolean
-			name: string
-			parameters: {
-				api_key: string
-				base_url: string
-				embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
-				provider: string
-			}
-			provider: string
-			source: string
-			status: string
-			title: string
-			type: string
-			updateTime: string
-		}
-		isAuthorized: boolean
-	}>('/api/ai/model/info', {
-		method: 'POST',
-		headers: {
-			'Content-Type': 'application/json'
-		},
-		data: body,
-		...(options || {})
-	})
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      creationTime: string
+      creatorUserId: string
+      description: string
+      id: string
+      isDeleted: boolean
+      is_default: boolean
+      name: string
+      parameters: {
+        api_key: string
+        base_url: string
+        embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
+        provider: string
+      }
+      provider: string
+      source: string
+      status: string
+      title: string
+      type: string
+      updateTime: string
+    }
+    isAuthorized: boolean
+  }>('/api/ai/model/info', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
 }
 
 /** 获取模型分页列表 POST /api/ai/model/pageList */
 export async function postAiModelPageList(options?: { [key: string]: any }) {
-	return request<{
-		isSuccess: boolean
-		code: number
-		result: {
-			currentPage: number
-			hasNextPage: boolean
-			hasPreviousPage: boolean
-			model: {
-				creationTime?: string
-				creatorUserId?: string
-				description?: string
-				id?: string
-				isDeleted?: boolean
-				is_default?: boolean
-				name?: string
-				parameters: {
-					api_key: string
-					base_url: string
-					embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
-					provider: string
-				}
-				provider?: string
-				source?: string
-				status?: string
-				title?: string
-				type?: string
-				updateTime?: string
-			}[]
-			pageSize: number
-			totalCount: number
-			totalPages: number
-		}
-		isAuthorized: boolean
-	}>('/api/ai/model/pageList', {
-		method: 'POST',
-		...(options || {})
-	})
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      currentPage: number
+      hasNextPage: boolean
+      hasPreviousPage: boolean
+      model: {
+        creationTime?: string
+        creatorUserId?: string
+        description?: string
+        id?: string
+        isDeleted?: boolean
+        is_default?: boolean
+        name?: string
+        parameters: {
+          api_key: string
+          base_url: string
+          embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
+          provider: string
+        }
+        provider?: string
+        source?: string
+        status?: string
+        title?: string
+        type?: string
+        updateTime?: string
+      }[]
+      pageSize: number
+      totalCount: number
+      totalPages: number
+    }
+    isAuthorized: boolean
+  }>('/api/ai/model/pageList', {
+    method: 'POST',
+    ...(options || {})
+  })
 }
 
 /** 根据模型类型获取支持的服务商列表及配置信息 POST /api/ai/model/providers */
 export async function postAiModelProviders(options?: { [key: string]: any }) {
-	return request<{
-		isSuccess: boolean
-		code: number
-		result: {
-			defaultUrls: { chat: string; embedding: string; rerank: string; vllm: string }
-			description: string
-			label: string
-			modelTypes: string[]
-			value: string
-		}[]
-		isAuthorized: boolean
-	}>('/api/ai/model/providers', {
-		method: 'POST',
-		...(options || {})
-	})
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      defaultUrls: { chat: string; embedding: string; rerank: string; vllm: string }
+      description: string
+      label: string
+      modelTypes: string[]
+      value: string
+    }[]
+    isAuthorized: boolean
+  }>('/api/ai/model/providers', {
+    method: 'POST',
+    ...(options || {})
+  })
 }
 
 /** 更新模型 POST /api/ai/model/update */
 export async function postAiModelUpdate(
-	body: {
-		id: string
-		name: string
-		title: string
-		description: string
-		base_url: string
-		api_key: string
-		custom_headers: Record<string, any>
-	},
-	options?: { [key: string]: any }
+  body: {
+    id: string
+    name: string
+    title: string
+    description: string
+    base_url: string
+    api_key: string
+    custom_headers: Record<string, any>
+  },
+  options?: { [key: string]: any }
 ) {
-	return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
-		'/api/ai/model/update',
-		{
-			method: 'POST',
-			headers: {
-				'Content-Type': 'application/json'
-			},
-			data: body,
-			...(options || {})
-		}
-	)
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/model/update',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
 }

+ 5 - 1
packages/api-service/servers/api/index.ts

@@ -6,9 +6,13 @@ import * as tools from './tools'
 import * as agent from './agent'
 import * as aiModel from './aiModel'
 import * as ollama from './ollama'
+import * as knowledge from './knowledge'
+export { tools, agent, aiModel, ollama, knowledge }
+
 export default {
   tools,
   agent,
   aiModel,
-  ollama
+  ollama,
+  knowledge
 }

+ 689 - 0
packages/api-service/servers/api/knowledge.ts

@@ -0,0 +1,689 @@
+// @ts-ignore
+/* eslint-disable */
+import request from '@repo/api-client'
+
+/** 创建单个FAQ条目 POST /api/ai/faq/create */
+export async function postAiFaqCreate(
+  body: {
+    knowledge_base_id: string
+    standard_question: string
+    similar_questions: string[]
+    negative_questions: string[]
+    answers: string[]
+    is_enabled: boolean
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/faq/create',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 删除单个FAQ条目 POST /api/ai/faq/delete */
+export async function postAiFaqOpenApiDelete(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<Record<string, any>>('/api/ai/faq/delete', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 详情 POST /api/ai/faq/info */
+export async function postAiFaqInfo(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      answer_strategy: string
+      answers: string[]
+      chunk_id: string
+      chunk_type: string
+      creationTime: string
+      creatorUserId: string
+      id: string
+      index_mode: string
+      is_enabled: boolean
+      is_recommended: boolean
+      knowledge_base_id: string
+      knowledge_id: string
+      negative_questions: string[]
+      similar_questions: string[]
+      standard_question: string
+      tag_id: string
+    }
+    isAuthorized: boolean
+  }>('/api/ai/faq/info', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 分页列表 POST /api/ai/faq/pageList */
+export async function postAiFaqPageList(
+  body: {
+    knowledge_base_id: string
+    pageIndex: number
+    pageSize: number
+    keyword: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      currentPage: number
+      hasNextPage: boolean
+      hasPreviousPage: boolean
+      model: {
+        answer_strategy?: string
+        answers?: string[]
+        chunk_id?: string
+        chunk_type?: string
+        creationTime?: string
+        creatorUserId?: string
+        id?: string
+        index_mode?: string
+        is_enabled?: boolean
+        is_recommended?: boolean
+        knowledge_base_id?: string
+        knowledge_id?: string
+        negative_questions?: string[]
+        similar_questions?: string[]
+        standard_question?: string
+        tag_id?: string
+      }[]
+      pageSize: number
+      totalCount: number
+      totalPages: number
+    }
+    isAuthorized: boolean
+  }>('/api/ai/faq/pageList', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 更新单个FAQ条目 POST /api/ai/faq/update */
+export async function postAiFaqUpdate(
+  body: {
+    id: string
+    standard_question: string
+    similar_questions: string[]
+    negative_questions: string[]
+    answers: string[]
+    is_enabled: boolean
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/faq/update',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 创建知识库 POST /api/ai/knowledge-base/create */
+export async function postAiKnowledgeBaseCreate(
+  body: {
+    name: string
+    description: string
+    type: string
+    wiki_config: {
+      extraction_granularity: string
+      max_pages_per_ingest: number
+      synthesis_model_id: string
+    }
+    indexing_strategy: {
+      graph_enabled: boolean
+      keyword_enabled: boolean
+      vector_enabled: boolean
+      wiki_enabled: boolean
+    }
+    chunking_config: {
+      chunk_size: number
+      chunk_overlap: number
+      separators: string[]
+      parser_engine_rules: { engine: string; file_types: string[] }[]
+      enable_parent_child: boolean
+      parent_chunk_size: number
+      child_chunk_size: number
+    }
+    embedding_model_id: string
+    summary_model_id: string
+    vlm_config: { model_id: string; enabled: boolean }
+    asr_config: { model_id: string; language: string; enabled: boolean }
+    storage_provider_config: { provider: string }
+    storage_config: { provider: string }
+    question_generation_config: { enabled: boolean; question_count: number }
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge-base/create',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 删除知识库 POST /api/ai/knowledge-base/delete */
+export async function postAiKnowledgeBaseOpenApiDelete(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge-base/delete',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 混合搜索 (FAQ) POST /api/ai/knowledge-base/faq_hybrid_search */
+export async function postAiKnowledgeBaseFaqHybridSearch(
+  body: {
+    knowledge_base_id: string
+    query_text: string
+    vector_threshold: number
+    match_count: number
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      answer_strategy?: string
+      answers?: string[]
+      chunk_id?: string
+      chunk_type?: string
+      creationTime?: string
+      creatorUserId?: string
+      id?: string
+      index_mode?: string
+      is_enabled?: boolean
+      is_recommended?: boolean
+      knowledge_base_id?: string
+      knowledge_id?: string
+      negative_questions?: string[]
+      score?: number
+      similar_questions?: string[]
+      standard_question?: string
+      tag_id?: string
+    }[]
+    isAuthorized: boolean
+  }>('/api/ai/knowledge-base/faq_hybrid_search', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 混合搜索 POST /api/ai/knowledge-base/hybrid_search */
+export async function postAiKnowledgeBaseHybridSearch(
+  body: {
+    id: string
+    query_text: string
+    vector_threshold: number
+    keyword_threshold: number
+    match_count: number
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; result: string[]; isAuthorized: boolean }>(
+    '/api/ai/knowledge-base/hybrid_search',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 根据ids,混合搜索 POST /api/ai/knowledge-base/hybrid_search_ids */
+export async function postAiKnowledgeBaseHybridSearchIds(
+  body: {
+    query: string
+    knowledge_base_ids: string[]
+    knowledge_ids: string[]
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      chunk_index?: string
+      chunk_metadata: { generated_questions: { id: string; question: string }[] }
+      chunk_type?: string
+      content?: string
+      end_at?: number
+      id?: string
+      image_info?: string
+      knowledge_base_id?: string
+      knowledge_channel?: string
+      knowledge_filename?: string
+      knowledge_id?: string
+      knowledge_source?: string
+      knowledge_title?: string
+      match_type?: number
+      metadata: { base_score: string }
+      parent_chunk_id?: string
+      score?: number
+      seq?: number
+      start_at?: number
+      sub_chunk_id?: string[]
+    }[]
+    isAuthorized: boolean
+  }>('/api/ai/knowledge-base/hybrid_search_ids', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 知识库详情 POST /api/ai/knowledge-base/info */
+export async function postAiKnowledgeBaseInfo(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      asr_config: { enabled: boolean; language: string; model_id: string }
+      chunking_config: {
+        child_chunk_size: number
+        chunk_overlap: number
+        chunk_size: number
+        enable_parent_child: boolean
+        parent_chunk_size: number
+        parser_engine_rules: { engine: string; file_types: string[] }[]
+        separators: string[]
+      }
+      creationTime: string
+      creatorUserId: string
+      description: string
+      embedding_model_id: string
+      faq_config: { index_mode: string; question_index_mode: string }
+      id: string
+      indexing_strategy: {
+        graph_enabled: boolean
+        keyword_enabled: boolean
+        vector_enabled: boolean
+        wiki_enabled: boolean
+      }
+      isDeleted: boolean
+      is_pinned: boolean
+      is_temporary: boolean
+      name: string
+      question_generation_config: { enabled: boolean; question_count: number }
+      storage_config: { provider: string }
+      storage_provider_config: { provider: string }
+      summary_model_id: string
+      type: string
+      updateTime: string
+      vlm_config: { enabled: boolean; model_id: string }
+      wiki_config: {
+        extraction_granularity: string
+        max_pages_per_ingest: number
+        synthesis_model_id: string
+      }
+    }
+    isAuthorized: boolean
+  }>('/api/ai/knowledge-base/info', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 获取知识库分页列表 POST /api/ai/knowledge-base/pageList */
+export async function postAiKnowledgeBasePageList(
+  body: {
+    keyword: string
+    type: string
+    pageIndex: number
+    pageSize: number
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      currentPage: number
+      hasNextPage: boolean
+      hasPreviousPage: boolean
+      model: {
+        asr_config: { enabled: boolean; language: string; model_id: string }
+        chunking_config: {
+          child_chunk_size: number
+          chunk_overlap: number
+          chunk_size: number
+          enable_parent_child: boolean
+          parent_chunk_size: number
+          parser_engine_rules: { engine: string; file_types: string[] }[]
+          separators: string[]
+        }
+        creationTime: string
+        creatorUserId: string
+        description: string
+        embedding_model_id: string
+        faq_config: { index_mode: string; question_index_mode: string }
+        id: string
+        indexing_strategy: {
+          graph_enabled: boolean
+          keyword_enabled: boolean
+          vector_enabled: boolean
+          wiki_enabled: boolean
+        }
+        isDeleted: boolean
+        is_pinned: boolean
+        is_temporary: boolean
+        name: string
+        question_generation_config: { enabled: boolean; question_count: number }
+        storage_config: { provider: string }
+        storage_provider_config: { provider: string }
+        summary_model_id: string
+        type: string
+        updateTime: string
+        vlm_config: { enabled: boolean; model_id: string }
+        wiki_config: {
+          extraction_granularity: string
+          max_pages_per_ingest: number
+          synthesis_model_id: string
+        }
+        extract_config: { enabled: boolean }
+      }[]
+      pageSize: number
+      totalCount: number
+      totalPages: number
+    }
+    isAuthorized: boolean
+  }>('/api/ai/knowledge-base/pageList', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 更新知识库 POST /api/ai/knowledge-base/update */
+export async function postAiKnowledgeBaseUpdate(
+  body: {
+    id: string
+    name: string
+    description: string
+    wiki_config: {
+      extraction_granularity: string
+      max_pages_per_ingest: number
+      synthesis_model_id: string
+    }
+    indexing_strategy: {
+      graph_enabled: boolean
+      keyword_enabled: boolean
+      vector_enabled: boolean
+      wiki_enabled: boolean
+    }
+    chunking_config: {
+      chunk_size: number
+      chunk_overlap: number
+      separators: string[]
+      parser_engine_rules: { engine: string; file_types: string[] }[]
+      enable_parent_child: boolean
+      parent_chunk_size: number
+      child_chunk_size: number
+    }
+    embedding_model_id: string
+    summary_model_id: string
+    vlm_config: { model_id: string; enabled: boolean }
+    asr_config: { model_id: string; language: string; enabled: boolean }
+    storage_provider_config: { provider: string }
+    storage_config: { provider: string }
+    question_generation_config: { enabled: boolean; question_count: number }
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge-base/update',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 创建来自文件的知识 POST /api/ai/knowledge/createWithFile */
+export async function postAiKnowledgeCreateWithFile(
+  body: {
+    knowledge_base_id: string
+    fileId: string
+    metadata: Record<string, any>
+    enable_multi_model: boolean
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge/createWithFile',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 创建自定义知识 POST /api/ai/knowledge/createWithManual */
+export async function postAiKnowledgeCreateWithManual(
+  body: {
+    knowledge_base_id: string
+    title: string
+    content: string
+    publish: boolean
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge/createWithManual',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 删除知识 POST /api/ai/knowledge/delete */
+export async function postAiKnowledgeOpenApiDelete(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge/delete',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 获取知识分页列表 POST /api/ai/knowledge/pageList */
+export async function postAiKnowledgePageList(
+  body: {
+    knowledge_base_id: string
+    title: string
+    file_type: string
+    pageIndex: number
+    pageSize: number
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{
+    isSuccess: boolean
+    code: number
+    result: {
+      currentPage: number
+      hasNextPage: boolean
+      hasPreviousPage: boolean
+      model: {
+        channel?: string
+        creationTime?: string
+        description?: string
+        embedding_model_id?: string
+        enable_status?: string
+        error_message?: string
+        file_hash?: string
+        file_name?: string
+        file_path?: string
+        file_size?: number
+        file_type?: string
+        id?: string
+        isDeleted?: boolean
+        knowledge_base_id?: string
+        metadata?: Record<string, any>
+        parse_status?: string
+        source?: string
+        storage_size?: number
+        summary_status?: string
+        tag_id?: string
+        title?: string
+        type?: string
+        updateTime?: string
+      }[]
+      pageSize: number
+      totalCount: number
+      totalPages: number
+    }
+    isAuthorized: boolean
+  }>('/api/ai/knowledge/pageList', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    data: body,
+    ...(options || {})
+  })
+}
+
+/** 重新解析知识 POST /api/ai/knowledge/reparse */
+export async function postAiKnowledgeReparse(
+  body: {
+    id: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge/reparse',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}
+
+/** 更新知识 POST /api/ai/knowledge/update */
+export async function postAiKnowledgeUpdate(
+  body: {
+    id: string
+    title: string
+    description: string
+  },
+  options?: { [key: string]: any }
+) {
+  return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
+    '/api/ai/knowledge/update',
+    {
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json'
+      },
+      data: body,
+      ...(options || {})
+    }
+  )
+}