2025-10-11 17:18:40 +08:00
|
|
|
|
import type { RunningStatus } from '@/constants/knowledge';
|
2025-10-10 15:09:04 +08:00
|
|
|
|
|
2025-10-14 19:15:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
{
|
|
|
|
|
|
"avatar": "data:image/png;base64,iVBORw0K
|
|
|
|
|
|
"chunk_num": 1180,
|
|
|
|
|
|
"create_time": 1759986452748,
|
|
|
|
|
|
"description": " 213213",
|
|
|
|
|
|
"doc_num": 16,
|
|
|
|
|
|
"embd_id": "",
|
|
|
|
|
|
"id": "dcc2871aa4cd11f08d4116ac85b1de0a",
|
|
|
|
|
|
"language": "English",
|
|
|
|
|
|
"name": "k1123",
|
|
|
|
|
|
"pagerank": 0,
|
|
|
|
|
|
"parser_config": {
|
|
|
|
|
|
"auto_keywords": 0,
|
|
|
|
|
|
"auto_questions": 0,
|
|
|
|
|
|
"chunk_token_num": 512,
|
|
|
|
|
|
"delimiter": "\n",
|
|
|
|
|
|
"graphrag": {
|
|
|
|
|
|
"entity_types": [
|
|
|
|
|
|
"organization",
|
|
|
|
|
|
"person",
|
|
|
|
|
|
"geo",
|
|
|
|
|
|
"event",
|
|
|
|
|
|
"category"
|
|
|
|
|
|
],
|
|
|
|
|
|
"method": "light",
|
|
|
|
|
|
"use_graphrag": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"html4excel": false,
|
|
|
|
|
|
"layout_recognize": "Plain Text",
|
|
|
|
|
|
"raptor": {
|
|
|
|
|
|
"max_cluster": 64,
|
|
|
|
|
|
"max_token": 256,
|
|
|
|
|
|
"prompt": "\u8bf7\u603b\u7ed3\u4ee5\u4e0b\u6bb5\u843d\u3002 \u5c0f\u5fc3\u6570\u5b57\uff0c\u4e0d\u8981\u7f16\u9020\u3002 \u6bb5\u843d\u5982\u4e0b\uff1a\n {cluster_content}\n\u4ee5\u4e0a\u5c31\u662f\u4f60\u9700\u8981\u603b\u7ed3\u7684\u5185\u5bb9\u3002",
|
|
|
|
|
|
"random_seed": 0,
|
|
|
|
|
|
"threshold": 0.1,
|
|
|
|
|
|
"use_raptor": false
|
|
|
|
|
|
},
|
|
|
|
|
|
"topn_tags": 3
|
|
|
|
|
|
},
|
|
|
|
|
|
"parser_id": "naive",
|
|
|
|
|
|
"permission": "team",
|
|
|
|
|
|
"size": 56819092,
|
|
|
|
|
|
"token_num": 293067,
|
|
|
|
|
|
"update_time": 1760436169574
|
|
|
|
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 知识库接口定义
|
|
|
|
|
|
* 包含知识库的基本信息、配置和状态
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IKnowledge {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库头像,可选字段 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
avatar?: any;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库中的文档块数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建日期(字符串格式) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
create_date: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建时间戳 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
create_time: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建者ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
created_by: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库描述 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
description: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库中的文档数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库语言 */
|
2025-10-11 17:18:40 +08:00
|
|
|
|
language: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库唯一标识符 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析器配置 */
|
2025-10-14 19:15:32 +08:00
|
|
|
|
parser_config: IParserConfig;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析器ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
parser_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 管道ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
pipeline_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 管道名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
pipeline_name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 管道头像 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
pipeline_avatar: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 权限设置 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
permission: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 相似度阈值 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
similarity_threshold: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库状态 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
status: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 租户ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tenant_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 令牌数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
token_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 更新日期(字符串格式) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
update_date: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 更新时间戳 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
update_time: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 向量相似度权重 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
vector_similarity_weight: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 嵌入模型ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
embd_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 昵称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
nickname: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 操作权限级别 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
operator_permission: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库大小(字节) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
size: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** Raptor任务完成时间,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
raptor_task_finish_at?: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** Raptor任务ID,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
raptor_task_id?: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 思维导图任务完成时间,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
mindmap_task_finish_at?: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 思维导图任务ID,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
mindmap_task_id?: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 知识库查询结果接口
|
|
|
|
|
|
* 包含知识库列表和总数
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IKnowledgeResult {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
kbs: IKnowledge[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 知识库总数 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
total: number;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Raptor配置接口
|
|
|
|
|
|
* 用于配置是否启用Raptor功能
|
2025-10-14 19:15:32 +08:00
|
|
|
|
{
|
|
|
|
|
|
"max_cluster": 64,
|
|
|
|
|
|
"max_token": 256,
|
|
|
|
|
|
"prompt": "\u8bf7\u603b\u7ed3\u4ee5\u4e0b\u6bb5\u843d\u3002
|
|
|
|
|
|
\u5c0f\u5fc3\u6570\u5b57\uff0c\u4e0d\u8981\u7f16\u9020\u3002 \u6bb5\u843d\u5982\u4e0b\uff1a\n
|
|
|
|
|
|
{cluster_content}\n\u4ee5\u4e0a\u5c31\u662f\u4f60\u9700\u8981\u603b\u7ed3\u7684\u5185\u5bb9\u3002",
|
|
|
|
|
|
"random_seed": 0,
|
|
|
|
|
|
"threshold": 0.1,
|
|
|
|
|
|
"use_raptor": false
|
|
|
|
|
|
}
|
2025-10-11 18:30:41 +08:00
|
|
|
|
*/
|
2025-10-14 19:15:32 +08:00
|
|
|
|
export interface IRaptor {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否使用Raptor */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
use_raptor: boolean;
|
2025-10-14 19:15:32 +08:00
|
|
|
|
/** 最大集群数,可选 */
|
|
|
|
|
|
max_cluster?: number;
|
|
|
|
|
|
/** 最大令牌数,可选 */
|
|
|
|
|
|
max_token?: number;
|
|
|
|
|
|
/** 提示模板,可选 */
|
|
|
|
|
|
prompt?: string;
|
|
|
|
|
|
/** 随机种子,可选 */
|
|
|
|
|
|
random_seed?: number;
|
|
|
|
|
|
/** 阈值,可选 */
|
|
|
|
|
|
threshold?: number;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* GraphRAG配置接口
|
|
|
|
|
|
* 用于配置是否启用GraphRAG功能
|
|
|
|
|
|
{
|
|
|
|
|
|
"entity_types": [
|
|
|
|
|
|
"organization",
|
|
|
|
|
|
"person",
|
|
|
|
|
|
"geo",
|
|
|
|
|
|
"event",
|
|
|
|
|
|
"category"
|
|
|
|
|
|
],
|
|
|
|
|
|
"method": "light",
|
|
|
|
|
|
"use_graphrag": true
|
|
|
|
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
export interface IGraphrag {
|
|
|
|
|
|
use_graphrag: boolean;
|
|
|
|
|
|
/** 实体类型列表,可选 */
|
|
|
|
|
|
entity_types?: string[];
|
|
|
|
|
|
/** 方法,可选 */
|
|
|
|
|
|
method?: string;
|
2025-10-10 15:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 解析器配置接口
|
|
|
|
|
|
* 定义文档解析的各种参数和选项
|
|
|
|
|
|
*/
|
2025-10-14 19:15:32 +08:00
|
|
|
|
export interface IParserConfig {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 起始页码,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
from_page?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 结束页码,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
to_page?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 自动关键词数量,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
auto_keywords?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 自动问题数量,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
auto_questions?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 每个文档块的令牌数量,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_token_num?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 分隔符,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
delimiter?: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否将HTML转换为Excel格式,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
html4excel?: boolean;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否启用布局识别,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
layout_recognize?: boolean;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** Raptor配置,可选 */
|
2025-10-14 19:15:32 +08:00
|
|
|
|
raptor?: IRaptor;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 标签知识库ID列表,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tag_kb_ids?: string[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 顶部标签数量,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
topn_tags?: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** GraphRAG配置,可选 */
|
2025-10-14 19:15:32 +08:00
|
|
|
|
graphrag?: IGraphrag;
|
2025-10-10 15:09:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 知识库文件解析器配置接口
|
|
|
|
|
|
* 定义文件解析的具体参数
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IKnowledgeFileParserConfig {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 每个文档块的令牌数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_token_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否启用布局识别 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
layout_recognize: boolean;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 页面范围数组 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
pages: number[][];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 任务页面大小 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
task_page_size: number;
|
|
|
|
|
|
}
|
2025-10-11 18:30:41 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 知识库文件接口
|
|
|
|
|
|
* 定义知识库中单个文件的信息和状态
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IKnowledgeFile {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件中的文档块数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建日期(字符串格式) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
create_date: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建时间戳 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
create_time: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 创建者ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
created_by: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件唯一标识符 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属知识库ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
kb_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件存储位置 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
location: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析器ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
parser_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 处理开始时间,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
process_begin_at?: any;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 处理持续时间 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
process_duration: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析进度百分比 */
|
|
|
|
|
|
progress: number;
|
|
|
|
|
|
/** 解析进度消息 */
|
|
|
|
|
|
progress_msg: string;
|
|
|
|
|
|
/** 解析运行状态 */
|
|
|
|
|
|
run: RunningStatus;
|
|
|
|
|
|
/** 文件大小(字节) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
size: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件来源类型 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
source_type: string;
|
2025-10-14 15:42:40 +08:00
|
|
|
|
/** 文件状态(1 启用/ 0 禁用) */
|
2025-10-11 18:30:41 +08:00
|
|
|
|
status: string;
|
|
|
|
|
|
/** 文件缩略图(base64编码),可选 */
|
|
|
|
|
|
thumbnail?: any;
|
|
|
|
|
|
/** 文件中的令牌数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
token_num: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文件类型 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
type: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 更新日期(字符串格式) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
update_date: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 更新时间戳 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
update_time: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析器配置 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
parser_config: IKnowledgeFileParserConfig;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 租户信息接口
|
|
|
|
|
|
* 定义租户的各种服务配置
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface ITenantInfo {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 自动语音识别服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
asr_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 嵌入模型服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
embd_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 图像转文本服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
img2txt_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 大语言模型服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
llm_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 租户名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 解析器ID列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
parser_ids: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 租户角色 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
role: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 租户ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tenant_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 聊天服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chat_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 语音转文本服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
speech2text_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文本转语音服务ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tts_id: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 文档块接口
|
|
|
|
|
|
* 定义知识库中单个文档块的信息
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IChunk {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否启用,0:未启用,1:启用 */
|
|
|
|
|
|
available_int: number;
|
|
|
|
|
|
/** 文档块唯一标识符 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 带权重的内容 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
content_with_weight: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属文档ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属文档名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 关联图像ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
image_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 重要关键词列表,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
important_kwd?: string[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 问题关键词列表,可选 */
|
|
|
|
|
|
question_kwd?: string[];
|
|
|
|
|
|
/** 标签关键词列表,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tag_kwd?: string[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 位置信息数组 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
positions: number[][];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 标签特征映射,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
tag_feas?: Record<string, number>;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试文档块接口
|
|
|
|
|
|
* 用于知识库测试和检索的文档块信息
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface ITestingChunk {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档块唯一标识符 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunk_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 内容的LTKS表示 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
content_ltks: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 带权重的内容 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
content_with_weight: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属文档ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属文档名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_name: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 图像ID(旧字段) */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
img_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 图像ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
image_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 重要关键词列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
important_kwd: any[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 所属知识库ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
kb_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 相似度分数 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
similarity: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 词汇相似度分数 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
term_similarity: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 向量表示 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
vector: number[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 向量相似度分数 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
vector_similarity: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 高亮显示的内容 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
highlight: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 位置信息数组 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
positions: number[][];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档名称关键词 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
docnm_kwd: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档类型关键词 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_type_kwd: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试文档接口
|
|
|
|
|
|
* 用于知识库测试的文档统计信息
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface ITestingDocument {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档中的块数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
count: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档ID */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_id: string;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档名称 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_name: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试结果接口
|
|
|
|
|
|
* 知识库测试的完整结果
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface ITestingResult {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 匹配的文档块列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunks: ITestingChunk[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 匹配的文档列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
documents: ITestingDocument[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 总匹配数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
total: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 标签统计,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
labels?: Record<string, number>;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 下一代测试结果接口
|
|
|
|
|
|
* 改进版本的知识库测试结果
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface INextTestingResult {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 匹配的文档块列表 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
chunks: ITestingChunk[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 文档聚合统计 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
doc_aggs: ITestingDocument[];
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 总匹配数量 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
total: number;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 标签统计,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
labels?: Record<string, number>;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否已运行,可选 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
isRuned?: boolean;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 重命名标签类型
|
|
|
|
|
|
* 用于标签重命名操作
|
|
|
|
|
|
*/
|
|
|
|
|
|
export type IRenameTag = {
|
|
|
|
|
|
/** 原标签名 */
|
|
|
|
|
|
fromTag: string;
|
|
|
|
|
|
/** 新标签名 */
|
|
|
|
|
|
toTag: string;
|
|
|
|
|
|
};
|
2025-10-10 15:09:04 +08:00
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 知识图谱接口
|
|
|
|
|
|
* 定义知识库的图谱结构
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface IKnowledgeGraph {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 图谱数据结构 */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
graph: Record<string, any>;
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 思维导图数据(已注释) */
|
2025-10-11 17:18:40 +08:00
|
|
|
|
// mind_map: TreeData;
|
2025-10-10 15:09:04 +08:00
|
|
|
|
}
|