chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -62,7 +62,7 @@ export const Inputs = withFieldArray(
|
||||
tooltip={I18n.t('ltm_240826_01')}
|
||||
testId={getNodeSetterId(fieldName)}
|
||||
actions={[
|
||||
// 即将支持,敬请期待
|
||||
// Support soon, so stay tuned.
|
||||
isChatflow && FLAGS['bot.automation.ltm_enhance'] ? (
|
||||
<HistorySwitchField name="inputs.historySetting.enableChatHistory" />
|
||||
) : null,
|
||||
|
||||
@@ -18,10 +18,10 @@ import { nanoid } from 'nanoid';
|
||||
import { ViewVariableType } from '@coze-workflow/variable';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
|
||||
// 入参路径,试运行等功能依赖该路径提取参数
|
||||
// Imported parameter path, practice running and other functions rely on this path to extract parameters
|
||||
export const INPUT_PATH = 'inputs.inputParameters';
|
||||
|
||||
// 定义固定出参
|
||||
// Define fixed exported parameters
|
||||
export const OUTPUTS = [
|
||||
{
|
||||
key: nanoid(),
|
||||
|
||||
@@ -30,11 +30,11 @@ const DEFAULT_VALUE = [
|
||||
];
|
||||
|
||||
/**
|
||||
* 节点后端数据 -> 前端表单数据
|
||||
* Node Backend Data - > Frontend Form Data
|
||||
*/
|
||||
export const transformOnInit = (value: DTODataWhenInit): FormData => {
|
||||
// 拖入节点,value 为 null
|
||||
// 创建副本,value.inputs.inputParameters 数组为空
|
||||
// Drag into node with null value
|
||||
// Create a copy, value.input.inputParameters array is empty
|
||||
const inputParameters = value?.inputs?.inputParameters ?? [];
|
||||
const inputParametersWithNoHistoryFields = inputParameters.filter(
|
||||
v => !HISTORY_FIELDS.includes(v.name || ''),
|
||||
@@ -55,12 +55,12 @@ export const transformOnInit = (value: DTODataWhenInit): FormData => {
|
||||
? DEFAULT_VALUE
|
||||
: inputParametersWithNoHistoryFields,
|
||||
|
||||
// 历史会话设置
|
||||
// historical session settings
|
||||
historySetting: {
|
||||
// 是否开启历史会话
|
||||
// Whether to open a historical session
|
||||
enableChatHistory: Boolean(historySwitchItem?.content),
|
||||
|
||||
// 历史会话轮数,默认为 3
|
||||
// Number of session rounds in history, default is 3
|
||||
chatHistoryRound: (historyRoundItem?.content as number) ?? 3,
|
||||
},
|
||||
},
|
||||
@@ -70,7 +70,7 @@ export const transformOnInit = (value: DTODataWhenInit): FormData => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 前端表单数据 -> 节点后端数据
|
||||
* Front-end form data - > node back-end data
|
||||
* @param value
|
||||
* @returns
|
||||
*/
|
||||
|
||||
@@ -31,30 +31,30 @@ import { FormRender } from './form';
|
||||
import { transformOnInit, transformOnSubmit } from './data-transformer';
|
||||
|
||||
export const LTM_FORM_META: FormMetaV2<FormData> = {
|
||||
// 节点表单渲染
|
||||
// Node form rendering
|
||||
render: () => <FormRender />,
|
||||
|
||||
// 验证触发时机
|
||||
// verification trigger timing
|
||||
validateTrigger: ValidateTrigger.onChange,
|
||||
|
||||
// 验证规则
|
||||
// validation rules
|
||||
validate: {
|
||||
nodeMeta: nodeMetaValidate,
|
||||
// 必填
|
||||
// Required
|
||||
'inputs.inputParameters.0.input': createValueExpressionInputValidate({
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
|
||||
// 副作用管理
|
||||
// Side effect management
|
||||
effect: {
|
||||
nodeMeta: fireNodeTitleChange,
|
||||
outputs: provideNodeOutputVariablesEffect,
|
||||
},
|
||||
|
||||
// 节点后端数据 -> 前端表单数据
|
||||
// Node Backend Data - > Frontend Form Data
|
||||
formatOnInit: transformOnInit,
|
||||
|
||||
// 前端表单数据 -> 节点后端数据
|
||||
// Front-end form data - > node back-end data
|
||||
formatOnSubmit: transformOnSubmit,
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ export const LTM_NODE_REGISTRY: WorkflowNodeRegistry<NodeTestMeta> = {
|
||||
size: { width: 360, height: 130.7 },
|
||||
nodeMetaPath: DEFAULT_NODE_META_PATH,
|
||||
outputsPath: DEFAULT_OUTPUTS_PATH,
|
||||
inputParametersPath: INPUT_PATH, // 入参路径,试运行等功能依赖该路径提取参数
|
||||
inputParametersPath: INPUT_PATH, // Imported parameter path, practice running and other functions rely on this path to extract parameters
|
||||
test,
|
||||
helpLink: '/open/docs/guides/ltm_node',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user