Commit c3437b93 by Archer Committed by GitHub

fix: template (#597)

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