Files
DB-GPT/web/types/knowledge.ts
Florian a9087c3853 feat: add GraphRAG framework and integrate TuGraph (#1506)
Co-authored-by: KingSkyLi <15566300566@163.com>
Co-authored-by: aries_ckt <916701291@qq.com>
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
2024-05-16 15:39:50 +08:00

162 lines
2.8 KiB
TypeScript

import { type } from 'os';
export interface ISpace {
context?: any;
desc: string;
docs: string | number;
gmt_created: string;
gmt_modified: string;
id: string | number;
name: string;
owner: string;
vector_type: string;
}
export type AddKnowledgeParams = {
name: string;
vector_type: string;
owner: string;
desc: string;
};
export type BaseDocumentParams = {
doc_name: string;
content: string;
doc_type: string;
};
export type Embedding = {
chunk_overlap: string | number;
chunk_size: string | number;
model: string;
recall_score: string | number;
recall_type: string;
topk: string;
};
export type Prompt = {
max_token: string | number;
scene: string;
template: string;
};
export type Summary = {
max_iteration: number;
concurrency_limit: number;
};
export type IArguments = {
embedding: Embedding;
prompt: Prompt;
summary: Summary;
};
export type DocumentParams = {
doc_name: string;
source?: string;
content: string;
doc_type: string;
};
export type IDocument = {
doc_name: string;
source?: string;
content: string;
doc_type: string;
chunk_size: string | number;
gmt_created: string;
gmt_modified: string;
id: number;
last_sync: string;
result: string;
space: string;
status: string;
vector_ids: string;
};
export type IDocumentResponse = {
data: Array<IDocument>;
page: number;
total: number;
};
export type IStrategyParameter = {
param_name: string;
param_type: string;
default_value?: string | number;
description: string;
};
export type IChunkStrategyResponse = {
strategy: string;
name: string;
parameters: Array<IStrategyParameter>;
suffix: Array<string>;
type: Array<string>;
};
export type IStrategyProps = {
chunk_strategy: string;
chunk_size?: number;
chunk_overlap?: number;
};
export type ISyncBatchParameter = {
doc_id: number;
name?: string;
chunk_parameters: IStrategyProps;
};
export type ISyncBatchResponse = {
tasks: Array<number>;
};
export type ChunkListParams = {
document_id?: string | number;
page: number;
page_size: number;
};
export type IChunk = {
content: string;
doc_name: string;
doc_type: string;
document_id: string | number;
gmt_created: string;
gmt_modified: string;
id: string | number;
meta_info: string;
recall_score?: string | number;
};
export type IChunkList = {
data: Array<IChunk>;
page: number;
total: number;
};
export type GraphVisResult = {
nodes:Array<any>,
edges:Array<any>
}
export type ArgumentsParams = {
argument: string;
};
export type StepChangeParams = {
label: 'forward' | 'back' | 'finish';
spaceName?: string;
docType?: string;
files?: Array<File>;
};
export type File = {
name: string;
doc_id: number;
status?: string;
};
export type SummaryParams = {
doc_id: number;
model_name: string;
conv_uid: string;
};