mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
template add i18n (#2558)
* template add i18n * add English translation
This commit is contained in:
@@ -9,8 +9,9 @@ export const Input_Template_History: FlowNodeInputItemType = {
|
||||
key: NodeInputKeyEnum.history,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference],
|
||||
valueType: WorkflowIOValueTypeEnum.chatHistory,
|
||||
label: 'core.module.input.label.chat history',
|
||||
description: '最多携带多少轮对话记录',
|
||||
label: i18nT('common:core.module.input.label.chat history'),
|
||||
description: i18nT('workflow:max_dialog_rounds'),
|
||||
|
||||
required: true,
|
||||
min: 0,
|
||||
max: 50,
|
||||
@@ -21,7 +22,7 @@ export const Input_Template_UserChatInput: FlowNodeInputItemType = {
|
||||
key: NodeInputKeyEnum.userChatInput,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea],
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
label: '用户问题',
|
||||
label: i18nT('workflow:user_question'),
|
||||
required: true
|
||||
};
|
||||
|
||||
@@ -36,14 +37,14 @@ export const Input_Template_DynamicInput: FlowNodeInputItemType = {
|
||||
export const Input_Template_SelectAIModel: FlowNodeInputItemType = {
|
||||
key: NodeInputKeyEnum.aiModel,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.selectLLMModel, FlowNodeInputTypeEnum.reference],
|
||||
label: 'core.module.input.label.aiModel',
|
||||
label: i18nT('common:core.module.input.label.aiModel'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
};
|
||||
export const Input_Template_SettingAiModel: FlowNodeInputItemType = {
|
||||
key: NodeInputKeyEnum.aiModel,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.settingLLMModel, FlowNodeInputTypeEnum.reference],
|
||||
label: 'core.module.input.label.aiModel',
|
||||
label: i18nT('common:core.module.input.label.aiModel'),
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
};
|
||||
|
||||
@@ -52,7 +53,7 @@ export const Input_Template_System_Prompt: FlowNodeInputItemType = {
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
|
||||
max: 3000,
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
label: 'core.ai.Prompt',
|
||||
label: i18nT('common:core.ai.Prompt'),
|
||||
description: chatNodeSystemPromptTip,
|
||||
placeholder: chatNodeSystemPromptTip
|
||||
};
|
||||
@@ -61,7 +62,7 @@ export const Input_Template_Dataset_Quote: FlowNodeInputItemType = {
|
||||
key: NodeInputKeyEnum.aiChatDatasetQuote,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.settingDatasetQuotePrompt],
|
||||
label: '',
|
||||
debugLabel: '知识库引用',
|
||||
debugLabel: i18nT('workflow:knowledge_base_reference'),
|
||||
description: '',
|
||||
valueType: WorkflowIOValueTypeEnum.datasetQuote
|
||||
};
|
||||
|
@@ -81,22 +81,23 @@ export const AiChatModule: FlowNodeTemplateType = {
|
||||
// settings modal ---
|
||||
{
|
||||
...Input_Template_System_Prompt,
|
||||
label: 'core.ai.Prompt',
|
||||
label: i18nT('common:core.ai.Prompt'),
|
||||
description: chatNodeSystemPromptTip,
|
||||
placeholder: chatNodeSystemPromptTip
|
||||
},
|
||||
Input_Template_History,
|
||||
Input_Template_Dataset_Quote,
|
||||
Input_Template_Text_Quote,
|
||||
{ ...Input_Template_UserChatInput, toolDescription: '用户问题' }
|
||||
|
||||
{ ...Input_Template_UserChatInput, toolDescription: i18nT('workflow:user_question') }
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
id: NodeOutputKeyEnum.history,
|
||||
key: NodeOutputKeyEnum.history,
|
||||
required: true,
|
||||
label: 'core.module.output.label.New context',
|
||||
description: 'core.module.output.description.New context',
|
||||
label: i18nT('common:core.module.output.label.New context'),
|
||||
description: i18nT('common:core.module.output.description.New context'),
|
||||
valueType: WorkflowIOValueTypeEnum.chatHistory,
|
||||
valueDesc: chatHistoryValueDesc,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
@@ -105,8 +106,8 @@ export const AiChatModule: FlowNodeTemplateType = {
|
||||
id: NodeOutputKeyEnum.answerText,
|
||||
key: NodeOutputKeyEnum.answerText,
|
||||
required: true,
|
||||
label: 'core.module.output.label.Ai response content',
|
||||
description: 'core.module.output.description.Ai response content',
|
||||
label: i18nT('common:core.module.output.label.Ai response content'),
|
||||
description: i18nT('common:core.module.output.description.Ai response content'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
FlowNodeTemplateTypeEnum
|
||||
} from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const AssignedAnswerModule: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.answerNode,
|
||||
@@ -14,9 +15,9 @@ export const AssignedAnswerModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/reply',
|
||||
name: '指定回复',
|
||||
intro:
|
||||
'该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。',
|
||||
name: i18nT('workflow:assigned_reply'),
|
||||
intro: i18nT('workflow:intro_assigned_reply'),
|
||||
|
||||
version: '481',
|
||||
isTool: true,
|
||||
inputs: [
|
||||
@@ -25,9 +26,9 @@ export const AssignedAnswerModule: FlowNodeTemplateType = {
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
required: true,
|
||||
label: 'core.module.input.label.Response content',
|
||||
description: 'core.module.input.description.Response content',
|
||||
placeholder: 'core.module.input.description.Response content'
|
||||
label: i18nT('common:core.module.input.label.Response content'),
|
||||
description: i18nT('common:core.module.input.description.Response content'),
|
||||
placeholder: i18nT('common:core.module.input.description.Response content')
|
||||
}
|
||||
],
|
||||
outputs: []
|
||||
|
@@ -18,6 +18,7 @@ import {
|
||||
import { Input_Template_System_Prompt } from '../../input';
|
||||
import { LLMModelTypeEnum } from '../../../../ai/constants';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export const ClassifyQuestionModule: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.classifyQuestion,
|
||||
@@ -26,8 +27,8 @@ export const ClassifyQuestionModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(false, false, false, false),
|
||||
targetHandle: getHandleConfig(true, false, true, true),
|
||||
avatar: 'core/workflow/template/questionClassify',
|
||||
name: '问题分类',
|
||||
intro: `根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题`,
|
||||
name: i18nT('workflow:question_classification'),
|
||||
intro: i18nT('workflow:intro_question_classification'),
|
||||
showStatus: true,
|
||||
version: '481',
|
||||
inputs: [
|
||||
@@ -50,15 +51,15 @@ export const ClassifyQuestionModule: FlowNodeTemplateType = {
|
||||
label: '',
|
||||
value: [
|
||||
{
|
||||
value: '打招呼',
|
||||
value: i18nT('workflow:greeting'),
|
||||
key: 'wqre'
|
||||
},
|
||||
{
|
||||
value: '关于 xxx 的问题',
|
||||
value: i18nT('workflow:about_xxx_question'),
|
||||
key: 'sdfa'
|
||||
},
|
||||
{
|
||||
value: '其他问题',
|
||||
value: i18nT('workflow:other_questions'),
|
||||
key: 'agex'
|
||||
}
|
||||
]
|
||||
@@ -69,7 +70,7 @@ export const ClassifyQuestionModule: FlowNodeTemplateType = {
|
||||
id: NodeOutputKeyEnum.cqResult,
|
||||
key: NodeOutputKeyEnum.cqResult,
|
||||
required: true,
|
||||
label: '分类结果',
|
||||
label: i18nT('workflow:classification_result'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
import { Input_Template_SelectAIModel, Input_Template_History } from '../../input';
|
||||
import { LLMModelTypeEnum } from '../../../../ai/constants';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export const ContextExtractModule: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.contentExtract,
|
||||
@@ -21,8 +22,8 @@ export const ContextExtractModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/extractJson',
|
||||
name: '文本内容提取',
|
||||
intro: '可从文本中提取指定的数据,例如:sql语句、搜索关键词、代码等',
|
||||
name: i18nT('workflow:text_content_extraction'),
|
||||
intro: i18nT('workflow:intro_text_content_extraction'),
|
||||
showStatus: true,
|
||||
isTool: true,
|
||||
version: '481',
|
||||
@@ -35,27 +36,25 @@ export const ContextExtractModule: FlowNodeTemplateType = {
|
||||
key: NodeInputKeyEnum.description,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
label: '提取要求描述',
|
||||
description:
|
||||
'给AI一些对应的背景知识或要求描述,引导AI更好的完成任务。\n该输入框可使用全局变量。',
|
||||
placeholder:
|
||||
'例如: \n1. 当前时间为: {{cTime}}。你是一个实验室预约助手,你的任务是帮助用户预约实验室,从文本中获取对应的预约信息。\n2. 你是谷歌搜索助手,需要从文本中提取出合适的搜索词。'
|
||||
label: i18nT('workflow:extraction_requirements_description'),
|
||||
description: i18nT('workflow:extraction_requirements_description_detail'),
|
||||
placeholder: i18nT('workflow:extraction_requirements_placeholder')
|
||||
},
|
||||
Input_Template_History,
|
||||
{
|
||||
key: NodeInputKeyEnum.contextExtractInput,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.textarea],
|
||||
label: '需要提取的文本',
|
||||
label: i18nT('workflow:text_to_extract'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
toolDescription: '需要检索的内容'
|
||||
toolDescription: i18nT('workflow:content_to_retrieve')
|
||||
},
|
||||
{
|
||||
key: NodeInputKeyEnum.extractKeys,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.custom],
|
||||
label: '',
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
description: "由 '描述' 和 'key' 组成一个目标字段,可提取多个目标字段",
|
||||
description: i18nT('workflow:target_fields_description'),
|
||||
value: [] // {valueType: string; desc: string; key: string; required: boolean; enum: string[]}[]
|
||||
}
|
||||
],
|
||||
@@ -63,18 +62,18 @@ export const ContextExtractModule: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.success,
|
||||
key: NodeOutputKeyEnum.success,
|
||||
label: '字段完全提取',
|
||||
label: i18nT('workflow:full_field_extraction'),
|
||||
required: true,
|
||||
description: '提取字段全部填充时返回 true (模型提取或使用默认值均属于成功)',
|
||||
description: i18nT('workflow:full_field_extraction_description'),
|
||||
valueType: WorkflowIOValueTypeEnum.boolean,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
},
|
||||
{
|
||||
id: NodeOutputKeyEnum.contextExtractFields,
|
||||
key: NodeOutputKeyEnum.contextExtractFields,
|
||||
label: '完整提取结果',
|
||||
label: i18nT('workflow:complete_extraction_result'),
|
||||
required: true,
|
||||
description: '一个 JSON 字符串,例如:{"name:":"YY","Time":"2023/7/2 18:00"}',
|
||||
description: i18nT('workflow:complete_extraction_result_description'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
NodeInputKeyEnum
|
||||
} from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const CustomFeedbackNode: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.customFeedback,
|
||||
@@ -14,8 +15,8 @@ export const CustomFeedbackNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/customFeedback',
|
||||
name: '自定义反馈',
|
||||
intro: '该模块被触发时,会给当前的对话记录增加一条反馈。可用于自动记录对话效果等。',
|
||||
name: i18nT('workflow:custom_feedback'),
|
||||
intro: i18nT('workflow:intro_custom_feedback'),
|
||||
version: '486',
|
||||
inputs: [
|
||||
{
|
||||
@@ -23,7 +24,7 @@ export const CustomFeedbackNode: FlowNodeTemplateType = {
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
required: true,
|
||||
label: '反馈的文本'
|
||||
label: i18nT('workflow:feedback_text')
|
||||
}
|
||||
],
|
||||
outputs: []
|
||||
|
@@ -14,6 +14,7 @@ import {
|
||||
import { getNanoid } from '../../../../common/string/tools';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { FlowNodeInputItemType } from '../../type/io.d';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const getOneQuoteInputTemplate = ({
|
||||
key = getNanoid(),
|
||||
@@ -24,8 +25,8 @@ export const getOneQuoteInputTemplate = ({
|
||||
}): FlowNodeInputItemType => ({
|
||||
key,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.reference],
|
||||
label: `引用${index}`,
|
||||
debugLabel: '知识库引用',
|
||||
label: `${i18nT('workflow:quote_num')},{ num: ${index} }`,
|
||||
debugLabel: i18nT('workflow:knowledge_base_reference'),
|
||||
canEdit: true,
|
||||
valueType: WorkflowIOValueTypeEnum.datasetQuote
|
||||
});
|
||||
@@ -37,15 +38,17 @@ export const DatasetConcatModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/datasetConcat',
|
||||
name: '知识库搜索引用合并',
|
||||
intro: '可以将多个知识库搜索结果进行合并输出。使用 RRF 的合并方式进行最终排序输出。',
|
||||
name: i18nT('workflow:knowledge_base_search_merge'),
|
||||
intro: i18nT('workflow:intro_knowledge_base_search_merge'),
|
||||
|
||||
showStatus: false,
|
||||
version: '486',
|
||||
inputs: [
|
||||
{
|
||||
key: NodeInputKeyEnum.datasetMaxTokens,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.custom],
|
||||
label: '最大 Tokens',
|
||||
label: i18nT('workflow:max_tokens'),
|
||||
|
||||
value: 3000,
|
||||
valueType: WorkflowIOValueTypeEnum.number
|
||||
},
|
||||
@@ -60,7 +63,7 @@ export const DatasetConcatModule: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.datasetQuoteQA,
|
||||
key: NodeOutputKeyEnum.datasetQuoteQA,
|
||||
label: 'core.module.Dataset quote.label',
|
||||
label: i18nT('common:core.module.Dataset quote.label'),
|
||||
type: FlowNodeOutputTypeEnum.static,
|
||||
valueType: WorkflowIOValueTypeEnum.datasetQuote,
|
||||
valueDesc: datasetQuoteValueDesc
|
||||
|
@@ -34,7 +34,7 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
|
||||
{
|
||||
key: NodeInputKeyEnum.datasetSelectList,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.selectDataset, FlowNodeInputTypeEnum.reference],
|
||||
label: 'core.module.input.label.Select dataset',
|
||||
label: i18nT('common:core.module.input.label.Select dataset'),
|
||||
value: [],
|
||||
valueType: WorkflowIOValueTypeEnum.selectDataset,
|
||||
required: true
|
||||
@@ -90,34 +90,24 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
|
||||
},
|
||||
{
|
||||
...Input_Template_UserChatInput,
|
||||
toolDescription: '需要检索的内容'
|
||||
toolDescription: i18nT('workflow:content_to_search')
|
||||
},
|
||||
{
|
||||
key: NodeInputKeyEnum.collectionFilterMatch,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.JSONEditor, FlowNodeInputTypeEnum.reference],
|
||||
label: '集合元数据过滤',
|
||||
label: i18nT('workflow:collection_metadata_filter'),
|
||||
|
||||
valueType: WorkflowIOValueTypeEnum.object,
|
||||
isPro: true,
|
||||
description: `目前支持标签和创建时间过滤,需按照以下格式填写:
|
||||
{
|
||||
"tags": {
|
||||
"$and": ["标签 1","标签 2"],
|
||||
"$or": ["有 $and 标签时,and 生效,or 不生效"]
|
||||
},
|
||||
"createTime": {
|
||||
"$gte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间大于该时间",
|
||||
"$lte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间小于该时间,可和 $gte 共同使用"
|
||||
}
|
||||
}
|
||||
`
|
||||
description: i18nT('workflow:filter_description')
|
||||
}
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
id: NodeOutputKeyEnum.datasetQuoteQA,
|
||||
key: NodeOutputKeyEnum.datasetQuoteQA,
|
||||
label: 'core.module.Dataset quote.label',
|
||||
description: '特殊数组格式,搜索结果为空时,返回空数组。',
|
||||
label: i18nT('common:core.module.Dataset quote.label'),
|
||||
description: i18nT('workflow:special_array_format'),
|
||||
type: FlowNodeOutputTypeEnum.static,
|
||||
valueType: WorkflowIOValueTypeEnum.datasetQuote,
|
||||
valueDesc: datasetQuoteValueDesc
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
import { Input_Template_DynamicInput } from '../input';
|
||||
import { Output_Template_AddOutput } from '../output';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const HttpNode468: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.httpRequest468,
|
||||
@@ -21,15 +22,15 @@ export const HttpNode468: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/httpRequest',
|
||||
name: 'HTTP 请求',
|
||||
intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)',
|
||||
name: i18nT('workflow:http_request'),
|
||||
intro: i18nT('workflow:intro_http_request'),
|
||||
showStatus: true,
|
||||
isTool: true,
|
||||
version: '481',
|
||||
inputs: [
|
||||
{
|
||||
...Input_Template_DynamicInput,
|
||||
description: 'core.module.input.description.HTTP Dynamic Input',
|
||||
description: i18nT('common:core.module.input.description.HTTP Dynamic Input'),
|
||||
customInputConfig: {
|
||||
selectValueTypeList: Object.values(WorkflowIOValueTypeEnum),
|
||||
showDescription: false,
|
||||
@@ -59,7 +60,7 @@ export const HttpNode468: FlowNodeTemplateType = {
|
||||
renderTypeList: [FlowNodeInputTypeEnum.hidden],
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
label: '',
|
||||
description: 'core.module.input.description.Http Request Url',
|
||||
description: i18nT('common:core.module.input.description.Http Request Url'),
|
||||
placeholder: 'https://api.ai.com/getInventory',
|
||||
required: false
|
||||
},
|
||||
@@ -69,8 +70,8 @@ export const HttpNode468: FlowNodeTemplateType = {
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
value: [],
|
||||
label: '',
|
||||
description: 'core.module.input.description.Http Request Header',
|
||||
placeholder: 'core.module.input.description.Http Request Header',
|
||||
description: i18nT('common:core.module.input.description.Http Request Header'),
|
||||
placeholder: i18nT('common:core.module.input.description.Http Request Header'),
|
||||
required: false
|
||||
},
|
||||
{
|
||||
@@ -97,17 +98,17 @@ export const HttpNode468: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.error,
|
||||
key: NodeOutputKeyEnum.error,
|
||||
label: '请求错误',
|
||||
description: 'HTTP请求错误信息,成功时返回空',
|
||||
label: i18nT('workflow:request_error'),
|
||||
description: i18nT('workflow:http_request_error_info'),
|
||||
valueType: WorkflowIOValueTypeEnum.object,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
},
|
||||
{
|
||||
id: NodeOutputKeyEnum.httpRawResponse,
|
||||
key: NodeOutputKeyEnum.httpRawResponse,
|
||||
label: '原始响应',
|
||||
required: true,
|
||||
description: 'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。',
|
||||
label: i18nT('workflow:raw_response'),
|
||||
description: i18nT('workflow:http_raw_response_description'),
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export enum VariableConditionEnum {
|
||||
equalTo = 'equalTo',
|
||||
notEqual = 'notEqual',
|
||||
@@ -29,64 +31,85 @@ export enum IfElseResultEnum {
|
||||
}
|
||||
|
||||
export const stringConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: '等于', value: VariableConditionEnum.equalTo },
|
||||
{ label: '不等于', value: VariableConditionEnum.notEqual },
|
||||
{ label: '正则', value: VariableConditionEnum.reg },
|
||||
{ label: '包含', value: VariableConditionEnum.include },
|
||||
{ label: '不包含', value: VariableConditionEnum.notInclude },
|
||||
{ label: '开始为', value: VariableConditionEnum.startWith },
|
||||
{ label: '结束为', value: VariableConditionEnum.endWith }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: i18nT('workflow:is_equal_to'), value: VariableConditionEnum.equalTo },
|
||||
{ label: i18nT('workflow:is_not_equal'), value: VariableConditionEnum.notEqual },
|
||||
{ label: i18nT('workflow:regex'), value: VariableConditionEnum.reg },
|
||||
{ label: i18nT('workflow:contains'), value: VariableConditionEnum.include },
|
||||
{ label: i18nT('workflow:not_contains'), value: VariableConditionEnum.notInclude },
|
||||
{ label: i18nT('workflow:start_with'), value: VariableConditionEnum.startWith },
|
||||
{ label: i18nT('workflow:end_with'), value: VariableConditionEnum.endWith }
|
||||
];
|
||||
export const numberConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: '等于', value: VariableConditionEnum.equalTo },
|
||||
{ label: '不等于', value: VariableConditionEnum.notEqual },
|
||||
{ label: '大于', value: VariableConditionEnum.greaterThan },
|
||||
{ label: '大于等于', value: VariableConditionEnum.greaterThanOrEqualTo },
|
||||
{ label: '小于', value: VariableConditionEnum.lessThan },
|
||||
{ label: '小于等于', value: VariableConditionEnum.lessThanOrEqualTo }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: i18nT('workflow:is_equal_to'), value: VariableConditionEnum.equalTo },
|
||||
{ label: i18nT('workflow:is_not_equal'), value: VariableConditionEnum.notEqual },
|
||||
{ label: i18nT('workflow:greater_than'), value: VariableConditionEnum.greaterThan },
|
||||
{
|
||||
label: i18nT('workflow:greater_than_or_equal_to'),
|
||||
value: VariableConditionEnum.greaterThanOrEqualTo
|
||||
},
|
||||
{ label: i18nT('workflow:less_than'), value: VariableConditionEnum.lessThan },
|
||||
{ label: i18nT('workflow:less_than_or_equal_to'), value: VariableConditionEnum.lessThanOrEqualTo }
|
||||
];
|
||||
export const booleanConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: '等于', value: VariableConditionEnum.equalTo }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: i18nT('workflow:is_equal_to'), value: VariableConditionEnum.equalTo }
|
||||
];
|
||||
export const arrayConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: '包含', value: VariableConditionEnum.include },
|
||||
{ label: '不包含', value: VariableConditionEnum.notInclude },
|
||||
{ label: '长度等于', value: VariableConditionEnum.lengthEqualTo },
|
||||
{ label: '长度不等于', value: VariableConditionEnum.lengthNotEqualTo },
|
||||
{ label: '长度大于', value: VariableConditionEnum.lengthGreaterThan },
|
||||
{ label: '长度大于等于', value: VariableConditionEnum.lengthGreaterThanOrEqualTo },
|
||||
{ label: '长度小于', value: VariableConditionEnum.lengthLessThan },
|
||||
{ label: '长度小于等于', value: VariableConditionEnum.lengthLessThanOrEqualTo }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: i18nT('workflow:contains'), value: VariableConditionEnum.include },
|
||||
{ label: i18nT('workflow:not_contains'), value: VariableConditionEnum.notInclude },
|
||||
{ label: i18nT('workflow:length_equal_to'), value: VariableConditionEnum.lengthEqualTo },
|
||||
{ label: i18nT('workflow:length_not_equal_to'), value: VariableConditionEnum.lengthNotEqualTo },
|
||||
{ label: i18nT('workflow:length_greater_than'), value: VariableConditionEnum.lengthGreaterThan },
|
||||
{
|
||||
label: i18nT('workflow:length_greater_than_or_equal_to'),
|
||||
value: VariableConditionEnum.lengthGreaterThanOrEqualTo
|
||||
},
|
||||
{ label: i18nT('workflow:length_less_than'), value: VariableConditionEnum.lengthLessThan },
|
||||
{
|
||||
label: i18nT('workflow:length_less_than_or_equal_to'),
|
||||
value: VariableConditionEnum.lengthLessThanOrEqualTo
|
||||
}
|
||||
];
|
||||
export const objectConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty }
|
||||
];
|
||||
export const allConditionList = [
|
||||
{ label: '为空', value: VariableConditionEnum.isEmpty },
|
||||
{ label: '不为空', value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: '等于', value: VariableConditionEnum.equalTo },
|
||||
{ label: '不等于', value: VariableConditionEnum.notEqual },
|
||||
{ label: '包含', value: VariableConditionEnum.include },
|
||||
{ label: '不包含', value: VariableConditionEnum.notInclude },
|
||||
{ label: '开始为', value: VariableConditionEnum.startWith },
|
||||
{ label: '结束为', value: VariableConditionEnum.endWith },
|
||||
{ label: '大于', value: VariableConditionEnum.greaterThan },
|
||||
{ label: '大于等于', value: VariableConditionEnum.greaterThanOrEqualTo },
|
||||
{ label: '小于', value: VariableConditionEnum.lessThan },
|
||||
{ label: '小于等于', value: VariableConditionEnum.lessThanOrEqualTo },
|
||||
{ label: '长度等于', value: VariableConditionEnum.lengthEqualTo },
|
||||
{ label: '长度不等于', value: VariableConditionEnum.lengthNotEqualTo },
|
||||
{ label: '长度大于', value: VariableConditionEnum.lengthGreaterThan },
|
||||
{ label: '长度大于等于', value: VariableConditionEnum.lengthGreaterThanOrEqualTo },
|
||||
{ label: '长度小于', value: VariableConditionEnum.lengthLessThan },
|
||||
{ label: '长度小于等于', value: VariableConditionEnum.lengthLessThanOrEqualTo }
|
||||
{ label: i18nT('workflow:is_empty'), value: VariableConditionEnum.isEmpty },
|
||||
{ label: i18nT('workflow:is_not_empty'), value: VariableConditionEnum.isNotEmpty },
|
||||
{ label: i18nT('workflow:is_equal_to'), value: VariableConditionEnum.equalTo },
|
||||
{ label: i18nT('workflow:is_not_equal'), value: VariableConditionEnum.notEqual },
|
||||
{ label: i18nT('workflow:contains'), value: VariableConditionEnum.include },
|
||||
{ label: i18nT('workflow:not_contains'), value: VariableConditionEnum.notInclude },
|
||||
{ label: i18nT('workflow:start_with'), value: VariableConditionEnum.startWith },
|
||||
{ label: i18nT('workflow:end_with'), value: VariableConditionEnum.endWith },
|
||||
{ label: i18nT('workflow:greater_than'), value: VariableConditionEnum.greaterThan },
|
||||
{
|
||||
label: i18nT('workflow:greater_than_or_equal_to'),
|
||||
value: VariableConditionEnum.greaterThanOrEqualTo
|
||||
},
|
||||
{ label: i18nT('workflow:less_than'), value: VariableConditionEnum.lessThan },
|
||||
{
|
||||
label: i18nT('workflow:less_than_or_equal_to'),
|
||||
value: VariableConditionEnum.lessThanOrEqualTo
|
||||
},
|
||||
{ label: i18nT('workflow:length_equal_to'), value: VariableConditionEnum.lengthEqualTo },
|
||||
{ label: i18nT('workflow:length_not_equal_to'), value: VariableConditionEnum.lengthNotEqualTo },
|
||||
{ label: i18nT('workflow:length_greater_than'), value: VariableConditionEnum.lengthGreaterThan },
|
||||
{
|
||||
label: i18nT('workflow:length_greater_than_or_equal_to'),
|
||||
value: VariableConditionEnum.lengthGreaterThanOrEqualTo
|
||||
},
|
||||
{ label: i18nT('workflow:length_less_than'), value: VariableConditionEnum.lengthLessThan },
|
||||
{
|
||||
label: i18nT('workflow:length_less_than_or_equal_to'),
|
||||
value: VariableConditionEnum.lengthLessThanOrEqualTo
|
||||
}
|
||||
];
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
import {
|
||||
FlowNodeTemplateTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
@@ -19,8 +20,8 @@ export const IfElseNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(false, false, false, false),
|
||||
targetHandle: getHandleConfig(true, false, true, true),
|
||||
avatar: 'core/workflow/template/ifelse',
|
||||
name: '判断器',
|
||||
intro: '根据一定的条件,执行不同的分支。',
|
||||
name: i18nT('workflow:condition_checker'),
|
||||
intro: i18nT('workflow:execute_different_branches_based_on_conditions'),
|
||||
showStatus: true,
|
||||
version: '481',
|
||||
inputs: [
|
||||
@@ -47,7 +48,7 @@ export const IfElseNode: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.ifElseResult,
|
||||
key: NodeOutputKeyEnum.ifElseResult,
|
||||
label: '判断结果',
|
||||
label: i18nT('workflow:judgment_result'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
import { Input_Template_DynamicInput } from '../input';
|
||||
import { Output_Template_AddOutput } from '../output';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const nodeLafCustomInputConfig = {
|
||||
selectValueTypeList: Object.values(WorkflowIOValueTypeEnum),
|
||||
@@ -27,15 +28,15 @@ export const LafModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/lafDispatch',
|
||||
name: 'Laf 函数调用(测试)',
|
||||
intro: '可以调用Laf账号下的云函数。',
|
||||
name: i18nT('workflow:laf_function_call_test'),
|
||||
intro: i18nT('workflow:intro_laf_function_call'),
|
||||
showStatus: true,
|
||||
isTool: true,
|
||||
version: '481',
|
||||
inputs: [
|
||||
{
|
||||
...Input_Template_DynamicInput,
|
||||
description: '接收前方节点的输出值作为变量,这些变量可以被 Laf 请求参数使用。',
|
||||
description: i18nT('workflow:dynamic_input_description'),
|
||||
customInputConfig: nodeLafCustomInputConfig
|
||||
},
|
||||
{
|
||||
@@ -52,8 +53,8 @@ export const LafModule: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.httpRawResponse,
|
||||
key: NodeOutputKeyEnum.httpRawResponse,
|
||||
label: '原始响应',
|
||||
description: 'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。',
|
||||
label: i18nT('workflow:raw_response'),
|
||||
description: i18nT('workflow:http_raw_response_description'),
|
||||
valueType: WorkflowIOValueTypeEnum.any,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
},
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
@@ -12,8 +13,8 @@ export const PluginInputModule: FlowNodeTemplateType = {
|
||||
unique: true,
|
||||
forbidDelete: true,
|
||||
avatar: 'core/workflow/template/workflowStart',
|
||||
name: '插件输入',
|
||||
intro: '可以配置插件需要哪些输入,利用这些输入来运行插件',
|
||||
name: i18nT('workflow:plugin_input'),
|
||||
intro: i18nT('workflow:intro_plugin_input'),
|
||||
showStatus: false,
|
||||
version: '481',
|
||||
inputs: [],
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
@@ -12,8 +13,8 @@ export const PluginOutputModule: FlowNodeTemplateType = {
|
||||
unique: true,
|
||||
forbidDelete: true,
|
||||
avatar: 'core/workflow/template/pluginOutput',
|
||||
name: '自定义插件输出',
|
||||
intro: '自定义配置外部输出,使用插件时,仅暴露自定义配置的输出',
|
||||
name: i18nT('workflow:custom_plugin_output'),
|
||||
intro: i18nT('workflow:intro_custom_plugin_output'),
|
||||
showStatus: false,
|
||||
version: '481',
|
||||
inputs: [],
|
||||
|
@@ -17,6 +17,7 @@ import {
|
||||
} from '../input';
|
||||
import { LLMModelTypeEnum } from '../../../ai/constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const AiQueryExtension: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.queryExtension,
|
||||
@@ -25,9 +26,8 @@ export const AiQueryExtension: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/queryExtension',
|
||||
name: '问题优化',
|
||||
intro:
|
||||
'使用问题优化功能,可以提高知识库连续对话时搜索的精度。使用该功能后,会先利用 AI 根据上下文构建一个或多个新的检索词,这些检索词更利于进行知识库搜索。该模块已内置在知识库搜索模块中,如果您仅进行一次知识库搜索,可直接使用知识库内置的补全功能。',
|
||||
name: i18nT('workflow:question_optimization'),
|
||||
intro: i18nT('workflow:intro_question_optimization'),
|
||||
showStatus: true,
|
||||
version: '481',
|
||||
inputs: [
|
||||
@@ -38,11 +38,11 @@ export const AiQueryExtension: FlowNodeTemplateType = {
|
||||
{
|
||||
key: NodeInputKeyEnum.aiSystemPrompt,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
|
||||
label: 'core.app.edit.Query extension background prompt',
|
||||
label: i18nT('common:core.app.edit.Query extension background prompt'),
|
||||
max: 300,
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
description: 'core.app.edit.Query extension background tip',
|
||||
placeholder: 'core.module.QueryExtension.placeholder'
|
||||
description: i18nT('common:core.app.edit.Query extension background tip'),
|
||||
placeholder: i18nT('common:core.module.QueryExtension.placeholder')
|
||||
},
|
||||
Input_Template_History,
|
||||
Input_Template_UserChatInput
|
||||
@@ -51,8 +51,8 @@ export const AiQueryExtension: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.text,
|
||||
key: NodeOutputKeyEnum.text,
|
||||
label: 'core.module.output.label.query extension result',
|
||||
description: 'core.module.output.description.query extension result',
|
||||
label: i18nT('common:core.module.output.label.query extension result'),
|
||||
description: i18nT('common:core.module.output.description.query extension result'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
} from '../../../constants';
|
||||
import { Input_Template_History, Input_Template_UserChatInput } from '../../input';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export const RunAppModule: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.runApp,
|
||||
@@ -21,8 +22,8 @@ export const RunAppModule: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/runApp',
|
||||
name: '应用调用',
|
||||
intro: '可以选择一个其他应用进行调用',
|
||||
name: i18nT('workflow:application_call'),
|
||||
intro: i18nT('workflow:select_another_application_to_call'),
|
||||
showStatus: true,
|
||||
version: '481',
|
||||
isTool: true,
|
||||
@@ -31,22 +32,22 @@ export const RunAppModule: FlowNodeTemplateType = {
|
||||
key: NodeInputKeyEnum.runAppSelectApp,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.selectApp, FlowNodeInputTypeEnum.reference],
|
||||
valueType: WorkflowIOValueTypeEnum.selectApp,
|
||||
label: '选择一个应用',
|
||||
description: '选择一个其他应用进行调用',
|
||||
label: i18nT('workflow:select_an_application'),
|
||||
description: i18nT('workflow:choose_another_application_to_call'),
|
||||
required: true
|
||||
},
|
||||
Input_Template_History,
|
||||
{
|
||||
...Input_Template_UserChatInput,
|
||||
toolDescription: '用户问题'
|
||||
toolDescription: i18nT('workflow:user_question')
|
||||
}
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
id: NodeOutputKeyEnum.history,
|
||||
key: NodeOutputKeyEnum.history,
|
||||
label: '新的上下文',
|
||||
description: '将该应用回复内容拼接到历史记录中,作为新的上下文返回',
|
||||
label: i18nT('workflow:new_context'),
|
||||
description: i18nT('workflow:append_application_reply_to_history_as_new_context'),
|
||||
valueType: WorkflowIOValueTypeEnum.chatHistory,
|
||||
valueDesc: chatHistoryValueDesc,
|
||||
required: true,
|
||||
@@ -55,8 +56,8 @@ export const RunAppModule: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.answerText,
|
||||
key: NodeOutputKeyEnum.answerText,
|
||||
label: '回复的文本',
|
||||
description: '将在应用完全结束后触发',
|
||||
label: i18nT('workflow:reply_text'),
|
||||
description: i18nT('workflow:trigger_after_application_completion'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import { getHandleConfig } from '../../utils';
|
||||
import { Input_Template_DynamicInput } from '../../input';
|
||||
import { Output_Template_AddOutput } from '../../output';
|
||||
import { JS_TEMPLATE } from './constants';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export const CodeNode: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.code,
|
||||
@@ -22,14 +23,14 @@ export const CodeNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/codeRun',
|
||||
name: '代码运行',
|
||||
intro: '执行一段简单的脚本代码,通常用于进行复杂的数据处理。',
|
||||
name: i18nT('workflow:code_execution'),
|
||||
intro: i18nT('workflow:execute_a_simple_script_code_usually_for_complex_data_processing'),
|
||||
showStatus: true,
|
||||
version: '482',
|
||||
inputs: [
|
||||
{
|
||||
...Input_Template_DynamicInput,
|
||||
description: '这些变量会作为代码的运行的输入参数',
|
||||
description: i18nT('workflow:these_variables_will_be_input_parameters_for_code_execution'),
|
||||
customInputConfig: {
|
||||
selectValueTypeList: Object.values(WorkflowIOValueTypeEnum),
|
||||
showDescription: false,
|
||||
@@ -78,20 +79,20 @@ export const CodeNode: FlowNodeTemplateType = {
|
||||
outputs: [
|
||||
{
|
||||
...Output_Template_AddOutput,
|
||||
description: '将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key'
|
||||
description: i18nT('workflow:pass_returned_object_as_output_to_next_nodes')
|
||||
},
|
||||
{
|
||||
id: NodeOutputKeyEnum.rawResponse,
|
||||
key: NodeOutputKeyEnum.rawResponse,
|
||||
label: '完整响应数据',
|
||||
label: i18nT('workflow:full_response_data'),
|
||||
valueType: WorkflowIOValueTypeEnum.object,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
},
|
||||
{
|
||||
id: NodeOutputKeyEnum.error,
|
||||
key: NodeOutputKeyEnum.error,
|
||||
label: '运行错误',
|
||||
description: '代码运行错误信息,成功时返回空',
|
||||
label: i18nT('workflow:execution_error'),
|
||||
description: i18nT('workflow:error_info_returns_empty_on_success'),
|
||||
valueType: WorkflowIOValueTypeEnum.object,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
},
|
||||
|
@@ -2,6 +2,7 @@ import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const StopToolNode: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.stopTool,
|
||||
@@ -10,9 +11,8 @@ export const StopToolNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(false, false, false, false),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/stopTool',
|
||||
name: '工具调用终止',
|
||||
intro:
|
||||
'该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。',
|
||||
name: i18nT('workflow:tool_call_termination'),
|
||||
intro: i18nT('workflow:intro_tool_call_termination'),
|
||||
version: '481',
|
||||
inputs: [],
|
||||
outputs: []
|
||||
|
@@ -12,6 +12,7 @@ import {
|
||||
} from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { Input_Template_DynamicInput } from '../input';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const TextEditorNode: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.textEditor,
|
||||
@@ -20,13 +21,13 @@ export const TextEditorNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/textConcat',
|
||||
name: '文本拼接',
|
||||
intro: '可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。',
|
||||
name: i18nT('workflow:text_concatenation'),
|
||||
intro: i18nT('workflow:intro_text_concatenation'),
|
||||
version: '486',
|
||||
inputs: [
|
||||
{
|
||||
...Input_Template_DynamicInput,
|
||||
description: '可以引用其他节点的输出,作为文本拼接的变量,输入 / 唤起变量列表',
|
||||
description: i18nT('workflow:dynamic_input_description_concat'),
|
||||
customInputConfig: {
|
||||
selectValueTypeList: Object.values(WorkflowIOValueTypeEnum),
|
||||
showDescription: false,
|
||||
@@ -38,15 +39,15 @@ export const TextEditorNode: FlowNodeTemplateType = {
|
||||
renderTypeList: [FlowNodeInputTypeEnum.textarea],
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
required: true,
|
||||
label: '拼接文本',
|
||||
placeholder: '可输入 / 唤起变量列表'
|
||||
label: i18nT('workflow:concatenation_text'),
|
||||
placeholder: i18nT('workflow:input_variable_list')
|
||||
}
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
id: NodeOutputKeyEnum.text,
|
||||
key: NodeOutputKeyEnum.text,
|
||||
label: '拼接结果',
|
||||
label: i18nT('workflow:concatenation_result'),
|
||||
type: FlowNodeOutputTypeEnum.static,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ export const ToolModule: FlowNodeTemplateType = {
|
||||
|
||||
{
|
||||
...Input_Template_System_Prompt,
|
||||
label: 'core.ai.Prompt',
|
||||
label: i18nT('common:core.ai.Prompt'),
|
||||
description: chatNodeSystemPromptTip,
|
||||
placeholder: chatNodeSystemPromptTip
|
||||
},
|
||||
@@ -72,8 +72,8 @@ export const ToolModule: FlowNodeTemplateType = {
|
||||
{
|
||||
id: NodeOutputKeyEnum.answerText,
|
||||
key: NodeOutputKeyEnum.answerText,
|
||||
label: 'core.module.output.label.Ai response content',
|
||||
description: 'core.module.output.description.Ai response content',
|
||||
label: i18nT('common:core.module.output.label.Ai response content'),
|
||||
description: i18nT('common:core.module.output.description.Ai response content'),
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
WorkflowIOValueTypeEnum
|
||||
} from '../../../constants';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
export const VariableUpdateNode: FlowNodeTemplateType = {
|
||||
id: FlowNodeTypeEnum.variableUpdate,
|
||||
@@ -14,8 +15,8 @@ export const VariableUpdateNode: FlowNodeTemplateType = {
|
||||
sourceHandle: getHandleConfig(true, true, true, true),
|
||||
targetHandle: getHandleConfig(true, true, true, true),
|
||||
avatar: 'core/workflow/template/variableUpdate',
|
||||
name: '变量更新',
|
||||
intro: '可以更新指定节点的输出值或更新全局变量',
|
||||
name: i18nT('workflow:variable_update'),
|
||||
intro: i18nT('workflow:update_specified_node_output_or_global_variable'),
|
||||
showStatus: false,
|
||||
isTool: false,
|
||||
version: '481',
|
||||
|
@@ -31,7 +31,7 @@ export const WorkflowStart: FlowNodeTemplateType = {
|
||||
forbidDelete: true,
|
||||
unique: true,
|
||||
version: '481',
|
||||
inputs: [{ ...Input_Template_UserChatInput, toolDescription: '用户问题' }],
|
||||
inputs: [{ ...Input_Template_UserChatInput, toolDescription: i18nT('workflow:user_question') }],
|
||||
outputs: [
|
||||
{
|
||||
id: NodeOutputKeyEnum.userChatInput,
|
||||
|
Reference in New Issue
Block a user