| | |
| | | }, |
| | | { |
| | | name: '提示词', |
| | | [VueFlowConstant.PARAMS_KEY]: [ |
| | | { key: 'prompt', label: '提示词', type: 'textarea', value: '' }, |
| | | |
| | | ], |
| | | [VueFlowConstant.PARAMS_KEY]: [{ key: 'prompt', label: '提示词', type: 'textarea', value: '' }], |
| | | }, |
| | | ]; |
| | | break; |
| | | |
| | | case NodeType.Agent: |
| | | data[VueFlowConstant.GROUP_PARAMS_KEY] = [ |
| | | { |
| | | |
| | | [VueFlowConstant.PARAMS_KEY]: [ |
| | | { |
| | | key: 'agent', |
| | | label: '代理', |
| | | type: 'agent_input', |
| | | value: '', |
| | | required: true, |
| | | placeholder: '代理', |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ]; |
| | | break; |
| | | case NodeType.Output: |
| | | data[VueFlowConstant.GROUP_PARAMS_KEY] = [ |
| | | { |
| | | |
| | | [VueFlowConstant.PARAMS_KEY]: [ |
| | | { |
| | | key: 'output_msg', |
| | | label: '消息内容', |
| | | type: 'var_textarea_file', |
| | | required: true, |
| | | placeholder: |
| | | '输入需要发送给用户的消息,例如“接下来我将执行 XX 操作,请您确认”,“以下是我的初版草稿,您可以在其基础上进行修改”', |
| | | value: { msg: '', files: [] }, |
| | | }, |
| | | { |
| | | key: 'output_result', |
| | | label: '交互类型', |
| | | global: 'value.type=input', |
| | | type: 'output_form', |
| | | required: true, |
| | | value: { type: 'none', value: '' }, |
| | | options: [ |
| | | |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | |
| | | } |
| | | }; |
| | | |
| | | |
| | | static getGroupParam =(data,index=0)=>{ |
| | | static getGroupParam = (data, index = 0) => { |
| | | const group = data?.[VueFlowConstant.GROUP_PARAMS_KEY]?.[index]; |
| | | return group |
| | | } |
| | | return group; |
| | | }; |
| | | |
| | | static getParams = (group,key)=>{ |
| | | return group?.[VueFlowConstant.PARAMS_KEY]?.find((item)=>item.key===key); |
| | | } |
| | | static getParams = (group, key) => { |
| | | return group?.[VueFlowConstant.PARAMS_KEY]?.find((item) => item.key === key); |
| | | }; |
| | | } |
| | | |
| | | export class StartNodeHelper { |
| | |
| | | left?: { |
| | | var: string; |
| | | label: string; |
| | | value: string; |
| | | }, |
| | | right?: { |
| | | type: VarType; |
| | |
| | | id: VueFlowHelper.genId(), |
| | | left_var: left?.var ?? '', |
| | | left_label: left?.label ?? '', |
| | | left_value: left?.var ?? '', |
| | | comparison_operation: operation ?? '', |
| | | right_value_type: right?.type ?? VarType.Input, |
| | | right_value: right?.value ?? '', |