mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-03 04:35:14 +08:00

### What problem does this PR solve? feat: build categorize list from object #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
60 lines
1.2 KiB
TypeScript
60 lines
1.2 KiB
TypeScript
import { FormInstance } from 'antd';
|
|
import { Node } from 'reactflow';
|
|
|
|
export interface DSLComponentList {
|
|
id: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface IOperatorForm {
|
|
onValuesChange?(changedValues: any, values: any): void;
|
|
form?: FormInstance;
|
|
node?: Node<NodeData>;
|
|
}
|
|
|
|
export interface IBeginForm {
|
|
prologue?: string;
|
|
}
|
|
|
|
export interface IRetrievalForm {
|
|
similarity_threshold?: number;
|
|
keywords_similarity_weight?: number;
|
|
top_n?: number;
|
|
top_k?: number;
|
|
rerank_id?: string;
|
|
empty_response?: string;
|
|
kb_ids: string[];
|
|
}
|
|
|
|
export interface IGenerateForm {
|
|
max_tokens?: number;
|
|
temperature?: number;
|
|
top_p?: number;
|
|
presence_penalty?: number;
|
|
frequency_penalty?: number;
|
|
cite?: boolean;
|
|
prompt: number;
|
|
llm_id: string;
|
|
parameters: { key: string; component_id: string };
|
|
}
|
|
export interface ICategorizeItem {
|
|
name: string;
|
|
description?: string;
|
|
examples?: string;
|
|
to?: string;
|
|
}
|
|
|
|
export type ICategorizeItemResult = Record<
|
|
string,
|
|
Omit<ICategorizeItem, 'name'>
|
|
>;
|
|
export interface ICategorizeForm extends IGenerateForm {
|
|
category_description: ICategorizeItemResult;
|
|
}
|
|
|
|
export type NodeData = {
|
|
label: string;
|
|
color: string;
|
|
form: IBeginForm | IRetrievalForm | IGenerateForm | ICategorizeForm;
|
|
};
|