v4.6.2-alpah (#511)

This commit is contained in:
Archer
2023-11-24 15:29:43 +08:00
committed by GitHub
parent 60f752629f
commit 9cb4280a16
208 changed files with 5396 additions and 3500 deletions

View File

@@ -1,5 +1,6 @@
export enum FlowNodeInputTypeEnum {
systemInput = 'systemInput', // history, userChatInput, variableInput
input = 'input', // one line input
textarea = 'textarea',
numberInput = 'numberInput',
@@ -8,11 +9,10 @@ export enum FlowNodeInputTypeEnum {
custom = 'custom',
target = 'target', // data input
switch = 'switch',
chatInput = 'chatInput',
selectApp = 'selectApp',
// chat special input
aiSettings = 'aiSettings',
maxToken = 'maxToken',
// maxToken = 'maxToken',
selectChatModel = 'selectChatModel',
// dataset special input
selectDataset = 'selectDataset',
@@ -44,18 +44,3 @@ export enum FlowNodeTypeEnum {
// abandon
variable = 'variable'
}
export enum FlowNodeSpecialInputKeyEnum {
'answerText' = 'text',
'agents' = 'agents', // cq agent key
'pluginId' = 'pluginId'
}
export enum FlowNodeValTypeEnum {
'string' = 'string',
'number' = 'number',
'boolean' = 'boolean',
'chatHistory' = 'chatHistory',
'datasetQuote' = 'datasetQuote',
'any' = 'any'
}

View File

@@ -1,9 +1,6 @@
import {
FlowNodeInputTypeEnum,
FlowNodeOutputTypeEnum,
FlowNodeValTypeEnum,
FlowNodeTypeEnum
} from './constant';
import { FlowNodeInputTypeEnum, FlowNodeOutputTypeEnum, FlowNodeTypeEnum } from './constant';
import { ModuleDataTypeEnum, ModuleInputKeyEnum, ModuleOutputKeyEnum } from '../constants';
import { SelectedDatasetType } from '../api';
export type FlowNodeChangeProps = {
moduleId: string;
@@ -23,24 +20,27 @@ export type FlowNodeChangeProps = {
};
export type FlowNodeInputItemType = {
key: string; // 字段名
key: `${ModuleInputKeyEnum}`;
type: `${FlowNodeInputTypeEnum}`; // Decide on a render style
value?: any;
valueType?: `${FlowNodeValTypeEnum}`;
type: `${FlowNodeInputTypeEnum}`;
valueType?: `${ModuleDataTypeEnum}`; // data type
label: string;
edit?: boolean;
connected?: boolean;
description?: string;
placeholder?: string;
plusField?: boolean;
required?: boolean;
edit?: boolean; // Whether to allow editing
connected?: boolean; // unConnected field will be deleted
showTargetInApp?: boolean;
showTargetInPlugin?: boolean;
placeholder?: string; // input,textarea
list?: { label: string; value: any }[]; // select
step?: number; // slider max?: number;
max?: number;
min?: number;
step?: number;
required?: boolean;
list?: { label: string; value: any }[];
markList?: { label: string; value: any }[];
customData?: () => any;
valueCheck?: (value: any) => boolean;
markList?: { label: string; value: any }[]; // slider
plusField?: boolean; // plus system will show
};
export type FlowNodeOutputTargetItemType = {
@@ -48,11 +48,30 @@ export type FlowNodeOutputTargetItemType = {
key: string;
};
export type FlowNodeOutputItemType = {
key: string; // 字段名
key: `${ModuleOutputKeyEnum}` | string;
label?: string;
edit?: boolean;
description?: string;
valueType?: `${FlowNodeValTypeEnum}`;
valueType?: `${ModuleDataTypeEnum}`;
type?: `${FlowNodeOutputTypeEnum}`;
targets: FlowNodeOutputTargetItemType[];
};
/* ------------- item type --------------- */
/* ai chat modules props */
export type AIChatModuleProps = {
[ModuleInputKeyEnum.aiModel]: string;
[ModuleInputKeyEnum.aiSystemPrompt]?: string;
[ModuleInputKeyEnum.aiChatTemperature]: number;
[ModuleInputKeyEnum.aiChatMaxToken]: number;
[ModuleInputKeyEnum.aiChatIsResponseText]: boolean;
[ModuleInputKeyEnum.aiChatQuoteTemplate]?: string;
[ModuleInputKeyEnum.aiChatQuotePrompt]?: string;
};
export type DatasetModuleProps = {
[ModuleInputKeyEnum.datasetSelectList]: SelectedDatasetType;
[ModuleInputKeyEnum.datasetSimilarity]: number;
[ModuleInputKeyEnum.datasetLimit]: number;
[ModuleInputKeyEnum.datasetStartReRank]: boolean;
};