2025-10-11 17:18:40 +08:00
|
|
|
|
import type { RunningStatus } from '@/constants/knowledge';
|
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 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-10 15:09:04 +08:00
|
|
|
|
parser_config: ParserConfig;
|
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-10 15:09:04 +08:00
|
|
|
|
export interface Raptor {
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/** 是否使用Raptor */
|
2025-10-10 15:09:04 +08:00
|
|
|
|
use_raptor: boolean;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-11 18:30:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 解析器配置接口
|
|
|
|
|
|
* 定义文档解析的各种参数和选项
|
|
|
|
|
|
*/
|
2025-10-10 15:09:04 +08:00
|
|
|
|
export interface ParserConfig {
|
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-10 15:09:04 +08:00
|
|
|
|
raptor?: Raptor;
|
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-10 15:09:04 +08:00
|
|
|
|
graphrag?: { use_graphrag?: boolean };
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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
|
|
|
|
}
|