feat(knowledge): add chunk management and document processing features

This commit is contained in:
2025-10-16 16:23:53 +08:00
parent 4f956e79ba
commit 5a0a9ef2a1
17 changed files with 1655 additions and 366 deletions

View File

@@ -1,4 +1,5 @@
import type { RunningStatus } from '@/constants/knowledge';
import type { IDocumentInfo } from './document';
/**
@@ -426,6 +427,15 @@ export interface INextTestingResult {
isRuned?: boolean;
}
export interface IChunkListResult {
/** 文档块列表 */
chunks: IChunk[];
/** 文档信息列表 */
doc: IDocumentInfo[]
/** 总匹配数量 */
total: number;
}
/**
* 重命名标签类型
* 用于标签重命名操作

View File

@@ -16,3 +16,19 @@ export interface IDocumentMetaRequestBody {
documentId: string;
meta: string; // json format string
}
// export const RUNNING_STATUS_KEYS = Object.freeze({
// UNSTART: '0', // need to run
// RUNNING: '1', // need to cancel
// CANCEL: '2', // need to refresh
// DONE: '3', // need to refresh
// FAIL: '4', // need to refresh
// } as const)
export interface IRunDocumentRequestBody {
doc_ids: Array<string | number> | string | number;
// running status 1 run 2 cancel - operations
run: number;
delete: boolean;
}

View File

@@ -1,4 +1,4 @@
import { IPaginationRequestBody } from './base';
import { type IPaginationRequestBody } from './base';
export interface IFileListRequestBody extends IPaginationRequestBody {
parent_id?: string; // folder id

View File

@@ -49,3 +49,11 @@ export interface IFetchDocumentListRequestBody {
suffix?: string[];
run_status?: string[];
}
export interface IFetchChunkListRequestBody {
doc_id?: string;
keywords?: string;
page?: number;
size?: number;
}