Commit c3437b93 by Archer Committed by GitHub

fix: template (#597)

parent e18c79ca
...@@ -17,6 +17,7 @@ export const appTemplates: (AppItemType & { ...@@ -17,6 +17,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userGuide', moduleId: 'userGuide',
name: '用户引导', name: '用户引导',
avatar: '/imgs/module/userGuide.png',
flowType: 'userGuide', flowType: 'userGuide',
position: { position: {
x: 454.98510354678695, x: 454.98510354678695,
...@@ -25,9 +26,40 @@ export const appTemplates: (AppItemType & { ...@@ -25,9 +26,40 @@ export const appTemplates: (AppItemType & {
inputs: [ inputs: [
{ {
key: 'welcomeText', key: 'welcomeText',
type: 'input', type: 'hidden',
valueType: 'string',
label: '开场白', label: '开场白',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'variables',
type: 'hidden',
valueType: 'any',
label: '对话框变量',
value: [],
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'questionGuide',
valueType: 'boolean',
type: 'switch',
label: '问题引导',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'tts',
type: 'hidden',
valueType: 'any',
label: '语音播报',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [] outputs: []
...@@ -35,6 +67,7 @@ export const appTemplates: (AppItemType & { ...@@ -35,6 +67,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userChatInput', moduleId: 'userChatInput',
name: '用户问题(对话入口)', name: '用户问题(对话入口)',
avatar: '/imgs/module/userChatInput.png',
flowType: 'questionInput', flowType: 'questionInput',
position: { position: {
x: 464.32198615344566, x: 464.32198615344566,
...@@ -44,8 +77,11 @@ export const appTemplates: (AppItemType & { ...@@ -44,8 +77,11 @@ export const appTemplates: (AppItemType & {
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'systemInput', type: 'systemInput',
valueType: 'string',
label: '用户问题', label: '用户问题',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
...@@ -66,6 +102,7 @@ export const appTemplates: (AppItemType & { ...@@ -66,6 +102,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'chatModule', moduleId: 'chatModule',
name: 'AI 对话', name: 'AI 对话',
avatar: '/imgs/module/AI.png',
flowType: 'chatNode', flowType: 'chatNode',
showStatus: true, showStatus: true,
position: { position: {
...@@ -74,18 +111,31 @@ export const appTemplates: (AppItemType & { ...@@ -74,18 +111,31 @@ export const appTemplates: (AppItemType & {
}, },
inputs: [ inputs: [
{ {
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
},
{
key: 'model', key: 'model',
type: 'custom', type: 'selectChatModel',
label: '对话模型', label: '对话模型',
required: true,
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'gpt-3.5-turbo-16k', value: 'gpt-3.5-turbo-16k',
list: [], connected: false
connected: true
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'slider', type: 'hidden',
label: '温度', label: '温度',
value: 0, value: 0,
valueType: 'number',
min: 0, min: 0,
max: 10, max: 10,
step: 1, step: 1,
...@@ -99,15 +149,18 @@ export const appTemplates: (AppItemType & { ...@@ -99,15 +149,18 @@ export const appTemplates: (AppItemType & {
value: 10 value: 10
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'maxToken', key: 'maxToken',
type: 'custom', type: 'hidden',
label: '回复上限', label: '回复上限',
value: 8000, value: 8000,
valueType: 'number',
min: 100, min: 100,
max: 16000, max: 4000,
step: 50, step: 50,
markList: [ markList: [
{ {
...@@ -115,51 +168,96 @@ export const appTemplates: (AppItemType & { ...@@ -115,51 +168,96 @@ export const appTemplates: (AppItemType & {
value: 100 value: 100
}, },
{ {
label: '16000', label: '4000',
value: 16000 value: 4000
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'isResponseAnswerText',
type: 'hidden',
label: '返回AI内容',
value: true,
valueType: 'boolean',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'quoteTemplate',
type: 'hidden',
label: '引用内容模板',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'quotePrompt',
type: 'hidden',
label: '引用内容提示词',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'aiSettings',
type: 'aiSettings',
label: '',
valueType: 'any',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'systemPrompt', key: 'systemPrompt',
type: 'textarea', type: 'textarea',
label: '系统提示词', label: '系统提示词',
max: 300,
valueType: 'string', valueType: 'string',
description: description:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
placeholder: placeholder:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'switch', key: 'history',
type: 'target', type: 'numberInput',
label: '触发器', label: 'core.module.input.label.chat history',
valueType: 'any', required: true,
min: 0,
max: 30,
valueType: 'chatHistory',
value: 6,
showTargetInApp: true,
showTargetInPlugin: true,
connected: false connected: false
}, },
{ {
key: 'quoteQA', key: 'quoteQA',
type: 'target', type: 'target',
label: '引用内容', label: '引用内容',
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
valueType: 'datasetQuote', valueType: 'datasetQuote',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false connected: false
}, },
{ {
key: 'history',
type: 'target',
label: '聊天记录',
valueType: 'chatHistory',
connected: true,
value: 6
},
{
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -167,17 +265,26 @@ export const appTemplates: (AppItemType & { ...@@ -167,17 +265,26 @@ export const appTemplates: (AppItemType & {
{ {
key: 'answerText', key: 'answerText',
label: 'AI回复', label: 'AI回复',
description: '直接响应,无需配置', description: '将在 stream 回复完毕后触发',
type: 'hidden', valueType: 'string',
type: 'source',
targets: [] targets: []
}, },
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: 'AI 回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
},
{
key: 'history',
label: '新的上下文',
description: '将本次回复内容拼接上历史记录,作为新的上下文返回',
valueType: 'chatHistory',
type: 'source',
targets: []
} }
] ]
} }
...@@ -193,6 +300,7 @@ export const appTemplates: (AppItemType & { ...@@ -193,6 +300,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userGuide', moduleId: 'userGuide',
name: '用户引导', name: '用户引导',
avatar: '/imgs/module/userGuide.png',
flowType: 'userGuide', flowType: 'userGuide',
position: { position: {
x: 454.98510354678695, x: 454.98510354678695,
...@@ -201,10 +309,41 @@ export const appTemplates: (AppItemType & { ...@@ -201,10 +309,41 @@ export const appTemplates: (AppItemType & {
inputs: [ inputs: [
{ {
key: 'welcomeText', key: 'welcomeText',
type: 'input', type: 'hidden',
valueType: 'string',
label: '开场白', label: '开场白',
showTargetInApp: false,
showTargetInPlugin: false,
value: '你好,我是知识库助手,请不要忘记选择知识库噢~', value: '你好,我是知识库助手,请不要忘记选择知识库噢~',
connected: true connected: false
},
{
key: 'variables',
type: 'hidden',
valueType: 'any',
label: '对话框变量',
value: [],
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'questionGuide',
valueType: 'boolean',
type: 'switch',
label: '问题引导',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'tts',
type: 'hidden',
valueType: 'any',
label: '语音播报',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [] outputs: []
...@@ -212,6 +351,7 @@ export const appTemplates: (AppItemType & { ...@@ -212,6 +351,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userChatInput', moduleId: 'userChatInput',
name: '用户问题(对话入口)', name: '用户问题(对话入口)',
avatar: '/imgs/module/userChatInput.png',
flowType: 'questionInput', flowType: 'questionInput',
position: { position: {
x: 464.32198615344566, x: 464.32198615344566,
...@@ -221,8 +361,11 @@ export const appTemplates: (AppItemType & { ...@@ -221,8 +361,11 @@ export const appTemplates: (AppItemType & {
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'systemInput', type: 'systemInput',
valueType: 'string',
label: '用户问题', label: '用户问题',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
...@@ -247,6 +390,7 @@ export const appTemplates: (AppItemType & { ...@@ -247,6 +390,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'datasetSearch', moduleId: 'datasetSearch',
name: '知识库搜索', name: '知识库搜索',
avatar: '/imgs/module/db.png',
flowType: 'datasetSearchNode', flowType: 'datasetSearchNode',
showStatus: true, showStatus: true,
position: { position: {
...@@ -255,54 +399,87 @@ export const appTemplates: (AppItemType & { ...@@ -255,54 +399,87 @@ export const appTemplates: (AppItemType & {
}, },
inputs: [ inputs: [
{ {
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
},
{
key: 'datasets', key: 'datasets',
type: 'custom', type: 'selectDataset',
label: '关联的知识库', label: '关联的知识库',
value: [], value: [],
valueType: 'selectDataset',
list: [], list: [],
connected: true required: true,
showTargetInApp: false,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'similarity', key: 'similarity',
type: 'slider', type: 'hidden',
label: '相关度', label: '最低相关性',
value: 0.4, value: 0.4,
valueType: 'number',
min: 0, min: 0,
max: 1, max: 1,
step: 0.01, step: 0.01,
markList: [ markList: [
{ {
label: '100', label: '0',
value: 100 value: 0
}, },
{ {
label: '1', label: '1',
value: 1 value: 1
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'limit', key: 'limit',
type: 'slider', type: 'hidden',
label: '单次搜索上限', label: '引用上限',
description: '最多取 n 条记录作为本次问题引用', description: '单次搜索最大的 Tokens 数量,中文约1字=1.7Tokens,英文约1字=1Tokens',
value: 1500, value: 1500,
connected: true valueType: 'number',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'switch', key: 'searchMode',
type: 'target', type: 'hidden',
label: '触发器', label: 'core.dataset.search.Mode',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'embedding',
connected: false
},
{
key: 'datasetParamsModal',
type: 'selectDatasetParamsModal',
label: '',
valueType: 'any', valueType: 'any',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false connected: false
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -344,12 +521,21 @@ export const appTemplates: (AppItemType & { ...@@ -344,12 +521,21 @@ export const appTemplates: (AppItemType & {
key: 'quoteQA' key: 'quoteQA'
} }
] ]
},
{
key: 'finish',
label: 'core.module.output.label.running done',
description: 'core.module.output.description.running done',
valueType: 'boolean',
type: 'source',
targets: []
} }
] ]
}, },
{ {
moduleId: 'chatModule', moduleId: 'chatModule',
name: 'AI 对话', name: 'AI 对话',
avatar: '/imgs/module/AI.png',
flowType: 'chatNode', flowType: 'chatNode',
showStatus: true, showStatus: true,
position: { position: {
...@@ -358,18 +544,31 @@ export const appTemplates: (AppItemType & { ...@@ -358,18 +544,31 @@ export const appTemplates: (AppItemType & {
}, },
inputs: [ inputs: [
{ {
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true
},
{
key: 'model', key: 'model',
type: 'custom', type: 'selectChatModel',
label: '对话模型', label: '对话模型',
required: true,
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'gpt-3.5-turbo-16k', value: 'gpt-3.5-turbo-16k',
list: [], connected: false
connected: true
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'slider', type: 'hidden',
label: '温度', label: '温度',
value: 0, value: 0,
valueType: 'number',
min: 0, min: 0,
max: 10, max: 10,
step: 1, step: 1,
...@@ -383,15 +582,18 @@ export const appTemplates: (AppItemType & { ...@@ -383,15 +582,18 @@ export const appTemplates: (AppItemType & {
value: 10 value: 10
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'maxToken', key: 'maxToken',
type: 'custom', type: 'hidden',
label: '回复上限', label: '回复上限',
value: 8000, value: 8000,
valueType: 'number',
min: 100, min: 100,
max: 16000, max: 4000,
step: 50, step: 50,
markList: [ markList: [
{ {
...@@ -399,51 +601,96 @@ export const appTemplates: (AppItemType & { ...@@ -399,51 +601,96 @@ export const appTemplates: (AppItemType & {
value: 100 value: 100
}, },
{ {
label: '16000', label: '4000',
value: 16000 value: 4000
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'isResponseAnswerText',
type: 'hidden',
label: '返回AI内容',
value: true,
valueType: 'boolean',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'quoteTemplate',
type: 'hidden',
label: '引用内容模板',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'quotePrompt',
type: 'hidden',
label: '引用内容提示词',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'aiSettings',
type: 'aiSettings',
label: '',
valueType: 'any',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'systemPrompt', key: 'systemPrompt',
type: 'textarea', type: 'textarea',
label: '系统提示词', label: '系统提示词',
max: 300,
valueType: 'string', valueType: 'string',
description: description:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
placeholder: placeholder:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'switch', key: 'history',
type: 'target', type: 'numberInput',
label: '触发器', label: 'core.module.input.label.chat history',
valueType: 'any', required: true,
connected: true min: 0,
max: 30,
valueType: 'chatHistory',
value: 6,
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'quoteQA', key: 'quoteQA',
type: 'target', type: 'target',
label: '引用内容', label: '引用内容',
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
valueType: 'datasetQuote', valueType: 'datasetQuote',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'history',
type: 'target',
label: '聊天记录',
valueType: 'chatHistory',
connected: true,
value: 6
},
{
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -451,23 +698,33 @@ export const appTemplates: (AppItemType & { ...@@ -451,23 +698,33 @@ export const appTemplates: (AppItemType & {
{ {
key: 'answerText', key: 'answerText',
label: 'AI回复', label: 'AI回复',
description: '直接响应,无需配置', description: '将在 stream 回复完毕后触发',
type: 'hidden', valueType: 'string',
type: 'source',
targets: [] targets: []
}, },
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: 'AI 回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
},
{
key: 'history',
label: '新的上下文',
description: '将本次回复内容拼接上历史记录,作为新的上下文返回',
valueType: 'chatHistory',
type: 'source',
targets: []
} }
] ]
}, },
{ {
moduleId: '2752oj', moduleId: '2752oj',
name: '指定回复', name: '指定回复',
avatar: '/imgs/module/reply.png',
flowType: 'answerNode', flowType: 'answerNode',
position: { position: {
x: 1542.9271243684725, x: 1542.9271243684725,
...@@ -477,22 +734,35 @@ export const appTemplates: (AppItemType & { ...@@ -477,22 +734,35 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'text', key: 'text',
value: '搜索结果为空',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'any',
label: '回复的内容', label: '回复的内容',
description: description:
'可以使用 \\n 来实现换行。也可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容', '可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
value: '搜索结果为空',
connected: false
} }
], ],
outputs: [] outputs: [
{
key: 'finish',
label: 'core.module.output.label.running done',
description: 'core.module.output.description.running done',
valueType: 'boolean',
type: 'source',
targets: []
}
]
} }
] ]
}, },
...@@ -506,6 +776,7 @@ export const appTemplates: (AppItemType & { ...@@ -506,6 +776,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userGuide', moduleId: 'userGuide',
name: '用户引导', name: '用户引导',
avatar: '/imgs/module/userGuide.png',
flowType: 'userGuide', flowType: 'userGuide',
position: { position: {
x: 447.98520778293346, x: 447.98520778293346,
...@@ -515,13 +786,17 @@ export const appTemplates: (AppItemType & { ...@@ -515,13 +786,17 @@ export const appTemplates: (AppItemType & {
{ {
key: 'welcomeText', key: 'welcomeText',
type: 'hidden', type: 'hidden',
valueType: 'string',
label: '开场白', label: '开场白',
showTargetInApp: false,
showTargetInPlugin: false,
value: '你好,我可以为你翻译各种语言,请告诉我你需要翻译成什么语言?', value: '你好,我可以为你翻译各种语言,请告诉我你需要翻译成什么语言?',
connected: true connected: false
}, },
{ {
key: 'variables', key: 'variables',
type: 'hidden', type: 'hidden',
valueType: 'any',
label: '对话框变量', label: '对话框变量',
value: [ value: [
{ {
...@@ -554,14 +829,28 @@ export const appTemplates: (AppItemType & { ...@@ -554,14 +829,28 @@ export const appTemplates: (AppItemType & {
] ]
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'questionGuide', key: 'questionGuide',
valueType: 'boolean',
type: 'switch', type: 'switch',
label: '问题引导', label: '问题引导',
showTargetInApp: false,
showTargetInPlugin: false,
value: false, value: false,
connected: true connected: false
},
{
key: 'tts',
type: 'hidden',
valueType: 'any',
label: '语音播报',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [] outputs: []
...@@ -569,6 +858,7 @@ export const appTemplates: (AppItemType & { ...@@ -569,6 +858,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'userChatInput', moduleId: 'userChatInput',
name: '用户问题(对话入口)', name: '用户问题(对话入口)',
avatar: '/imgs/module/userChatInput.png',
flowType: 'questionInput', flowType: 'questionInput',
position: { position: {
x: 464.32198615344566, x: 464.32198615344566,
...@@ -578,8 +868,11 @@ export const appTemplates: (AppItemType & { ...@@ -578,8 +868,11 @@ export const appTemplates: (AppItemType & {
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'systemInput', type: 'systemInput',
valueType: 'string',
label: '用户问题', label: '用户问题',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
...@@ -600,25 +893,40 @@ export const appTemplates: (AppItemType & { ...@@ -600,25 +893,40 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'chatModule', moduleId: 'chatModule',
name: 'AI 对话', name: 'AI 对话',
avatar: '/imgs/module/AI.png',
flowType: 'chatNode', flowType: 'chatNode',
showStatus: true, showStatus: true,
position: { position: {
x: 981.9682828103937, x: 981.9682828103937,
y: 890.014595014464 y: 890.014595014464
}, },
inputs: [ inputs: [
{
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
},
{ {
key: 'model', key: 'model',
type: 'custom', type: 'selectChatModel',
label: '对话模型', label: '对话模型',
required: true,
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'gpt-3.5-turbo-16k', value: 'gpt-3.5-turbo-16k',
connected: true connected: false
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'slider', type: 'hidden',
label: '温度', label: '温度',
value: 0, value: 0,
valueType: 'number',
min: 0, min: 0,
max: 10, max: 10,
step: 1, step: 1,
...@@ -632,13 +940,16 @@ export const appTemplates: (AppItemType & { ...@@ -632,13 +940,16 @@ export const appTemplates: (AppItemType & {
value: 10 value: 10
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'maxToken', key: 'maxToken',
type: 'custom', type: 'hidden',
label: '回复上限', label: '回复上限',
value: 8000, value: 8000,
valueType: 'number',
min: 100, min: 100,
max: 4000, max: 4000,
step: 50, step: 50,
...@@ -652,64 +963,93 @@ export const appTemplates: (AppItemType & { ...@@ -652,64 +963,93 @@ export const appTemplates: (AppItemType & {
value: 4000 value: 4000
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'systemPrompt', key: 'isResponseAnswerText',
type: 'textarea', type: 'hidden',
label: '系统提示词', label: '返回AI内容',
max: 300, value: true,
valueType: 'string', valueType: 'boolean',
description: showTargetInApp: false,
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', showTargetInPlugin: false,
placeholder: connected: false
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
value: '请直接将我的问题翻译成{{language}},不需要回答问题。',
connected: true
}, },
{ {
key: 'quoteTemplate', key: 'quoteTemplate',
type: 'hidden', type: 'hidden',
label: '引用内容模板', label: '引用内容模板',
valueType: 'string', valueType: 'string',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'quotePrompt', key: 'quotePrompt',
type: 'hidden', type: 'hidden',
label: '引用内容提示词', label: '引用内容提示词',
valueType: 'string', valueType: 'string',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'switch', key: 'aiSettings',
type: 'target', type: 'aiSettings',
label: '触发器', label: '',
valueType: 'any', valueType: 'any',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false connected: false
}, },
{ {
key: 'quoteQA', key: 'systemPrompt',
type: 'custom', type: 'textarea',
label: '引用内容', label: '系统提示词',
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]", max: 300,
valueType: 'datasetQuote', valueType: 'string',
description:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
placeholder:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
showTargetInApp: true,
showTargetInPlugin: true,
value: '请直接将我的问题翻译成{{language}},不需要回答问题。',
connected: false connected: false
}, },
{ {
key: 'history', key: 'history',
type: 'target', type: 'numberInput',
label: '聊天记录', label: 'core.module.input.label.chat history',
required: true,
min: 0,
max: 30,
valueType: 'chatHistory', valueType: 'chatHistory',
connected: true, value: 6,
value: 6 showTargetInApp: true,
showTargetInPlugin: true,
connected: false
},
{
key: 'quoteQA',
type: 'target',
label: '引用内容',
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
valueType: 'datasetQuote',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -724,8 +1064,8 @@ export const appTemplates: (AppItemType & { ...@@ -724,8 +1064,8 @@ export const appTemplates: (AppItemType & {
}, },
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: 'AI 回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -752,6 +1092,7 @@ export const appTemplates: (AppItemType & { ...@@ -752,6 +1092,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: '7z5g5h', moduleId: '7z5g5h',
name: '用户问题(对话入口)', name: '用户问题(对话入口)',
avatar: '/imgs/module/userChatInput.png',
flowType: 'questionInput', flowType: 'questionInput',
position: { position: {
x: 198.56612928723575, x: 198.56612928723575,
...@@ -761,8 +1102,11 @@ export const appTemplates: (AppItemType & { ...@@ -761,8 +1102,11 @@ export const appTemplates: (AppItemType & {
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'systemInput', type: 'systemInput',
valueType: 'string',
label: '用户问题', label: '用户问题',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
...@@ -787,6 +1131,7 @@ export const appTemplates: (AppItemType & { ...@@ -787,6 +1131,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'remuj3', moduleId: 'remuj3',
name: '问题分类', name: '问题分类',
avatar: '/imgs/module/cq.png',
flowType: 'classifyQuestion', flowType: 'classifyQuestion',
showStatus: true, showStatus: true,
position: { position: {
...@@ -797,41 +1142,64 @@ export const appTemplates: (AppItemType & { ...@@ -797,41 +1142,64 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
},
{
key: 'model',
type: 'selectCQModel',
valueType: 'string',
label: '分类模型',
required: true,
showTargetInApp: false,
showTargetInPlugin: false,
value: 'gpt-3.5-turbo',
connected: false connected: false
}, },
{ {
key: 'systemPrompt', key: 'systemPrompt',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'string',
value: label: '背景知识',
'laf 是云开发平台,可以快速的开发应用\nlaf 是一个开源的 BaaS 开发平台(Backend as a Service)\nlaf 是一个开箱即用的 serverless 开发平台\nlaf 是一个集「函数计算」、「数据库」、「对象存储」等于一身的一站式开发平台\nlaf 可以是开源版的腾讯云开发、开源版的 Google Firebase、开源版的 UniCloud',
label: '系统提示词',
description: description:
'你可以添加一些特定内容的介绍,从而更好的识别用户的问题类型。这个内容通常是给模型介绍一个它不知道的内容。', '你可以添加一些特定内容的介绍,从而更好的识别用户的问题类型。这个内容通常是给模型介绍一个它不知道的内容。',
placeholder: '例如: \n1. Laf 是一个云函数开发平台……\n2. Sealos 是一个集群操作系统', placeholder:
connected: true '例如: \n1. AIGC(人工智能生成内容)是指使用人工智能技术自动或半自动地生成数字内容,如文本、图像、音乐、视频等。\n2. AIGC技术包括但不限于自然语言处理、计算机视觉、机器学习和深度学习。这些技术可以创建新内容或修改现有内容,以满足特定的创意、教育、娱乐或信息需求。',
showTargetInApp: true,
showTargetInPlugin: true,
value: '',
connected: false
}, },
{ {
key: 'history', key: 'history',
type: 'target', type: 'numberInput',
label: '聊天记录', label: 'core.module.input.label.chat history',
required: true,
min: 0,
max: 30,
valueType: 'chatHistory', valueType: 'chatHistory',
connected: true, value: 6,
value: 6 showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'agents', key: 'agents',
type: 'custom', type: 'custom',
valueType: 'any',
label: '', label: '',
value: [ value: [
{ {
...@@ -851,7 +1219,9 @@ export const appTemplates: (AppItemType & { ...@@ -851,7 +1219,9 @@ export const appTemplates: (AppItemType & {
key: 'oy1c' key: 'oy1c'
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
...@@ -904,6 +1274,7 @@ export const appTemplates: (AppItemType & { ...@@ -904,6 +1274,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'a99p6z', moduleId: 'a99p6z',
name: '指定回复', name: '指定回复',
avatar: '/imgs/module/reply.png',
flowType: 'answerNode', flowType: 'answerNode',
position: { position: {
x: 1304.2886011902247, x: 1304.2886011902247,
...@@ -913,26 +1284,30 @@ export const appTemplates: (AppItemType & { ...@@ -913,26 +1284,30 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'text', key: 'text',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'any',
value: '你好,有什么可以帮助你的?',
label: '回复的内容', label: '回复的内容',
description: description:
'可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容', '可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
value: '你好,有什么可以帮助你的?',
connected: false
} }
], ],
outputs: [ outputs: [
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: '回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -942,6 +1317,7 @@ export const appTemplates: (AppItemType & { ...@@ -942,6 +1317,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'iejcou', moduleId: 'iejcou',
name: '指定回复', name: '指定回复',
avatar: '/imgs/module/reply.png',
flowType: 'answerNode', flowType: 'answerNode',
position: { position: {
x: 1294.2531189034548, x: 1294.2531189034548,
...@@ -951,26 +1327,30 @@ export const appTemplates: (AppItemType & { ...@@ -951,26 +1327,30 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'text', key: 'text',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'any',
value: '你好,我仅能回答 laf 相关问题,请问你有什么问题么?',
label: '回复的内容', label: '回复的内容',
description: description:
'可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容', '可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
value: '你好,我仅能回答 laf 相关问题,请问你有什么问题么?',
connected: false
} }
], ],
outputs: [ outputs: [
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: '回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -980,6 +1360,7 @@ export const appTemplates: (AppItemType & { ...@@ -980,6 +1360,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'nlfwkc', moduleId: 'nlfwkc',
name: 'AI 对话', name: 'AI 对话',
avatar: '/imgs/module/AI.png',
flowType: 'chatNode', flowType: 'chatNode',
showStatus: true, showStatus: true,
position: { position: {
...@@ -988,59 +1369,31 @@ export const appTemplates: (AppItemType & { ...@@ -988,59 +1369,31 @@ export const appTemplates: (AppItemType & {
}, },
inputs: [ inputs: [
{ {
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true
},
{
key: 'model', key: 'model',
type: 'custom', type: 'selectChatModel',
label: '对话模型', label: '对话模型',
required: true,
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'gpt-3.5-turbo-16k', value: 'gpt-3.5-turbo-16k',
list: [ connected: false
{
label: 'FastAI-4k',
value: 'gpt-3.5-turbo'
},
{
label: 'FastAI-instruct',
value: 'gpt-3.5-turbo-instruct'
},
{
label: 'FastAI-16k',
value: 'gpt-3.5-turbo-16k'
},
{
label: 'FastAI-Plus-8k',
value: 'gpt-4'
},
{
label: 'FastAI-Plus-32k',
value: 'gpt-4-32k'
},
{
label: '百川2-13B(测试)',
value: 'baichuan2-13b'
},
{
label: '文心一言(QPS 5)',
value: 'ERNIE-Bot'
},
{
label: '星火2.0(QPS 2)',
value: 'SparkDesk'
},
{
label: 'chatglm_pro(QPS 5)',
value: 'chatglm_pro'
},
{
label: '通义千问(QPS 5)',
value: 'qwen-v1'
}
],
connected: true
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'slider', type: 'hidden',
label: '温度', label: '温度',
value: 0, value: 0,
valueType: 'number',
min: 0, min: 0,
max: 10, max: 10,
step: 1, step: 1,
...@@ -1054,13 +1407,16 @@ export const appTemplates: (AppItemType & { ...@@ -1054,13 +1407,16 @@ export const appTemplates: (AppItemType & {
value: 10 value: 10
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'maxToken', key: 'maxToken',
type: 'custom', type: 'hidden',
label: '回复上限', label: '回复上限',
value: 8000, value: 8000,
valueType: 'number',
min: 100, min: 100,
max: 4000, max: 4000,
step: 50, step: 50,
...@@ -1074,64 +1430,93 @@ export const appTemplates: (AppItemType & { ...@@ -1074,64 +1430,93 @@ export const appTemplates: (AppItemType & {
value: 4000 value: 4000
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'systemPrompt', key: 'isResponseAnswerText',
type: 'textarea', type: 'hidden',
label: '系统提示词', label: '返回AI内容',
max: 300, value: true,
valueType: 'string', valueType: 'boolean',
description: showTargetInApp: false,
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}', showTargetInPlugin: false,
placeholder: connected: false
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
value: '知识库是关于 laf 的内容。',
connected: true
}, },
{ {
key: 'quoteTemplate', key: 'quoteTemplate',
type: 'hidden', type: 'hidden',
label: '引用内容模板', label: '引用内容模板',
valueType: 'string', valueType: 'string',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'quotePrompt', key: 'quotePrompt',
type: 'hidden', type: 'hidden',
label: '引用内容提示词', label: '引用内容提示词',
valueType: 'string', valueType: 'string',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'switch', key: 'aiSettings',
type: 'target', type: 'aiSettings',
label: '触发器', label: '',
valueType: 'any', valueType: 'any',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'systemPrompt',
type: 'textarea',
label: '系统提示词',
max: 300,
valueType: 'string',
description:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
placeholder:
'模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}',
showTargetInApp: true,
showTargetInPlugin: true,
value: '知识库是关于 laf 的内容。',
connected: false
},
{
key: 'history',
type: 'numberInput',
label: 'core.module.input.label.chat history',
required: true,
min: 0,
max: 30,
valueType: 'chatHistory',
value: 6,
showTargetInApp: true,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'quoteQA', key: 'quoteQA',
type: 'custom', type: 'target',
label: '引用内容', label: '引用内容',
description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]", description: "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
valueType: 'datasetQuote', valueType: 'datasetQuote',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'history',
type: 'target',
label: '聊天记录',
valueType: 'chatHistory',
connected: true,
value: 6
},
{
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -1146,8 +1531,8 @@ export const appTemplates: (AppItemType & { ...@@ -1146,8 +1531,8 @@ export const appTemplates: (AppItemType & {
}, },
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: 'AI 回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -1165,6 +1550,7 @@ export const appTemplates: (AppItemType & { ...@@ -1165,6 +1550,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'fljhzy', moduleId: 'fljhzy',
name: '知识库搜索', name: '知识库搜索',
avatar: '/imgs/module/db.png',
flowType: 'datasetSearchNode', flowType: 'datasetSearchNode',
showStatus: true, showStatus: true,
position: { position: {
...@@ -1173,54 +1559,87 @@ export const appTemplates: (AppItemType & { ...@@ -1173,54 +1559,87 @@ export const appTemplates: (AppItemType & {
}, },
inputs: [ inputs: [
{ {
key: 'switch',
type: 'target',
label: 'core.module.input.label.switch',
valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true
},
{
key: 'datasets', key: 'datasets',
type: 'custom', type: 'selectDataset',
label: '关联的知识库', label: '关联的知识库',
value: [], value: [],
valueType: 'selectDataset',
list: [], list: [],
connected: true required: true,
showTargetInApp: false,
showTargetInPlugin: true,
connected: false
}, },
{ {
key: 'similarity', key: 'similarity',
type: 'slider', type: 'hidden',
label: '相关度', label: '最低相关性',
value: 0.76, value: 0.76,
valueType: 'number',
min: 0, min: 0,
max: 1, max: 1,
step: 0.01, step: 0.01,
markList: [ markList: [
{ {
label: '100', label: '0',
value: 100 value: 0
}, },
{ {
label: '1', label: '1',
value: 1 value: 1
} }
], ],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'limit', key: 'limit',
type: 'slider', type: 'hidden',
label: '引用上限', label: '引用上限',
description: '单次搜索最大的 Tokens 数量,中文约1字=1.7Tokens,英文约1字=1Tokens', description: '单次搜索最大的 Tokens 数量,中文约1字=1.7Tokens,英文约1字=1Tokens',
value: 1500, value: 1500,
connected: true valueType: 'number',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'switch', key: 'searchMode',
type: 'target', type: 'hidden',
label: '触发器', label: 'core.dataset.search.Mode',
valueType: 'string',
showTargetInApp: false,
showTargetInPlugin: false,
value: 'embedding',
connected: false
},
{
key: 'datasetParamsModal',
type: 'selectDatasetParamsModal',
label: '',
valueType: 'any', valueType: 'any',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'target', type: 'target',
label: '用户问题', label: 'core.module.input.label.user question',
required: true, required: true,
valueType: 'string', valueType: 'string',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
} }
], ],
...@@ -1262,12 +1681,21 @@ export const appTemplates: (AppItemType & { ...@@ -1262,12 +1681,21 @@ export const appTemplates: (AppItemType & {
key: 'quoteQA' key: 'quoteQA'
} }
] ]
},
{
key: 'finish',
label: 'core.module.output.label.running done',
description: 'core.module.output.description.running done',
valueType: 'boolean',
type: 'source',
targets: []
} }
] ]
}, },
{ {
moduleId: 'q9equb', moduleId: 'q9equb',
name: '用户引导', name: '用户引导',
avatar: '/imgs/module/userGuide.png',
flowType: 'userGuide', flowType: 'userGuide',
position: { position: {
x: 191.4857498376603, x: 191.4857498376603,
...@@ -1277,23 +1705,41 @@ export const appTemplates: (AppItemType & { ...@@ -1277,23 +1705,41 @@ export const appTemplates: (AppItemType & {
{ {
key: 'welcomeText', key: 'welcomeText',
type: 'hidden', type: 'hidden',
valueType: 'string',
label: '开场白', label: '开场白',
showTargetInApp: false,
showTargetInPlugin: false,
value: value:
'你好,我是 laf 助手,有什么可以帮助你的?\n[laf 是什么?有什么用?]\n[laf 在线体验地址]\n[官网地址是多少]', '你好,我是 laf 助手,有什么可以帮助你的?\n[laf 是什么?有什么用?]\n[laf 在线体验地址]\n[官网地址是多少]',
connected: true connected: false
}, },
{ {
key: 'variables', key: 'variables',
type: 'hidden', type: 'hidden',
valueType: 'any',
label: '对话框变量', label: '对话框变量',
value: [], value: [],
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
}, },
{ {
key: 'questionGuide', key: 'questionGuide',
valueType: 'boolean',
type: 'switch', type: 'switch',
label: '问题引导', label: '问题引导',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
},
{
key: 'tts',
type: 'hidden',
valueType: 'any',
label: '语音播报',
showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [] outputs: []
...@@ -1301,6 +1747,7 @@ export const appTemplates: (AppItemType & { ...@@ -1301,6 +1747,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: 'tc90wz', moduleId: 'tc90wz',
name: '指定回复', name: '指定回复',
avatar: '/imgs/module/reply.png',
flowType: 'answerNode', flowType: 'answerNode',
position: { position: {
x: 2262.720467249169, x: 2262.720467249169,
...@@ -1310,26 +1757,30 @@ export const appTemplates: (AppItemType & { ...@@ -1310,26 +1757,30 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'text', key: 'text',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'any',
value: '对不起,我找不到你的问题,请更加详细的描述你的问题。',
label: '回复的内容', label: '回复的内容',
description: description:
'可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容', '可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
value: '对不起,我找不到你的问题,请更加详细的描述你的问题。',
connected: false
} }
], ],
outputs: [ outputs: [
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: '回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -1339,6 +1790,7 @@ export const appTemplates: (AppItemType & { ...@@ -1339,6 +1790,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: '5v78ap', moduleId: '5v78ap',
name: '指定回复', name: '指定回复',
avatar: '/imgs/module/reply.png',
flowType: 'answerNode', flowType: 'answerNode',
position: { position: {
x: 1294.814522053934, x: 1294.814522053934,
...@@ -1348,26 +1800,30 @@ export const appTemplates: (AppItemType & { ...@@ -1348,26 +1800,30 @@ export const appTemplates: (AppItemType & {
{ {
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: 'core.module.input.label.switch',
valueType: 'any', valueType: 'any',
showTargetInApp: true,
showTargetInPlugin: true,
connected: true connected: true
}, },
{ {
key: 'text', key: 'text',
type: 'textarea', type: 'textarea',
valueType: 'string', valueType: 'any',
value: '这是一个商务问题',
label: '回复的内容', label: '回复的内容',
description: description:
'可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容', '可以使用 \\n 来实现连续换行。\n\n可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容。\n\n如传入非字符串类型数据将会自动转成字符串',
connected: true showTargetInApp: true,
showTargetInPlugin: true,
value: '这是一个商务问题',
connected: false
} }
], ],
outputs: [ outputs: [
{ {
key: 'finish', key: 'finish',
label: '回复结束', label: 'core.module.output.label.running done',
description: '回复完成后触发', description: 'core.module.output.description.running done',
valueType: 'boolean', valueType: 'boolean',
type: 'source', type: 'source',
targets: [] targets: []
...@@ -1377,6 +1833,7 @@ export const appTemplates: (AppItemType & { ...@@ -1377,6 +1833,7 @@ export const appTemplates: (AppItemType & {
{ {
moduleId: '9act94', moduleId: '9act94',
name: '用户问题(对话入口)', name: '用户问题(对话入口)',
avatar: '/imgs/module/userChatInput.png',
flowType: 'questionInput', flowType: 'questionInput',
position: { position: {
x: 1827.2213090948171, x: 1827.2213090948171,
...@@ -1386,8 +1843,11 @@ export const appTemplates: (AppItemType & { ...@@ -1386,8 +1843,11 @@ export const appTemplates: (AppItemType & {
{ {
key: 'userChatInput', key: 'userChatInput',
type: 'systemInput', type: 'systemInput',
valueType: 'string',
label: '用户问题', label: '用户问题',
connected: true showTargetInApp: false,
showTargetInPlugin: false,
connected: false
} }
], ],
outputs: [ outputs: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment