feat: modules
This commit is contained in:
@@ -80,6 +80,11 @@ export const appModule2FlowNode = ({
|
||||
(input) => input.label && !template.inputs.find((item) => item.key === input.key)
|
||||
)
|
||||
);
|
||||
const concatOutputs = item.outputs.concat(
|
||||
template.outputs.filter(
|
||||
(templateOutput) => !item.outputs.find((item) => item.key === templateOutput.key)
|
||||
)
|
||||
);
|
||||
|
||||
// replace item data
|
||||
const moduleItem: FlowModuleItemType = {
|
||||
@@ -93,7 +98,7 @@ export const appModule2FlowNode = ({
|
||||
value: itemInput.value
|
||||
};
|
||||
}),
|
||||
outputs: item.outputs.map((output) => {
|
||||
outputs: concatOutputs.map((output) => {
|
||||
// unChange outputs
|
||||
const templateOutput = template.outputs.find((item) => item.key === output.key);
|
||||
|
||||
|
||||
@@ -328,7 +328,18 @@ const simpleChatTemplate = (formData: EditFormType): AppModuleItemType[] => [
|
||||
inputs: chatModelInput(formData),
|
||||
outputs: [
|
||||
{
|
||||
key: TaskResponseKeyEnum.answerText,
|
||||
key: 'answerText',
|
||||
label: '模型回复',
|
||||
description: '直接响应,无需配置',
|
||||
type: 'hidden',
|
||||
targets: []
|
||||
},
|
||||
{
|
||||
key: 'finish',
|
||||
label: '回复结束',
|
||||
description: 'AI 回复完成后触发',
|
||||
valueType: 'boolean',
|
||||
type: 'source',
|
||||
targets: []
|
||||
}
|
||||
],
|
||||
@@ -518,7 +529,18 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
|
||||
inputs: chatModelInput(formData),
|
||||
outputs: [
|
||||
{
|
||||
key: TaskResponseKeyEnum.answerText,
|
||||
key: 'answerText',
|
||||
label: '模型回复',
|
||||
description: '直接响应,无需配置',
|
||||
type: 'hidden',
|
||||
targets: []
|
||||
},
|
||||
{
|
||||
key: 'finish',
|
||||
label: '回复结束',
|
||||
description: 'AI 回复完成后触发',
|
||||
valueType: 'boolean',
|
||||
type: 'source',
|
||||
targets: []
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user