Commit b7d18e38 by archer

perf: template

parent 5e0b1470
import { SystemInputEnum } from '../app'; import { SystemInputEnum } from '../app';
import { TaskResponseKeyEnum } from '../chat'; import { TaskResponseKeyEnum } from '../chat';
import { FlowModuleTypeEnum, FlowInputItemTypeEnum, FlowOutputItemTypeEnum } from './index'; import {
FlowModuleTypeEnum,
FlowInputItemTypeEnum,
FlowOutputItemTypeEnum,
SpecialInputKeyEnum
} from './index';
import type { AppItemType } from '@/types/app'; import type { AppItemType } from '@/types/app';
import type { FlowModuleTemplateType } from '@/types/flow'; import type { FlowModuleTemplateType } from '@/types/flow';
import { chatModelList } from '@/store/static'; import { chatModelList } from '@/store/static';
...@@ -257,7 +262,7 @@ export const AnswerModule: FlowModuleTemplateType = { ...@@ -257,7 +262,7 @@ export const AnswerModule: FlowModuleTemplateType = {
inputs: [ inputs: [
Input_Template_TFSwitch, Input_Template_TFSwitch,
{ {
key: 'text', key: SpecialInputKeyEnum.answerText,
value: '', value: '',
type: FlowInputItemTypeEnum.textarea, type: FlowInputItemTypeEnum.textarea,
label: '回复的内容' label: '回复的内容'
...@@ -385,1297 +390,883 @@ export const ModuleTemplatesFlat = ModuleTemplates.map((templates) => templates. ...@@ -385,1297 +390,883 @@ export const ModuleTemplatesFlat = ModuleTemplates.map((templates) => templates.
// template // template
export const appTemplates: (AppItemType & { avatar: string; intro: string })[] = [ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] = [
// { {
// id: 'simpleChat', id: 'simpleChat',
// avatar: '/imgs/module/AI.png', avatar: '/imgs/module/AI.png',
// name: '简单的对话', name: '简单的对话',
// intro: '一个极其简单的 AI 对话应用', intro: '一个极其简单的 AI 对话应用',
// modules: [ modules: [
// { {
// ...UserInputModule, moduleId: 'userChatInput',
// inputs: [ position: {
// { x: 464.32198615344566,
// key: 'userChatInput', y: 1602.2698463081606
// type: 'systemInput', },
// label: '用户问题', flowType: 'questionInput',
// connected: false inputs: [
// } {
// ], key: 'userChatInput',
// outputs: [ connected: true
// { }
// key: 'userChatInput', ],
// label: '用户问题', outputs: [
// type: 'source', {
// targets: [ key: 'userChatInput',
// { targets: [
// moduleId: '7pacf0', {
// key: 'userChatInput' moduleId: 'chatModule',
// } key: 'userChatInput'
// ] }
// } ]
// ], }
// position: { ]
// x: 477.9074315528994, },
// y: 1604.2106242223683 {
// }, moduleId: 'history',
// moduleId: '7z5g5h' position: {
// }, x: 452.5466249541586,
// { y: 1276.3930310334215
// ...ChatModule, },
// inputs: [ flowType: 'historyNode',
// { inputs: [
// key: 'model', {
// type: 'custom', key: 'maxContext',
// label: '对话模型', value: 10,
// value: 'gpt-3.5-turbo-16k', connected: true
// list: [ },
// { {
// label: 'FastAI-4k', key: 'history',
// value: 'gpt-3.5-turbo' connected: true
// }, }
// { ],
// label: 'FastAI-16k', outputs: [
// value: 'gpt-3.5-turbo-16k' {
// }, key: 'history',
// { targets: [
// label: 'FastAI-Plus', {
// value: 'gpt-4' moduleId: 'chatModule',
// } key: 'history'
// ], }
// connected: false ]
// }, }
// { ]
// key: 'temperature', },
// type: 'custom', {
// label: '温度', moduleId: 'chatModule',
// value: 0, position: {
// min: 0, x: 981.9682828103937,
// max: 10, y: 890.014595014464
// step: 1, },
// markList: [ flowType: 'chatNode',
// { inputs: [
// label: '严谨', {
// value: 0 key: 'model',
// }, value: 'gpt-3.5-turbo-16k',
// { connected: true
// label: '发散', },
// value: 10 {
// } key: 'temperature',
// ], value: 0,
// connected: false connected: true
// }, },
// { {
// key: 'maxToken', key: 'maxToken',
// type: 'custom', value: 8000,
// label: '回复上限', connected: true
// value: 8000, },
// min: 100, {
// max: 16000, key: 'systemPrompt',
// step: 50, value: '',
// markList: [ connected: true
// { },
// label: '0', {
// value: 0 key: 'limitPrompt',
// }, value: '',
// { connected: true
// label: '16000', },
// value: 16000 {
// } key: 'switch',
// ], connected: false
// connected: false },
// }, {
// { key: 'quoteQA',
// key: 'systemPrompt', connected: false
// type: 'textarea', },
// label: '系统提示词', {
// description: key: 'history',
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', connected: true
// placeholder: },
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', {
// value: '', key: 'userChatInput',
// connected: false connected: true
// }, }
// { ],
// key: 'limitPrompt', outputs: [
// type: 'textarea', {
// label: '限定词', key: 'answerText',
// description: targets: []
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', }
// placeholder: ]
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', }
// value: '', ]
// connected: false },
// }, {
// { id: 'simpleKbChat',
// key: 'switch', avatar: '/imgs/module/db.png',
// type: 'target', name: '知识库 + 对话引导',
// label: '触发器', intro: '每次提问时进行一次知识库搜索,将搜索结果注入 LLM 模型进行参考回答',
// connected: false modules: [
// }, {
// { moduleId: 'userGuide',
// key: 'quoteQA', position: {
// type: 'target', x: 447.98520778293346,
// label: '引用内容', y: 721.4016845336229
// connected: false },
// }, flowType: 'userGuide',
// { inputs: [
// key: 'history', {
// type: 'target', key: 'welcomeText',
// label: '聊天记录', value:
// connected: true '我是 laf 助手,请问有什么可以帮助你的么?\n[laf 是什么?]\n[laf 官网是多少?]\n[交流群]',
// }, connected: true
// { }
// key: 'userChatInput', ],
// type: 'target', outputs: []
// label: '用户问题', },
// connected: true {
// } moduleId: 'userChatInput',
// ], position: {
// outputs: [ x: 464.32198615344566,
// { y: 1602.2698463081606
// key: 'answerText', },
// label: '模型回复', flowType: 'questionInput',
// description: '直接响应,无需配置', inputs: [
// type: 'hidden', {
// targets: [] key: 'userChatInput',
// } connected: true
// ], }
// position: { ],
// x: 981.9682828103937, outputs: [
// y: 890.014595014464 {
// }, key: 'userChatInput',
// moduleId: '7pacf0' targets: [
// }, {
// { moduleId: 'chatModule',
// ...HistoryModule, key: 'userChatInput'
// inputs: [ },
// { {
// key: 'maxContext', moduleId: 'kbSearch',
// type: 'numberInput', key: 'userChatInput'
// label: '最长记录数', }
// value: 10, ]
// min: 0, }
// max: 50, ]
// connected: false },
// }, {
// { moduleId: 'history',
// key: 'history', position: {
// type: 'hidden', x: 458.37518916304566,
// label: '聊天记录', y: 1296.7930057645262
// connected: false },
// } flowType: 'historyNode',
// ], inputs: [
// outputs: [ {
// { key: 'maxContext',
// key: 'history', value: 10,
// label: '聊天记录', connected: true
// type: 'source', },
// targets: [ {
// { key: 'history',
// moduleId: '7pacf0', connected: true
// key: 'history' }
// } ],
// ] outputs: [
// } {
// ], key: 'history',
// position: { targets: [
// x: 452.5466249541586, {
// y: 1276.3930310334215 moduleId: 'chatModule',
// }, key: 'history'
// moduleId: 'xj0c9p' }
// } ]
// ] }
// }, ]
// { },
// id: 'simpleKbChat', {
// avatar: '/imgs/module/db.png', moduleId: 'kbSearch',
// name: '知识库 + 对话引导', position: {
// intro: '每次提问时进行一次知识库搜索,将搜索结果注入 LLM 模型进行参考回答', x: 956.0838440206068,
// modules: [ y: 887.462827870246
// { },
// ...UserInputModule, flowType: 'kbSearchNode',
// inputs: [ inputs: [
// { {
// key: 'userChatInput', key: 'kbList',
// type: 'systemInput', value: [],
// label: '用户问题', connected: true
// connected: false },
// } {
// ], key: 'similarity',
// outputs: [ value: 0.82,
// { connected: true
// key: 'userChatInput', },
// label: '用户问题', {
// type: 'source', key: 'limit',
// targets: [ value: 5,
// { connected: true
// moduleId: 'q9v14m', },
// key: 'userChatInput' {
// }, key: 'switch',
// { connected: false
// moduleId: 'qbf8td', },
// key: 'userChatInput' {
// } key: 'userChatInput',
// ] connected: true
// } }
// ], ],
// position: { outputs: [
// x: -196.84632684738483, {
// y: 797.3401378431948 key: 'isEmpty',
// }, targets: [
// moduleId: 'v0nc1s' {
// }, moduleId: 'asv5cb',
// { key: 'switch'
// ...HistoryModule, }
// inputs: [ ]
// { },
// key: 'maxContext', {
// type: 'numberInput', key: 'unEmpty',
// label: '最长记录数', targets: [
// value: 10, {
// min: 0, moduleId: 'chatModule',
// max: 50, key: 'switch'
// connected: false }
// }, ]
// { },
// key: 'history', {
// type: 'hidden', key: 'quoteQA',
// label: '聊天记录', targets: [
// connected: false {
// } moduleId: 'chatModule',
// ], key: 'quoteQA'
// outputs: [ }
// { ]
// key: 'history', }
// label: '聊天记录', ]
// type: 'source', },
// targets: [ {
// { moduleId: 'chatModule',
// moduleId: 'qbf8td', position: {
// key: 'history' x: 1521.114092861523,
// } y: 1038.6910820851604
// ] },
// } flowType: 'chatNode',
// ], inputs: [
// position: { {
// x: 211.58250540918442, key: 'model',
// y: 611.8700401034965 value: 'gpt-3.5-turbo-16k',
// }, connected: true
// moduleId: 'k9y3jm' },
// }, {
// { key: 'temperature',
// ...ChatModule, value: 5,
// inputs: [ connected: true
// { },
// key: 'model', {
// type: 'custom', key: 'maxToken',
// label: '对话模型', value: 16000,
// value: 'gpt-3.5-turbo-16k', connected: true
// list: [ },
// { {
// label: 'FastAI-4k', key: 'systemPrompt',
// value: 'gpt-3.5-turbo' value: '知识库是关于 laf 的内容。',
// }, connected: true
// { },
// label: 'FastAI-16k', {
// value: 'gpt-3.5-turbo-16k' key: 'limitPrompt',
// }, value: '根据知识库回答用户问题,回答范围仅限知识库。',
// { connected: true
// label: 'FastAI-Plus', },
// value: 'gpt-4' {
// } key: 'switch',
// ], connected: true
// connected: false },
// }, {
// { key: 'quoteQA',
// key: 'temperature', connected: true
// type: 'custom', },
// label: '温度', {
// value: 0, key: 'history',
// min: 0, connected: true
// max: 10, },
// step: 1, {
// markList: [ key: 'userChatInput',
// { connected: true
// label: '严谨', }
// value: 0 ],
// }, outputs: [
// { {
// label: '发散', key: 'answerText',
// value: 10 targets: []
// } }
// ], ]
// connected: false },
// }, {
// { moduleId: 'asv5cb',
// key: 'maxToken', position: {
// type: 'custom', x: 1517.320542832093,
// label: '回复上限', y: 699.8757371712562
// value: 8000, },
// min: 100, flowType: 'answerNode',
// max: 16000, inputs: [
// step: 50, {
// markList: [ key: 'switch',
// { connected: true
// label: '0', },
// value: 0 {
// }, key: 'text',
// { value: '对不起,我找不到你的问题,请更加详细的描述 laf 相关的问题。',
// label: '16000', connected: true
// value: 16000 }
// } ],
// ], outputs: []
// connected: false }
// }, ]
// { },
// key: 'systemPrompt', {
// type: 'textarea', id: 'chatGuide',
// label: '系统提示词', avatar: '/imgs/module/userGuide.png',
// description: name: '对话引导 + 变量',
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', intro: '可以在对话开始发送一段提示,或者让用户填写一些内容,作为本次对话的变量',
// placeholder: modules: [
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', {
// value: '', moduleId: 'userGuide',
// connected: false position: {
// }, x: 447.98520778293346,
// { y: 721.4016845336229
// key: 'limitPrompt', },
// type: 'textarea', flowType: 'userGuide',
// label: '限定词', inputs: [
// description: {
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', key: 'welcomeText',
// placeholder: value:
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', '你好,我是翻译助手,可以帮你把内容翻译成任何语言,请告诉我,你需要翻译成什么语言?',
// value: '知识库是关于 Laf 的内容,参考知识库回答我的问题。', connected: true
// connected: false }
// }, ],
// { outputs: []
// key: 'switch', },
// type: 'target', {
// label: '触发器', moduleId: 'userChatInput',
// connected: true position: {
// }, x: 464.32198615344566,
// { y: 1602.2698463081606
// key: 'quoteQA', },
// type: 'target', flowType: 'questionInput',
// label: '引用内容', inputs: [
// connected: true {
// }, key: 'userChatInput',
// { connected: true
// key: 'history', }
// type: 'target', ],
// label: '聊天记录', outputs: [
// connected: true {
// }, key: 'userChatInput',
// { targets: [
// key: 'userChatInput', {
// type: 'target', moduleId: 'chatModule',
// label: '用户问题', key: 'userChatInput'
// connected: true }
// } ]
// ], }
// outputs: [ ]
// { },
// key: 'answerText', {
// label: '模型回复', moduleId: 'history',
// description: '直接响应,无需配置', position: {
// type: 'hidden', x: 452.5466249541586,
// targets: [] y: 1276.3930310334215
// } },
// ], flowType: 'historyNode',
// position: { inputs: [
// x: 745.484449528062, {
// y: 259.9361900288137 key: 'maxContext',
// }, value: 10,
// moduleId: 'qbf8td' connected: true
// }, },
// { {
// ...KBSearchModule, key: 'history',
// inputs: [ connected: true
// { }
// key: 'kbList', ],
// type: 'custom', outputs: [
// label: '关联的知识库', {
// value: [], key: 'history',
// list: [], targets: [
// connected: false {
// }, moduleId: 'chatModule',
// { key: 'history'
// key: 'similarity', }
// type: 'custom', ]
// label: '相似度', }
// value: 0.8, ]
// min: 0, },
// max: 1, {
// step: 0.01, moduleId: 'chatModule',
// markList: [ position: {
// { x: 981.9682828103937,
// label: '0', y: 890.014595014464
// value: 0 },
// }, flowType: 'chatNode',
// { inputs: [
// label: '1', {
// value: 1 key: 'model',
// } value: 'gpt-3.5-turbo-16k',
// ], connected: true
// connected: false },
// }, {
// { key: 'temperature',
// key: 'limit', value: 0,
// type: 'custom', connected: true
// label: '单次搜索上限', },
// description: '最多取 n 条记录作为本次问题引用', {
// value: 5, key: 'maxToken',
// min: 1, value: 8000,
// max: 20, connected: true
// step: 1, },
// markList: [ {
// { key: 'systemPrompt',
// label: '1', value: '',
// value: 1 connected: true
// }, },
// { {
// label: '20', key: 'limitPrompt',
// value: 20 value: '把用户发送的内容直接翻译成{{language}},不要做其他回答。',
// } connected: true
// ], },
// connected: false {
// }, key: 'switch',
// { connected: false
// key: 'switch', },
// type: 'target', {
// label: '触发器', key: 'quoteQA',
// connected: true connected: false
// }, },
// { {
// key: 'userChatInput', key: 'history',
// type: 'target', connected: true
// label: '用户问题', },
// connected: true {
// } key: 'userChatInput',
// ], connected: true
// outputs: [ }
// { ],
// label: '源搜索数据', outputs: [
// type: 'hidden', {
// response: true, key: 'answerText',
// targets: [] targets: []
// }, }
// { ]
// key: 'isEmpty', },
// label: '搜索结果为空', {
// type: 'source', moduleId: 'fo9i68',
// targets: [ position: {
// { x: 445.17843864558927,
// moduleId: 'w8av9y', y: 992.4891333735476
// key: 'switch' },
// } flowType: 'variable',
// ] inputs: [
// }, {
// { key: 'variables',
// key: 'quoteQA', value: [
// label: '引用内容', {
// description: '搜索结果为空时不返回', id: '9qjnai',
// type: 'source', key: 'language',
// targets: [ label: '目标语言',
// { type: 'input',
// moduleId: 'qbf8td', required: true,
// key: 'quoteQA' maxLen: 50,
// } enums: [
// ] {
// } value: ''
// ], }
// position: { ]
// x: 101.2612930583856, }
// y: -31.342317423453437 ],
// }, connected: true
// moduleId: 'q9v14m' }
// }, ],
// { outputs: []
// ...AnswerModule, }
// inputs: [ ]
// { },
// key: 'switch', {
// type: 'target', id: 'CQ',
// label: '触发器', avatar: '/imgs/module/cq.png',
// connected: true name: '问题分类 + 知识库',
// }, intro: '先对用户的问题进行分类,再根据不同类型问题,执行不同的操作',
// { modules: [
// key: 'answerText', {
// value: '对不起,我没有找到你的问题', moduleId: '7z5g5h',
// type: 'input', position: {
// label: '回复的内容', x: 198.56612928723575,
// connected: false y: 1622.7034463081607
// } },
// ], flowType: 'questionInput',
// outputs: [], inputs: [
// position: { {
// x: 673.6108151684664, key: 'userChatInput',
// y: -84.13355134221933 connected: true
// }, }
// moduleId: 'w8av9y' ],
// }, outputs: [
// { {
// ...UserGuideModule, key: 'userChatInput',
// inputs: [ targets: [
// { {
// key: 'welcomeText', moduleId: 'remuj3',
// type: 'input', key: 'userChatInput'
// label: '开场白', },
// value: {
// '你好,我是 Laf 助手,请问有什么可以帮助你的么?\n[laf 是什么?]\n[官网是多少?]', moduleId: 'nlfwkc',
// connected: false key: 'userChatInput'
// } },
// ], {
// outputs: [], moduleId: 'fljhzy',
// position: { key: 'userChatInput'
// x: -338.02984747117785, }
// y: 203.21398144017178 ]
// }, }
// moduleId: 'v7lq0x' ]
// } },
// ] {
// }, moduleId: 'xj0c9p',
// { position: {
// id: 'chatGuide', x: 194.99102398958047,
// avatar: '/imgs/module/userGuide.png', y: 1801.3545999721096
// name: '对话引导 + 变量', },
// intro: '可以在对话开始发送一段提示,或者让用户填写一些内容,作为本次对话的变量', flowType: 'historyNode',
// modules: [ inputs: [
// { {
// ...UserInputModule, key: 'maxContext',
// inputs: [ value: 10,
// { connected: true
// key: 'userChatInput', },
// type: 'systemInput', {
// label: '用户问题', key: 'history',
// connected: false connected: true
// } }
// ], ],
// outputs: [ outputs: [
// { {
// key: 'userChatInput', key: 'history',
// label: '用户问题', targets: [
// type: 'source', {
// targets: [ moduleId: 'nlfwkc',
// { key: 'history'
// moduleId: '7pacf0', }
// key: 'userChatInput' ]
// } }
// ] ]
// } },
// ], {
// position: { moduleId: 'remuj3',
// x: 485.8457451202796, position: {
// y: 1601.0352987954163 x: 672.9092284362648,
// }, y: 1077.557793775116
// moduleId: '7z5g5h' },
// }, flowType: 'classifyQuestion',
// { inputs: [
// ...ChatModule, {
// inputs: [ key: 'systemPrompt',
// { value:
// key: 'model', 'laf 是云开发平台,可以快速的开发应用\nlaf 是一个开源的 BaaS 开发平台(Backend as a Service)\nlaf 是一个开箱即用的 serverless 开发平台\nlaf 是一个集「函数计算」、「数据库」、「对象存储」等于一身的一站式开发平台\nlaf 可以是开源版的腾讯云开发、开源版的 Google Firebase、开源版的 UniCloud',
// type: 'custom', connected: true
// label: '对话模型', },
// value: 'gpt-3.5-turbo-16k', {
// list: [ key: 'history',
// { connected: true
// label: 'FastAI-4k', },
// value: 'gpt-3.5-turbo' {
// }, key: 'userChatInput',
// { connected: true
// label: 'FastAI-16k', },
// value: 'gpt-3.5-turbo-16k' {
// }, key: 'agents',
// { value: [
// label: 'FastAI-Plus', {
// value: 'gpt-4' value: '打招呼、问候等问题',
// } key: 'fasw'
// ], },
// connected: false {
// }, value: '“laf” 的问题',
// { key: 'fqsw'
// key: 'temperature', },
// type: 'custom', {
// label: '温度', value: '其他问题',
// value: 0, key: 'fesw'
// min: 0, }
// max: 10, ],
// step: 1, connected: true
// markList: [ }
// { ],
// label: '严谨', outputs: [
// value: 0 {
// }, key: 'fasw',
// { targets: [
// label: '发散', {
// value: 10 moduleId: 'a99p6z',
// } key: 'switch'
// ], }
// connected: false ]
// }, },
// { {
// key: 'maxToken', key: 'fqsw',
// type: 'custom', targets: [
// label: '回复上限', {
// value: 8000, moduleId: 'fljhzy',
// min: 100, key: 'switch'
// max: 16000, }
// step: 50, ]
// markList: [ },
// { {
// label: '0', key: 'fesw',
// value: 0 targets: [
// }, {
// { moduleId: 'iejcou',
// label: '16000', key: 'switch'
// value: 16000 }
// } ]
// ], }
// connected: false ]
// }, },
// { {
// key: 'systemPrompt', moduleId: 'a99p6z',
// type: 'textarea', position: {
// label: '系统提示词', x: 1304.2886011902247,
// description: y: 776.1589509539264
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', },
// placeholder: flowType: 'answerNode',
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。', inputs: [
// value: '', {
// connected: false key: 'switch',
// }, connected: true
// { },
// key: 'limitPrompt', {
// type: 'textarea', key: 'text',
// label: '限定词', value: '你好,我是 laf 助手,有什么可以帮助你的?',
// description: connected: true
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', }
// placeholder: ],
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', outputs: []
// value: '将我发送的任何内容,直接翻译成{{language}}', },
// connected: false {
// }, moduleId: 'iejcou',
// { position: {
// key: 'switch', x: 1301.7531189034548,
// type: 'target', y: 1842.1297123368286
// label: '触发器', },
// connected: false flowType: 'answerNode',
// }, inputs: [
// { {
// key: 'quoteQA', key: 'switch',
// type: 'target', connected: true
// label: '引用内容', },
// connected: false {
// }, key: 'text',
// { value: '你好,我仅能回答 laf 相关问题,请问你有什么问题么?',
// key: 'history', connected: true
// type: 'target', }
// label: '聊天记录', ],
// connected: true outputs: []
// }, },
// { {
// key: 'userChatInput', moduleId: 'nlfwkc',
// type: 'target', position: {
// label: '用户问题', x: 1821.979893659983,
// connected: true y: 1104.6583548423682
// } },
// ], flowType: 'chatNode',
// outputs: [ inputs: [
// { {
// key: 'answerText', key: 'model',
// label: '模型回复', value: 'gpt-3.5-turbo-16k',
// description: '直接响应,无需配置', connected: true
// type: 'hidden', },
// targets: [] {
// } key: 'temperature',
// ], value: 0,
// position: { connected: true
// x: 981.9682828103937, },
// y: 890.014595014464 {
// }, key: 'maxToken',
// moduleId: '7pacf0' value: 8000,
// }, connected: true
// { },
// ...HistoryModule, {
// inputs: [ key: 'systemPrompt',
// { value: '知识库是关于 laf 的内容。',
// key: 'maxContext', connected: true
// type: 'numberInput', },
// label: '最长记录数', {
// value: 10, key: 'limitPrompt',
// min: 0, value:
// max: 50, '我的问题都是关于 laf 的。根据知识库回答我的问题,与 laf 无关问题,直接回复:“我不清楚,我仅能回答 laf 相关的问题。”。',
// connected: false connected: true
// }, },
// { {
// key: 'history', key: 'switch',
// type: 'hidden', connected: true
// label: '聊天记录', },
// connected: false {
// } key: 'quoteQA',
// ], connected: true
// outputs: [ },
// { {
// key: 'history', key: 'history',
// label: '聊天记录', connected: true
// type: 'source', },
// targets: [ {
// { key: 'userChatInput',
// moduleId: '7pacf0', connected: true
// key: 'history' }
// } ],
// ] outputs: [
// } {
// ], key: 'answerText',
// position: { targets: []
// x: 446.2698477029736, }
// y: 1281.1006139718102 ]
// }, },
// moduleId: 'xj0c9p' {
// }, moduleId: 's4v9su',
// { position: {
// ...VariableModule, x: 193.3803955457983,
// inputs: [ y: 1116.251200765746
// { },
// key: 'variables', flowType: 'historyNode',
// type: 'systemInput', inputs: [
// label: '变量输入', {
// value: [ key: 'maxContext',
// { value: 2,
// id: 'z3bs2f', connected: true
// key: 'language', },
// label: '目标语言', {
// type: 'select', key: 'history',
// required: true, connected: true
// maxLen: 50, }
// enums: [ ],
// { outputs: [
// value: '英语' {
// }, key: 'history',
// { targets: [
// value: '法语' {
// }, moduleId: 'remuj3',
// { key: 'history'
// value: '日语' }
// } ]
// ] }
// } ]
// ], },
// connected: false {
// } moduleId: 'fljhzy',
// ], position: {
// outputs: [], x: 1305.5374262228029,
// position: { y: 1120.0404921820218
// x: 513.9049244392417, },
// y: 996.8739106932076 flowType: 'kbSearchNode',
// }, inputs: [
// moduleId: '7blchb' {
// }, key: 'kbList',
// { value: [],
// ...UserGuideModule, connected: true
// inputs: [ },
// { {
// key: 'welcomeText', key: 'similarity',
// type: 'input', value: 0.76,
// label: '开场白', connected: true
// value: '你好,我是翻译助手,可以帮你翻译任何语言。请告诉我,你需要翻译成什么语言?', },
// connected: false {
// } key: 'limit',
// ], value: 5,
// outputs: [], connected: true
// position: { },
// x: 173.17995039750167, {
// y: 982.945778706804 key: 'switch',
// }, connected: true
// moduleId: 'w35iml' },
// } {
// ] key: 'userChatInput',
// }, connected: true
// { }
// id: 'CQ', ],
// avatar: '/imgs/module/cq.png', outputs: [
// name: '问题分类 + 知识库', {
// intro: '先对用户的问题进行分类,再根据不同类型问题,执行不同的操作', key: 'isEmpty',
// modules: [ targets: [
// { {
// ...UserInputModule, moduleId: 'tc90wz',
// inputs: [ key: 'switch'
// { }
// key: 'userChatInput', ]
// type: 'systemInput', },
// label: '用户问题', {
// connected: false key: 'unEmpty',
// } targets: [
// ], {
// outputs: [ moduleId: 'nlfwkc',
// { key: 'switch'
// key: 'userChatInput', }
// label: '用户问题', ]
// type: 'source', },
// targets: [ {
// { key: 'quoteQA',
// moduleId: '3n49vn', targets: [
// key: 'userChatInput' {
// }, moduleId: 'nlfwkc',
// { key: 'quoteQA'
// moduleId: 's7qnhf', }
// key: 'userChatInput' ]
// }, }
// { ]
// moduleId: '15c9bv', },
// key: 'userChatInput' {
// } moduleId: 'q9equb',
// ] position: {
// } x: 191.4857498376603,
// ], y: 856.6847387508401
// position: { },
// x: -216.08819066976912, flowType: 'userGuide',
// y: 585.9302721518841 inputs: [
// }, {
// moduleId: 'xzj0oo' key: 'welcomeText',
// }, value:
// { '你好,我是 laf 助手,有什么可以帮助你的?\n[laf 是什么?有什么用?]\n[laf 在线体验地址]\n[官网地址是多少]',
// ...HistoryModule, connected: true
// inputs: [ }
// { ],
// key: 'maxContext', outputs: []
// type: 'numberInput', },
// label: '最长记录数', {
// value: 10, moduleId: 'tc90wz',
// min: 0, position: {
// max: 50, x: 1828.4596416688908,
// connected: false y: 765.3628156185887
// }, },
// { flowType: 'answerNode',
// key: 'history', inputs: [
// type: 'hidden', {
// label: '聊天记录', key: 'switch',
// connected: false connected: true
// } },
// ], {
// outputs: [ key: 'text',
// { value: '对不起,我找不到你的问题,请更加详细的描述你的问题。',
// key: 'history', connected: true
// label: '聊天记录', }
// type: 'source', ],
// targets: [ outputs: []
// { }
// moduleId: '3n49vn', ]
// key: 'history' }
// }
// ]
// }
// ],
// position: {
// x: 1146.0216647621794,
// y: 236.92269104756855
// },
// moduleId: 'hh6of9'
// },
// {
// ...ChatModule,
// inputs: [
// {
// key: 'model',
// type: 'select',
// label: '对话模型',
// value: 'gpt-3.5-turbo',
// list: [
// {
// label: 'FastAI-16k',
// value: 'gpt-3.5-turbo-16k'
// },
// {
// label: 'FastAI-4k',
// value: 'gpt-3.5-turbo'
// },
// {
// label: 'FastAI-Plus-8k',
// value: 'gpt-4'
// }
// ],
// connected: false
// },
// {
// key: 'temperature',
// type: 'custom',
// label: '温度',
// value: 0,
// min: 0,
// max: 10,
// step: 1,
// markList: [
// {
// label: '严谨',
// value: 0
// },
// {
// label: '发散',
// value: 10
// }
// ],
// connected: false
// },
// {
// key: 'maxToken',
// type: 'custom',
// label: '回复上限',
// value: 3000,
// min: 100,
// max: 4000,
// step: 50,
// markList: [
// {
// label: '0',
// value: 0
// },
// {
// label: '4000',
// value: 4000
// }
// ],
// connected: false
// },
// {
// key: 'systemPrompt',
// type: 'textarea',
// label: '系统提示词',
// description:
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。',
// placeholder:
// '模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。',
// value: '你是 Laf 助手,可以回答 Laf 相关问题。',
// connected: false
// },
// {
// key: 'limitPrompt',
// type: 'textarea',
// label: '限定词',
// description:
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"',
// placeholder:
// '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"',
// value: '知识库是 Laf 的内容,参考知识库回答问题。',
// connected: false
// },
// {
// key: 'switch',
// type: 'target',
// label: '触发器',
// connected: false
// },
// {
// key: 'quoteQA',
// type: 'target',
// label: '引用内容',
// connected: true
// },
// {
// key: 'history',
// type: 'target',
// label: '聊天记录',
// connected: true
// },
// {
// key: 'userChatInput',
// type: 'target',
// label: '用户问题',
// connected: true
// }
// ],
// outputs: [
// {
// key: 'answerText',
// label: '模型回复',
// description: '直接响应,无需配置',
// type: 'hidden',
// targets: []
// }
// ],
// position: {
// x: 1494.4843114348841,
// y: -13.57201521210618
// },
// moduleId: '3n49vn'
// },
// {
// ...KBSearchModule,
// inputs: [
// {
// key: 'kbList',
// type: 'custom',
// label: '关联的知识库',
// value: [],
// list: [],
// connected: false
// },
// {
// key: 'similarity',
// type: 'custom',
// label: '相似度',
// value: 0.8,
// min: 0,
// max: 1,
// step: 0.01,
// markList: [
// {
// label: '0',
// value: 0
// },
// {
// label: '1',
// value: 1
// }
// ],
// connected: false
// },
// {
// key: 'limit',
// type: 'custom',
// label: '单次搜索上限',
// description: '最多取 n 条记录作为本次问题引用',
// value: 5,
// min: 1,
// max: 20,
// step: 1,
// markList: [
// {
// label: '1',
// value: 1
// },
// {
// label: '20',
// value: 20
// }
// ],
// connected: false
// },
// {
// key: 'switch',
// type: 'target',
// label: '触发器',
// connected: true
// },
// {
// key: 'userChatInput',
// type: 'target',
// label: '用户问题',
// connected: true
// }
// ],
// outputs: [
// {
// label: '源搜索数据',
// type: 'hidden',
// response: true,
// targets: []
// },
// {
// key: 'isEmpty',
// label: '搜索结果为空',
// type: 'source',
// targets: [
// {
// moduleId: 'phwr0u',
// key: 'switch'
// }
// ]
// },
// {
// key: 'quoteQA',
// label: '引用内容',
// description: '搜索结果为空时不返回',
// type: 'source',
// targets: [
// {
// moduleId: '3n49vn',
// key: 'quoteQA'
// }
// ]
// }
// ],
// position: {
// x: 690.1930900957847,
// y: 102.10119978743109
// },
// moduleId: 's7qnhf'
// },
// {
// ...HistoryModule,
// inputs: [
// {
// key: 'maxContext',
// type: 'numberInput',
// label: '最长记录数',
// value: 2,
// min: 0,
// max: 50,
// connected: false
// },
// {
// key: 'history',
// type: 'hidden',
// label: '聊天记录',
// connected: false
// }
// ],
// outputs: [
// {
// key: 'history',
// label: '聊天记录',
// type: 'source',
// targets: [
// {
// moduleId: '15c9bv',
// key: 'history'
// }
// ]
// }
// ],
// position: {
// x: -274.2362185453961,
// y: 152.19755525696058
// },
// moduleId: 'qiwrjt'
// },
// {
// ...AnswerModule,
// inputs: [
// {
// key: 'switch',
// type: 'target',
// label: '触发器',
// connected: true
// },
// {
// key: 'answerText',
// value: '你好,我是 Laf 助手,有什么可以帮助你的么?',
// type: 'input',
// label: '回复的内容',
// connected: false
// }
// ],
// outputs: [],
// position: {
// x: 686.1260929408212,
// y: -142.16731465682332
// },
// moduleId: 'l4e36k'
// },
// {
// ...AnswerModule,
// inputs: [
// {
// key: 'switch',
// type: 'target',
// label: '触发器',
// connected: true
// },
// {
// key: 'answerText',
// value: '对不起,我无法回答你的问题,请问有什么关于 Laf 的问题么?',
// type: 'input',
// label: '回复的内容',
// connected: false
// }
// ],
// outputs: [],
// position: {
// x: 1469.3636235179692,
// y: 937.5555811306511
// },
// moduleId: 'phwr0u'
// },
// {
// ...ClassifyQuestionModule,
// inputs: [
// {
// key: 'systemPrompt',
// type: 'textarea',
// label: '系统提示词',
// description:
// '你可以添加一些特定内容的介绍,从而更好的识别用户的问题类型。这个内容通常是给模型介绍一个它不知道的内容。',
// placeholder: '例如: \n1. Laf 是一个云函数开发平台……\n2. Sealos 是一个集群操作系统',
// value:
// ' laf 是什么\nlaf 是云开发平台,可以快速的开发应用\nlaf 是一个开源的 BaaS 开发平台(Backend as a Service)\nlaf 是一个开箱即用的 serverless 开发平台\nlaf 是一个集「函数计算」、「数据库」、「对象存储」等于一身的一站式开发平台\nlaf 可以是开源版的腾讯云开发、开源版的 Google Firebase、开源版的 UniCloud\nlaf 让每个开发团队都可以随时拥有一个自己的云开发平台!',
// connected: false
// },
// {
// key: 'history',
// type: 'target',
// label: '聊天记录',
// connected: true
// },
// {
// key: 'userChatInput',
// type: 'target',
// label: '用户问题',
// connected: true
// },
// {
// key: 'agents',
// type: 'custom',
// label: '',
// value: [
// {
// value: '打招呼、问候等',
// key: 'fasw'
// },
// {
// value: '关于 laf 云函数的问题',
// key: 'fqsw'
// },
// {
// value: '其他问题',
// key: 'q73b'
// }
// ],
// connected: false
// }
// ],
// outputs: [
// {
// key: 'fasw',
// label: '',
// type: 'hidden',
// targets: [
// {
// moduleId: 'l4e36k',
// key: 'switch'
// }
// ]
// },
// {
// key: 'fqsw',
// label: '',
// type: 'hidden',
// targets: [
// {
// moduleId: 's7qnhf',
// key: 'switch'
// }
// ]
// },
// {
// key: 'q73b',
// label: '',
// type: 'hidden',
// targets: [
// {
// moduleId: 'phwr0u',
// key: 'switch'
// }
// ]
// }
// ],
// position: {
// x: 154.9724540917009,
// y: -37.48714632270105
// },
// moduleId: '15c9bv'
// }
// ]
// }
]; ];
...@@ -31,6 +31,10 @@ export enum FlowModuleTypeEnum { ...@@ -31,6 +31,10 @@ export enum FlowModuleTypeEnum {
classifyQuestion = 'classifyQuestion' classifyQuestion = 'classifyQuestion'
} }
export enum SpecialInputKeyEnum {
'answerText' = 'text'
}
export const initModuleType: Record<string, boolean> = { export const initModuleType: Record<string, boolean> = {
[FlowModuleTypeEnum.historyNode]: true, [FlowModuleTypeEnum.historyNode]: true,
[FlowModuleTypeEnum.questionInput]: true [FlowModuleTypeEnum.questionInput]: true
...@@ -38,8 +42,8 @@ export const initModuleType: Record<string, boolean> = { ...@@ -38,8 +42,8 @@ export const initModuleType: Record<string, boolean> = {
export const edgeOptions = { export const edgeOptions = {
style: { style: {
strokeWidth: 1, strokeWidth: 1.5,
stroke: '#5A646Es' stroke: '#5A646Es'
} }
}; };
export const connectionLineStyle = { strokeWidth: 1, stroke: '#5A646Es' }; export const connectionLineStyle = { strokeWidth: 1.5, stroke: '#5A646Es' };
...@@ -41,15 +41,19 @@ const NodeCard = ({ ...@@ -41,15 +41,19 @@ const NodeCard = ({
</MyTooltip> </MyTooltip>
)} )}
<Box flex={1} /> <Box flex={1} />
<MyIcon <Flex
className={'nodrag'} className={'nodrag'}
name="delete" w={'22px'}
cursor={'pointer'} h={'22px'}
alignItems={'center'}
justifyContent={'center'}
color={'myGray.600'} color={'myGray.600'}
w={'16px'}
_hover={{ color: 'red.600' }} _hover={{ color: 'red.600' }}
cursor={'pointer'}
onClick={() => onDelNode(moduleId)} onClick={() => onDelNode(moduleId)}
/> >
<MyIcon name="delete" w={'16px'} />
</Flex>
</Flex> </Flex>
{children} {children}
</Box> </Box>
......
...@@ -283,7 +283,6 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => { ...@@ -283,7 +283,6 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
useEffect(() => { useEffect(() => {
initData(JSON.parse(JSON.stringify(app))); initData(JSON.parse(JSON.stringify(app)));
}, [app, initData]); }, [app, initData]);
console.log(flow2AppModules());
return ( return (
<> <>
......
...@@ -51,7 +51,7 @@ export const dispatchClassifyQuestion = async (props: Record<string, any>): Prom ...@@ -51,7 +51,7 @@ export const dispatchClassifyQuestion = async (props: Record<string, any>): Prom
// function body // function body
const agentFunction = { const agentFunction = {
name: agentFunName, name: agentFunName,
description: '判断用户问题的类型,并返回指定值', description: '判断用户问题的类型属于哪方面,返回对应的枚举字段',
parameters: { parameters: {
type: 'object', type: 'object',
properties: { properties: {
...@@ -81,13 +81,9 @@ export const dispatchClassifyQuestion = async (props: Record<string, any>): Prom ...@@ -81,13 +81,9 @@ export const dispatchClassifyQuestion = async (props: Record<string, any>): Prom
const arg = JSON.parse(response.data.choices?.[0]?.message?.function_call?.arguments || ''); const arg = JSON.parse(response.data.choices?.[0]?.message?.function_call?.arguments || '');
if (!arg.type) {
throw new Error('');
}
const tokens = response.data.usage?.total_tokens || 0; const tokens = response.data.usage?.total_tokens || 0;
const result = agents.find((item) => item.key === arg.type) || agents[0]; const result = agents.find((item) => item.key === arg?.type) || agents[0];
return { return {
[result.key]: 1, [result.key]: 1,
......
...@@ -31,7 +31,7 @@ const simplifyStr = (str = '') => ...@@ -31,7 +31,7 @@ const simplifyStr = (str = '') =>
.replace(/[^\S\r\n]+/g, ' ') // 连续空白内容 .replace(/[^\S\r\n]+/g, ' ') // 连续空白内容
.trim(); .trim();
/* 聊天上下文 tokens 截断 */ /* slice chat context by tokens */
export const ChatContextFilter = ({ export const ChatContextFilter = ({
model, model,
prompts, prompts,
...@@ -41,33 +41,19 @@ export const ChatContextFilter = ({ ...@@ -41,33 +41,19 @@ export const ChatContextFilter = ({
prompts: ChatItemType[]; prompts: ChatItemType[];
maxTokens: number; maxTokens: number;
}) => { }) => {
const systemPrompts: ChatItemType[] = []; const rawTextLen = prompts.reduce((sum, item) => sum + item.value.length, 0);
const chatPrompts: ChatItemType[] = [];
let rawTextLen = 0; // If the text length is less than half of the maximum token, no calculation is required
prompts.forEach((item) => {
const val = simplifyStr(item.value);
rawTextLen += val.length;
const data = {
_id: item._id,
obj: item.obj,
value: val
};
if (item.obj === ChatRoleEnum.System) {
systemPrompts.push(data);
} else {
chatPrompts.push(data);
}
});
// 长度太小时,不需要进行 token 截断
if (rawTextLen < maxTokens * 0.5) { if (rawTextLen < maxTokens * 0.5) {
return [...systemPrompts, ...chatPrompts]; return prompts;
} }
// 去掉 system 的 token // filter startWith system prompt
const chatStartIndex = prompts.findIndex((item) => item.obj !== ChatRoleEnum.System);
const systemPrompts: ChatItemType[] = prompts.slice(0, chatStartIndex);
const chatPrompts: ChatItemType[] = prompts.slice(chatStartIndex);
// reduce token of systemPrompt
maxTokens -= modelToolMap.countTokens({ maxTokens -= modelToolMap.countTokens({
model, model,
messages: systemPrompts messages: systemPrompts
......
import type { AppModuleInputItemType, AppModuleItemType, VariableItemType } from '@/types/app'; import type { AppModuleInputItemType, AppModuleItemType, VariableItemType } from '@/types/app';
import { chatModelList, vectorModelList } from '@/store/static'; import { chatModelList, vectorModelList } from '@/store/static';
import { FlowModuleTypeEnum } from '@/constants/flow'; import { FlowModuleTypeEnum, SpecialInputKeyEnum } from '@/constants/flow';
import { SystemInputEnum } from '@/constants/app'; import { SystemInputEnum } from '@/constants/app';
import { TaskResponseKeyEnum } from '@/constants/chat';
import type { SelectedKbType } from '@/types/plugin'; import type { SelectedKbType } from '@/types/plugin';
export type EditFormType = { export type EditFormType = {
...@@ -128,7 +129,7 @@ export const appModules2Form = (modules: AppModuleItemType[]) => { ...@@ -128,7 +129,7 @@ export const appModules2Form = (modules: AppModuleItemType[]) => {
if (emptyOutput) { if (emptyOutput) {
const target = modules.find((item) => item.moduleId === emptyOutput.moduleId); const target = modules.find((item) => item.moduleId === emptyOutput.moduleId);
defaultAppForm.kb.searchEmptyText = defaultAppForm.kb.searchEmptyText =
target?.inputs?.find((item) => item.key === 'answerText')?.value || ''; target?.inputs?.find((item) => item.key === SpecialInputKeyEnum.answerText)?.value || '';
} }
} else if (module.flowType === FlowModuleTypeEnum.userGuide) { } else if (module.flowType === FlowModuleTypeEnum.userGuide) {
const val = const val =
...@@ -174,6 +175,10 @@ const chatModelInput = (formData: EditFormType): AppModuleInputItemType[] => [ ...@@ -174,6 +175,10 @@ const chatModelInput = (formData: EditFormType): AppModuleInputItemType[] => [
connected: true connected: true
}, },
{ {
key: 'switch',
connected: formData.kb.list.length > 0
},
{
key: 'quoteQA', key: 'quoteQA',
connected: formData.kb.list.length > 0 connected: formData.kb.list.length > 0
}, },
...@@ -289,7 +294,7 @@ const simpleChatTemplate = (formData: EditFormType): AppModuleItemType[] => [ ...@@ -289,7 +294,7 @@ const simpleChatTemplate = (formData: EditFormType): AppModuleItemType[] => [
inputs: chatModelInput(formData), inputs: chatModelInput(formData),
outputs: [ outputs: [
{ {
key: 'answerText', key: TaskResponseKeyEnum.answerText,
targets: [] targets: []
} }
], ],
...@@ -439,7 +444,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [ ...@@ -439,7 +444,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
connected: true connected: true
}, },
{ {
key: 'answerText', key: SpecialInputKeyEnum.answerText,
value: formData.kb.searchEmptyText, value: formData.kb.searchEmptyText,
connected: true connected: true
} }
...@@ -458,7 +463,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [ ...@@ -458,7 +463,7 @@ const kbTemplate = (formData: EditFormType): AppModuleItemType[] => [
inputs: chatModelInput(formData), inputs: chatModelInput(formData),
outputs: [ outputs: [
{ {
key: 'answerText', key: TaskResponseKeyEnum.answerText,
targets: [] targets: []
} }
], ],
......
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