mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
v4.5.2 (#439)
This commit is contained in:
59
packages/global/core/module/node/constant.ts
Normal file
59
packages/global/core/module/node/constant.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
export enum FlowNodeInputTypeEnum {
|
||||
systemInput = 'systemInput', // history, userChatInput, variableInput
|
||||
input = 'input', // one line input
|
||||
textarea = 'textarea',
|
||||
numberInput = 'numberInput',
|
||||
select = 'select',
|
||||
slider = 'slider',
|
||||
custom = 'custom',
|
||||
target = 'target', // data input
|
||||
switch = 'switch',
|
||||
chatInput = 'chatInput',
|
||||
selectApp = 'selectApp',
|
||||
// chat special input
|
||||
aiSettings = 'aiSettings',
|
||||
maxToken = 'maxToken',
|
||||
selectChatModel = 'selectChatModel',
|
||||
// dataset special input
|
||||
selectDataset = 'selectDataset',
|
||||
hidden = 'hidden'
|
||||
}
|
||||
|
||||
export enum FlowNodeOutputTypeEnum {
|
||||
answer = 'answer',
|
||||
source = 'source',
|
||||
hidden = 'hidden'
|
||||
}
|
||||
|
||||
export enum FlowNodeTypeEnum {
|
||||
empty = 'empty',
|
||||
variable = 'variable',
|
||||
userGuide = 'userGuide',
|
||||
questionInput = 'questionInput',
|
||||
historyNode = 'historyNode',
|
||||
chatNode = 'chatNode',
|
||||
datasetSearchNode = 'datasetSearchNode',
|
||||
answerNode = 'answerNode',
|
||||
classifyQuestion = 'classifyQuestion',
|
||||
contentExtract = 'contentExtract',
|
||||
httpRequest = 'httpRequest',
|
||||
runApp = 'app',
|
||||
pluginModule = 'pluginModule',
|
||||
pluginInput = 'pluginInput',
|
||||
pluginOutput = 'pluginOutput'
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
57
packages/global/core/module/node/type.d.ts
vendored
Normal file
57
packages/global/core/module/node/type.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import {
|
||||
FlowNodeInputTypeEnum,
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeValTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from './constant';
|
||||
|
||||
export type FlowNodeChangeProps = {
|
||||
moduleId: string;
|
||||
type:
|
||||
| 'attr' // key: attr, value: new value
|
||||
| 'updateInput' // key: update input key, value: new input value
|
||||
| 'replaceInput' // key: old input key, value: new input value
|
||||
| 'addInput' // key: null, value: new input value
|
||||
| 'delInput' // key: delete input key, value: null
|
||||
| 'updateOutput' // key: update output key, value: new output value
|
||||
| 'replaceOutput' // key: old output key, value: new output value
|
||||
| 'addOutput' // key: null, value: new output value
|
||||
| 'delOutput'; // key: delete output key, value: null
|
||||
key?: string;
|
||||
value?: any;
|
||||
index?: number;
|
||||
};
|
||||
|
||||
export type FlowNodeInputItemType = {
|
||||
key: string; // 字段名
|
||||
value?: any;
|
||||
valueType?: `${FlowNodeValTypeEnum}`;
|
||||
type: `${FlowNodeInputTypeEnum}`;
|
||||
label: string;
|
||||
edit?: boolean;
|
||||
connected?: boolean;
|
||||
description?: string;
|
||||
placeholder?: string;
|
||||
max?: number;
|
||||
min?: number;
|
||||
step?: number;
|
||||
required?: boolean;
|
||||
list?: { label: string; value: any }[];
|
||||
markList?: { label: string; value: any }[];
|
||||
customData?: () => any;
|
||||
valueCheck?: (value: any) => boolean;
|
||||
};
|
||||
|
||||
export type FlowNodeOutputTargetItemType = {
|
||||
moduleId: string;
|
||||
key: string;
|
||||
};
|
||||
export type FlowNodeOutputItemType = {
|
||||
key: string; // 字段名
|
||||
label?: string;
|
||||
edit?: boolean;
|
||||
description?: string;
|
||||
valueType?: `${FlowNodeValTypeEnum}`;
|
||||
type?: `${FlowNodeOutputTypeEnum}`;
|
||||
targets: FlowNodeOutputTargetItemType[];
|
||||
};
|
Reference in New Issue
Block a user