CMVR-IOT-UI/src/views/flow/config.js
zhanghao d733ea8525 feat: 增强流资源管理和节点执行组件
- 增加了检测流资源中引用循环的功能,以防止循环依赖。
- 改进了流引用的验证,以确保节点输出中不存在循环依赖。
- 增强了资源定义清理功能,以便在执行前移除过时的设备ID。
- 已实现复制资源角色的合并,以优化现有资源的优先级并避免重复。
- 更新了LoopIterationResults组件,以管理运行中迭代的自动扩展。
- 增强了NodeState和NodeTitle组件,以支持循环和子流结果的更宽弹出框显示。
- 优化了ParamsDrawer和SubFlowExecutionResults组件,以处理动态参数更新和执行结果。
- 改进了TaskExecutionLog,以统一输出处理并增强用户对日志的可见性。
- 更新了各种参数组件,以简化输入处理并提升用户体验。
- 在代码中添加了全面的注释和文档,以提高可维护性和易理解性。
2026-08-21 15:01:16 +08:00

899 lines
34 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 文件说明:定义流程设计器可用的节点、表单字段及下拉选项等静态配置。
* 作用范围:仅服务于流程设计器模块。
*/
import cameraSvg from './icon/camera.svg'
import videoSvg from './icon/video.svg'
import loopSvg from './icon/loop.svg'
import stopLoopSvg from './icon/stopLoop.svg'
import switchSvg from './icon/switch.svg'
import microphoneSvg from './icon/microphone.svg'
import sleepSvg from './icon/sleep.svg'
import planSvg from './icon/plan.svg'
import awakenSvg from './icon/awaken.svg'
import dialogueSvg from './icon/dialogue.svg'
import audioSvg from './icon/audio.svg'
import touchSvg from './icon/touch.svg'
import expressionSvg from './icon/expression.svg'
/**
* 处理与 http method options 相关的状态或数据,该影响范围仅限当前模块。
*/
const httpMethodOptions = () => {
return [{
value: 'POST',
label: 'POST'
}, {
value: 'GET',
label: 'GET'
}, {
value: 'PUT',
label: 'PUT'
}, {
value: 'DELETE',
label: 'DELETE'
}]
}
/**
* 处理与 express options 相关的状态或数据,该影响范围仅限当前模块。
*/
const expressOptions = () => {
return [{
value: 1,
label: '高兴'
}, {
value: 2,
label: '惊讶'
}, {
value: 3,
label: '愤怒'
}, {
value: 4,
label: '悲伤'
}, {
value: 5,
label: '睡觉'
}, {
value: 6,
label: '打哈欠'
}]
}
/**
* 处理与 task type options 相关的状态或数据,该影响范围仅限当前模块。
*/
const taskTypeOptions = () => {
return [{
value: 'voice',
label: '语音交互'
}, {
value: 'touch',
label: '触控交互'
}]
}
/**
* 处理与 voice options 相关的状态或数据,该影响范围仅限当前模块。
*/
const voiceOptions = () => {
return [{
value: 'x4_xiaoyan',
label: 'x4_xiaoyan'
}]
}
/**
* 处理与 inspection event types 相关的状态或数据,该影响范围仅限当前模块。
*/
const inspectionEventTypes = () => {
return [{
value: 'No-Glove',
label: '没戴手套'
}, {
value: 'No-Helmet-Glove',
label: '没戴头盔'
}]
}
export const collapseList = [
{
collapseTitle: "相机",
nodeList: [
{
icon: cameraSvg,
name: "开启相机",
type: "serviceNode",
desc: "在获取相机照片时,需要先启动相机",
action: 'CAMERA_START',
nodeType: 'EDGE',
nodeParams: [],
outputParams: [],
outputType: 'json'
},
{
icon: cameraSvg,
name: "获取图片",
type: "serviceNode",
desc: "获取相机拍摄的照片",
action: 'CAMERA_GETRGBIMAGE',
nodeType: 'EDGE',
nodeParams: [],
outputType: 'img',
outputParams: [{ name: 'imageUrl', type: 'array<string>', desc: '图片地址数组', children: [], disabled: true }]
},
{
icon: cameraSvg,
name: "关闭相机",
type: "serviceNode",
desc: "获取相机照片后,关闭该相机",
action: 'CAMERA_STOP',
nodeType: 'EDGE',
nodeParams: [],
outputParams: [],
outputType: 'json'
},
],
},
{
collapseTitle: "录像",
nodeList: [
{
icon: videoSvg,
name: "开启录像",
type: "serviceNode",
desc: "开启摄像头,并开始录像",
action: 'CAMERA_RECORDING_START',
nodeType: 'EDGE',
nodeParams: [],
outputParams: [],
outputType: 'json'
},
{
icon: videoSvg,
name: "结束录像",
type: "serviceNode",
desc: "停止录像,并关闭摄像头",
action: 'CAMERA_RECORDING_STOP',
nodeType: 'EDGE',
nodeParams: [],
outputType: 'video',
outputParams: [{ name: 'videoUrl', type: 'array<string>', children: [], desc: '视频播放地址数组', disabled: true}]
}
],
},
{
collapseTitle: "功能",
nodeList: [
{
icon: loopSvg,
name: "循环",
type: "loop",
action: 'START_LOOP',
desc: "实现对列表对象循环执行一系列任务",
nodeParams: [{ name: "loopNum", type: "input", input: null, quote: "" }],
outputParams: [],
outputType: 'json'
},
{
icon: planSvg,
name: "子流程",
type: "subFlow",
action: 'SUB_FLOW',
nodeType: 'NONE',
desc: "执行同一项目中已发布的工作流",
// 具体输入/输出契约在参数面板选择发布版本后同步,配置清单只提供初始空壳。
subFlow: {},
nodeParams: [],
outputParams: [],
outputType: 'json'
},
{
icon: stopLoopSvg,
name: "结束循环",
type: "stopLoop",
action: 'STOP_LOOP',
desc: "用于立即终止当前所在的循环,跳出循环体",
},
// {
// icon: startSvg,
// name: "单次循环开始",
// type: "subStart",
// action: 'SUB_START',
// desc: "循环体内部工作流的开始节点,开始循环体内部的单次流程",
// },
// {
// icon: endSvg,
// name: "单次循环结束",
// type: "subEnd",
// action: 'SUB_END',
// desc: "循环体内部工作流的终止节点,结束循环体内部的单次流程",
// },
{
icon: switchSvg,
name: "分支",
type: "branch",
action: 'BRANCH',
desc: "连接多个下游分支,根据设定的条件按照顺序查找的方式来匹配运行的分支,如果匹配到某条件则只运行该条件对应的分支,否则继续匹配下一条件直至结束",
},
{
icon: sleepSvg,
name: "睡眠",
type: "sleep",
desc: "用于睡眠整个流程,表示延迟多少毫秒",
action: 'sleep',
nodeParams: [
{ name: "delayMs", type: "input", componentType: 'number', input: 0, disabled: true }
],
outputParams: [],
outputType: 'json'
},
{
icon: expressionSvg,
name: "HTTP请求",
type: "http",
desc: "HTTP请求",
action: 'HTTP',
nodeType: 'HTTP',
nodeParams: [
{ name: "config", type: "input", input: "", children: [
{ name: "url", type: "input", input: "", disabled: true, required: true },
{ name: "method", type: "input", input: "POST", componentType: 'select', selectOptions: httpMethodOptions(), disabled: true },
{ name: "timeout", type: "input", input: "10000", componentType: 'number', required: false, disabled: true }
], disabled: true, required: true },
{ name: "headers", type: "input", input: "", children: [
{ name: "", type: "input", input: ""}
], disabled: true, required: true },
{ name: "params", type: "input", input: "", children: [
{ name: "", type: "input", input: ""}
], disabled: true, required: true },
{ name: "body", type: "input", input: "", children: [
{ name: 'bodyType', type: "input", input: "json", disabled: true },
{ name: 'json', type: "input", input: '{"a": 123}' },
{ name: 'formData', type: "input", input: "", children: []}
], required: true },
],
outputType: 'json',
outputParams: [{ name: 'result', type: 'Object', children: [], desc: 'HTTP请求结果'}]
},
{
icon: expressionSvg,
name: "代码",
type: "code",
desc: "js代码",
action: 'CODE',
canAddFormItem: true,
nodeParams: [
{ name: "input", type: "input", input: "", required: true },
{ name: "code", type: "input", input: `
// 方法定义不能修改
/**
* 处理与 r 相关的状态或数据,该影响范围仅限当前模块。
* @param {*} params 待处理的参数集合
*/
function handler(params) {
// 返回值是一个可序列化成 json 的 dict 或 object
const result ={
type: 2,
message: params.input
}
return result
}
`, required: true }
],
outputType: 'json',
outputParams: [{ name: 'result', type: 'object', children: [
{name: 'type', type: 'number', desc: '占位属性'},
{name: 'message', type: 'string', desc: '占位属性'}
], desc: 'js节点返回'}]
},
{
icon: microphoneSvg,
name: "获取当前循环对象",
type: "currentLoop",
desc: "获取当前循环对象",
action: 'GET_CURRENT_OBJECT',
nodeParams: [
{ name: "array", type: "input", input: "" }
],
outputType: 'json',
outputParams: [
{ name: 'index', type: 'number', desc: '索引'},
{ name: 'object', type: 'object', children: [
{ name: 'test', type: 'string', desc: '占位属性' }
], desc: '当前循环对象', }
]
},
],
},
{
collapseTitle: "机器人",
nodeList: [
{
icon: videoSvg,
name: "AGV控制",
type: "serviceNode",
desc: "控制机器人的底盘",
action: 'AGV_MOVE_TO_POINT',
nodeType: 'EDGE',
nodeParams: [
{ name: "x", type: "input", input: "", disabled: true },
{ name: "y", type: "input", input: "", disabled: true },
{ name: "theta", type: "input", input: "", disabled: true },
{ name: "blockedTimeoutMs", type: "input", componentType: "number", input: 60000, min: 1, required: true, disabled: true },
],
outputType: 'json'
},
{
icon: videoSvg,
name: "AGV站点导航",
type: "serviceNode",
desc: "从AGV站点列表选择目标站点并导航",
action: 'AGV_MOVE_TO_STATION',
nodeType: 'EDGE',
nodeParams: [
{ name: "stationId", type: "input", input: "", componentType: 'select', selectOptions: [], forceSelect: true, disabled: true },
{ name: "blockedTimeoutMs", type: "input", componentType: "number", input: 60000, min: 1, required: true, disabled: true }
],
outputType: 'json'
},
{
icon: cameraSvg,
name: "通用指令",
type: "deviceUniversal",
desc: "执行设备通用指令",
action: 'DEVICE_EXECUTE_JSON_COMMAND',
nodeType: 'EDGE',
nodeParams: [
{ name: "requestJson", type: "input", input: `{
"a":123
}`, required: false, disabled: true },
],
outputParams: [],
outputType: 'json'
},
{
icon: planSvg,
name: "动作队列",
type: "actionQueue",
desc: "在边缘端按顺序连续执行多个动作",
action: 'SYSTEM_EXECUTE_ACTION_QUEUE',
nodeType: 'EDGE',
nodeParams: [
{ name: "actionId", type: "input", input: "", required: false },
{ name: "totalTimeoutMs", type: "input", componentType: 'number', input: 60000, required: true },
{ name: "steps", type: "input", input: [], required: true },
],
outputParams: [
{ name: 'actionId', type: 'string', desc: '动作队列标识' },
{ name: 'completedSteps', type: 'number', desc: '已完成步骤数' },
{ name: 'result', type: 'string', desc: '执行结果' },
],
outputType: 'json'
},
{
icon: videoSvg,
name: "机械臂",
type: "serviceNode",
desc: "控制机器人的手臂",
action: 'ARM_MOVE_TO_POINT',
nodeType: 'EDGE',
nodeParams: [
{ name: "x", type: "input", input: "", disabled: true },
{ name: "y", type: "input", input: "", disabled: true },
{ name: "z", type: "input", input: "", disabled: true },
{ name: "rx", type: "input", input: "", disabled: true },
{ name: "ry", type: "input", input: "", disabled: true },
{ name: "rz", type: "input", input: "", disabled: true },
{ name: "velocity", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.1, disabled: true },
{ name: "acceleration", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.2, disabled: true },
],
outputType: 'json'
},
{
icon: videoSvg,
name: "机械臂关节运动",
type: "serviceNode",
desc: "通过关节空间插值运动到目标关节位置",
action: 'ARM_MOVE_TO_J',
nodeType: 'EDGE',
nodeParams: [
{ name: "target", type: "input", input: "[0, 0, 0, 0, 0, 0]", disabled: true },
{ name: "velocity", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.1, disabled: true },
{ name: "acceleration", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.2, disabled: true },
],
outputType: 'json'
},
// 使能状态由两个独立节点显式控制。节点本身不接收参数,也不依赖前一运动节点的隐式使能,
// 因而可在流程开始、异常恢复或任务收尾位置按业务需要自由编排。
{
icon: videoSvg,
name: "开启机械臂使能",
type: "serviceNode",
desc: "开启机械臂使能,后续运动节点不会自动使能",
action: 'ARM_ENABLE',
nodeType: 'EDGE',
nodeParams: [],
outputParams: [],
outputType: 'json'
},
// 关闭节点与开启节点使用不同 action,边缘执行器据此下发去使能指令;
// 空 outputParams 表示该节点只负责设备状态切换,不向后续节点暴露业务输出。
{
icon: videoSvg,
name: "关闭机械臂使能",
type: "serviceNode",
desc: "关闭机械臂使能",
action: 'ARM_DISABLE',
nodeType: 'EDGE',
nodeParams: [],
outputParams: [],
outputType: 'json'
},
{
icon: cameraSvg,
name: "开始监听报警事件",
type: "serviceNode",
desc: "开始监听报警事件",
action: 'INSPECTION_ALERT_LISTEN_START',
nodeType: 'EDGE',
nodeParams: [
{ name: "robotId", type: "input", input: "", disabled: true },
{ name: "eventTypes", type: "input", input: "", componentType: 'select', selectOptions: inspectionEventTypes(), disabled: true }
],
outputParams: [],
outputType: 'json'
},
{
icon: cameraSvg,
name: "结束监听报警事件",
type: "serviceNode",
desc: "结束监听报警事件",
action: 'INSPECTION_ALERT_LISTEN_STOP',
nodeType: 'EDGE',
nodeParams: [
{ name: "robotId", type: "input", input: "", disabled: true },
{ name: "eventTypes", type: "input", input: "", componentType: 'select', selectOptions: inspectionEventTypes(), disabled: true }
],
outputParams: [],
outputType: 'json'
},
{
icon: dialogueSvg,
name: "巡检仪表读数识别",
type: "recognize",
desc: "巡检仪表读数识别",
action: 'INSPECTION_METER_RECOGNIZE',
nodeType: "LLM",
outputType: 'json',
nodeParams: [
{ name: 'imageUrl', type: "input", input: "", disabled: true },
{ name: 'resultName', type: "input", input: "", disabled: true },
{ name: "alarmRules", type: "input", input: [], disabled: true }
],
outputParams: []
},
{
icon: cameraSvg,
name: "人工巡检判断",
type: "serviceNode",
desc: "创建人工巡检判断任务",
action: 'INSPECTION_MANUAL_REVIEW_CREATE',
nodeType: 'EDGE',
nodeParams: [
{ name: "resultName", type: "input", input: "", disabled: true },
{ name: "videoUrl", type: "input", input: "", required: false, disabled: true },
{ name: "imageUrl", type: "input", input: "", required: false, disabled: true },
{ name: "reviewCriteria", type: "input", input: "", disabled: true },
{ name: "defaultAlarmLevel", type: "input", componentType: 'number', max: 3, step: 1, input: 1, disabled: true },
],
outputParams: [],
outputType: 'json'
},
],
},
{
collapseTitle: "音频",
nodeList: [
{
icon: microphoneSvg,
name: "启动麦克风",
type: "serviceNode",
desc: "用于启动麦克风的节点",
action: 'MICROPHONE_START',
nodeType: 'EDGE',
nodeParams: [],
outputType: 'json'
},
{
icon: microphoneSvg,
name: "停止麦克风",
type: "serviceNode",
desc: "用于停止麦克风的节点",
action: 'MICROPHONE_STOP',
nodeType: 'EDGE',
nodeParams: [],
outputType: 'audio',
outputParams: [{ name: 'audioUrl', type: 'array<string>', children: [], desc: '录音播放地址数组', disabled: true }]
},
{
icon: audioSvg,
name: "播放音频",
type: "serviceNode",
desc: "用于播放音频的节点",
action: 'SPEAKER_PLAYAUDIO',
nodeType: 'EDGE',
nodeParams: [
{ name: "audioPath", type: "input", input: "", disabled: true }
],
outputType: 'json'
},
],
},
{
collapseTitle: "大模型",
nodeList: [
{
icon: microphoneSvg,
name: "声音类型检测",
type: "mediaAnalysis",
desc: "判断录音是否属于指定的声音类型",
action: "AUDIO_EVENT_CLASSIFY",
nodeType: "LLM",
nodeParams: [
{ name: "profileCode", type: "input", input: "aima.power_state.v1", required: true, disabled: true },
{ name: "expectedLabel", type: "input", input: "", required: true, disabled: true },
{ name: "expectedLabelName", type: "input", input: "", required: false, disabled: true },
{ name: "audioUrl", type: "quote", input: "", quote: "", required: true, disabled: true },
{ name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" },
],
outputType: "json",
outputParams: [
{ name: "passed", type: "boolean", desc: "是否检测到目标声音", disabled: true },
{ name: "expectedLabel", type: "string", desc: "目标声音类型编码", disabled: true },
{ name: "expectedLabelName", type: "string", desc: "目标声音类型名称", disabled: true },
{ name: "label", type: "string", desc: "实际声音类型编码,未匹配时为UNKNOWN", disabled: true },
{ name: "labelName", type: "string", desc: "实际声音类型名称", disabled: true },
{ name: "matched", type: "boolean", desc: "是否识别到已知声音", disabled: true },
{ name: "confidence", type: "number", desc: "最高匹配度", disabled: true },
{ name: "decisionReason", type: "string", desc: "检测结论", disabled: true },
{ name: "scores", type: "object", desc: "各分类匹配度", children: [], disabled: true },
],
},
{
icon: videoSvg,
name: "视频智能分析",
type: "mediaAnalysis",
desc: "按分析场景理解测试录像并输出结构化结论",
action: "VIDEO_ANALYZE",
nodeType: "LLM",
nodeParams: [
{ name: "profileCode", type: "input", input: "aima.power_video.v1", required: true, disabled: true },
{ name: "videoUrl", type: "quote", input: "", quote: "", required: true, disabled: true },
{ name: "instruction", type: "input", input: "", required: true, disabled: true },
{ name: "analysisMode", type: "input", input: "AUTO", required: false, disabled: true },
// 默认返回精简结论;用户开启详细输出时,执行端才补充事件证据。
{ name: "detailedOutput", type: "input", input: false, required: false, disabled: true, componentType: "switch" },
{ name: "analysisTuning", type: "input", input: { sampleFps: 2, maxWidth: 960, confidenceThreshold: 0.75, fallbackToAccurate: true }, required: false, disabled: true },
{ name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" },
],
outputType: "json",
outputParams: [
{ name: "result", type: "string", desc: "分析结果", disabled: true },
{ name: "passed", type: "boolean", desc: "是否通过", disabled: true },
{ name: "confidence", type: "number", desc: "判定置信度", disabled: true },
{ name: "evidenceSufficient", type: "boolean", desc: "证据是否充分", disabled: true },
{ name: "decisionReason", type: "string", desc: "判定原因", disabled: true },
{ name: "conclusion", type: "string", desc: "分析结论", disabled: true },
{ name: "summary", type: "string", desc: "分析摘要", disabled: true },
{ name: "events", type: "array<object>", desc: "关键事件", children: [], disabled: true },
{ name: "analysisMode", type: "string", desc: "实际分析模式", disabled: true },
{ name: "fallback", type: "boolean", desc: "是否切换精确分析", disabled: true },
{ name: "detailedOutput", type: "boolean", desc: "是否返回详细事件证据", disabled: true },
],
},
{
// 通用图片分析不内置通过/不通过判定,返回结构完全由用户提示词约定。
icon: cameraSvg,
name: "通用图片分析",
type: "imageAnalysis",
desc: "按照提示词分析一张或多张图片并返回指定内容",
action: 'IMAGE_ANALYZE',
nodeType: "LLM",
nodeParams: [
{ name: "profileCode", type: "input", input: "common.image_analysis.v1", required: true, disabled: true },
{ name: "imageUrl", type: "quote", input: "", quote: "", required: true, disabled: true },
{ name: "analysisMethod", type: "input", input: "VISION_MODEL", required: false, disabled: true },
{ name: "prompt", type: "input", input: "", required: true, disabled: true, componentType: "textarea" },
{ name: "analysisMode", type: "input", input: "FAST", required: false, disabled: true },
{ name: "analysisTuning", type: "input", input: { maxWidth: 896, maxImages: 12, maxOutputTokens: 384, matchThreshold: 0.48, matchSelector: "BEST", matchIndex: 1, matchSort: "ROW_MAJOR", locateConfidenceThreshold: 0.45 }, required: false, disabled: true },
{ name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" },
],
outputType: "json",
outputParams: [
{ name: "result", type: "object", desc: "按提示词返回的结果", children: [], disabled: true },
{ name: "resultText", type: "string", desc: "模型返回的原始文本", disabled: true },
{ name: "matched", type: "boolean", desc: "找图是否匹配", disabled: true },
{ name: "matchScore", type: "number", desc: "匹配分数或定位置信度", disabled: true },
{ name: "coordinates", type: "array<number>", desc: "原图坐标 [x1,y1,x2,y2]", children: [], disabled: true },
{ name: "center", type: "array<number>", desc: "目标中心点 [x,y]", children: [], disabled: true },
{ name: "matchedDescription", type: "string", desc: "模型实际定位的目标描述", disabled: true },
{ name: "refinementMethod", type: "string", desc: "坐标精修方式", disabled: true },
{ name: "matchCount", type: "number", desc: "匹配项数量", disabled: true },
{ name: "matches", type: "array<object>", desc: "全部匹配项", children: [], disabled: true },
{ name: "selectedMatchIndex", type: "number", desc: "当前选择的匹配序号", disabled: true },
],
},
{
icon: microphoneSvg,
name: "获取触控坐标",
type: "serviceNode",
desc: "用于获取触控坐标的节点",
action: 'TOUCH_COORDINATES',
nodeType: "LLM",
nodeParams: [
{ name: "targetFeature", type: "input", input: "运动模式", disabled: true },
{ name: "manufacturer", type: "input", input: "xiaomi", disabled: true },
{ name: "vehType", type: "input", input: "su7", disabled: true },
],
outputType: 'json',
outputParams: [{ name: 'coordinates', type: 'object', children: [
{ name: 'x', type: 'number', desc: 'x坐标' },
{ name: 'y', type: 'number', desc: 'y坐标' }
], desc: '坐标对象', }]
}, {
icon: dialogueSvg,
name: "tts语音合成",
type: "serviceNode",
desc: "将指令文本(text)处理合成语音,输出语音路径(audioPath)",
action: 'GENERATE_ADVANCED_AUDIO',
nodeType: "LLM",
outputType: 'json',
nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }],
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
}, {
icon: dialogueSvg,
name: "意图识别",
type: "serviceNode",
desc: "意图识别,输出类型(type) 1: 语音交互 2: 触控交互 3: 闲聊 4: 知识问答",
action: 'INTENT_RECOGNITION',
nodeType: "LLM",
outputType: 'json',
nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }],
outputParams: [{ name: 'type', type: 'string', desc: '1:语音交互 2:触控交互 3: 闲聊 4:知识问答', disabled: true}]
}, {
icon: dialogueSvg,
name: "商道智能体",
type: "sdAgent",
desc: "通过apiKey调用商道大模型",
action: 'AI_AGENT_PLATFORM',
nodeType: "LLM",
outputType: 'json',
nodeParams: [
{ name: "config", type: "input", input: "", children: [
{ name: 'apiKey', type: "input", input: "", disabled: true },
{ name: 'text', type: "input", input: "", disabled: true },
]},
{ name: 'invokeTts', type: "input", input: false },
{ name: 'tts', type: "input", input: "", children: [
{ name: 'url', type: "input", input: "", disabled: true },
{ name: 'text', type: "input", input: "", disabled: true },
{ name: 'speed', type: "input", input: "", max: 100, disabled: true },
{ name: 'voice', type: "input", input: "", componentType: 'select', selectOptions: voiceOptions(), disabled: true },
{ name: 'volume', type: "input", input: "", componentType: 'number', max: 100, disabled: true }
], disabled: true }
],
outputParams: [{ name: 'result', type: 'string', desc: '商道大模型的返回文案', disabled: true}]
}, {
icon: dialogueSvg,
name: "tts语音播放",
type: "serviceNode",
desc: "调用tts将文案转换为语音播放",
action: 'AI_TTS',
nodeType: "LLM",
outputType: 'json',
nodeParams: [
{ name: 'url', type: "input", input: "", disabled: true },
{ name: 'text', type: "input", input: "", disabled: true },
{ name: 'speed', type: "input", input: "", max: 100, disabled: true },
{ name: 'voice', type: "input", input: "", componentType: 'select', selectOptions: voiceOptions(), disabled: true },
{ name: 'volume', type: "input", input: "", componentType: 'number', max: 100, disabled: true }
]
}, {
icon: dialogueSvg,
name: "获取当前页面名称",
type: "serviceNode",
desc: "获取当前页面名称",
action: 'GET_CURRENT_PAGE',
nodeType: "LLM",
outputType: 'json',
nodeParams: [
{ name: 'url', type: "input", input: "", disabled: true },
],
outputParams: [{ name: 'pageName', type: 'string', desc: '当前页面名称', disabled: true}]
}
],
},
{
collapseTitle: "语音交互",
nodeList: [
{
icon: planSvg,
name: "方案处理",
type: "serviceNode",
desc: "语音交互-方案处理,输入方案id(schemeId),输出唤醒语料(wakeCorpus)和测试语料数组(testCorpus)",
action: 'VI_SCHEME',
nodeParams: [{ name: 'schemeId', type: "input", input: "", disabled: true }],
outputType: 'json',
outputParams: [
{ name: 'wakeCorpus', type: 'object', desc: '唤醒语料', children: []},
{ name: 'testCorpus', type: 'array<object>', desc: '测试语料数组', children: []},
{ name: 'sceneType', type: 'number', desc: '1:唤醒测试,2:单次对话测试,3:连续对话测试', disabled: true }
]
},
{
icon: awakenSvg,
name: "唤醒语料",
type: "serviceNode",
desc: "唤醒语料处理,输入唤醒语料(wakeCorpus),输出语音路径(audioPath)",
action: 'VI_CORPUS_WAKE',
nodeType: "EDGE",
outputType: 'json',
nodeParams: [{ name: 'wakeCorpus', type: "input", input: "", disabled: true }],
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
},
{
icon: dialogueSvg,
name: "单次对话语料",
type: "serviceNode",
desc: "测试语料-单次对话语料处理,输入单次对话语料(testCorpus),输出语音路径(audioPath)",
action: 'VI_CORPUS_SINGLE',
nodeType: "EDGE",
outputType: 'json',
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
},
{
icon: dialogueSvg,
name: "连续对话语料",
type: "serviceNode",
desc: "测试语料-连续对话语料处理,输入连续对话语料(testCorpus),输出语音路径(audioPath)",
action: 'VI_CORPUS_CONTINUOUS',
nodeType: "EDGE",
outputType: 'json',
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
},
{
icon: audioSvg,
name: "播放语料",
type: "serviceNode",
desc: "用于播放语料的节点,需要输入语音路径,执行设备由流程角色配置",
action: 'VI_PLAY_CORPUS',
nodeType: "EDGE",
outputType: 'json',
nodeParams: [
{ name: 'audioPath', type: "input", input: "", disabled: true },
{ name: 'bioId', type: "input", input: "", disabled: true, required: false }
],
}
],
},
{
collapseTitle: "触控交互",
nodeList: [
{
icon: touchSvg,
name: "触控",
type: "serviceNode",
desc: "去触控坐标的点位",
action: 'TOUCH',
nodeType: "EDGE",
nodeParams: [
{ name: "touchParams", type: "input", input: "", disabled: true }
],
outputType: 'json',
},
{
icon: expressionSvg,
name: "开始说话",
type: "serviceNode",
desc: "控制机器人说话",
action: 'BIO_HEAD_SPEAK_START',
nodeType: "EDGE",
nodeParams: [],
outputType: 'json',
},
{
icon: expressionSvg,
name: "停止说话",
type: "serviceNode",
desc: "停止机器人说话",
action: 'BIO_HEAD_SPEAK_STOP',
nodeType: "EDGE",
nodeParams: [],
outputType: 'json',
},
{
icon: expressionSvg,
name: "表情",
type: "serviceNode",
desc: "控制机器人的面部表情",
action: 'BIO_HEAD_SPECIAL_EXPRESSION',
nodeType: "EDGE",
nodeParams: [
{ name: "expressKey", type: "input",componentType: 'select', selectOptions: expressOptions(), disabled: true },
],
outputType: 'json',
},
{
icon: touchSvg,
name: "路径搜索",
type: "serviceNode",
desc: "路径搜索",
action: 'TI_PATH_SEARCH',
nodeType: "EDGE",
nodeParams: [
{ name: "currentLocation", type: "input", input: "", disabled: true },
{ name: "funcId", type: "input", input: "", disabled: true },
{ name: "vehicleConfigId", type: "input", input: "", disabled: true },
],
outputType: 'json',
outputParams: [
{ name: 'nextLocation', type: 'string', desc: '下一路径位置', disabled: true},
{ name: 'isEnd', type: 'string', desc: '是否结束', disabled: true},
{ name: 'iconUrl', type: 'string', desc: '图标路径', disabled: true}
]
},
{
icon: touchSvg,
name: "获取触控二维坐标",
type: "serviceNode",
desc: "获取触控二维坐标",
action: 'TI_TOUCH_COORDINATES',
nodeType: "EDGE",
nodeParams: [
{ name: "imageUrl", type: "input", input: "", disabled: true },
{ name: "iconUrl", type: "input", input: "", disabled: true }
],
outputType: 'json',
outputParams: [
{ name: 'touchCoordinates', type: 'string', desc: '触控二维坐标', disabled: true},
]
}
],
},
{
collapseTitle: "AI评估",
nodeList: [
{
icon: expressionSvg,
name: "AI评估预处理",
type: "serviceNode",
desc: "AI评估预处理",
action: 'AI_EVALUATION_PRE',
nodeType: "AE",
nodeParams: [
{ name: "taskType", type: "input", input: "", componentType: 'select', selectOptions: taskTypeOptions(), disabled: true },
{ name: "wakeCorpus", type: "input", input: "", disabled: true, required: false },
{ name: "testCorpus", type: "input", input: "", disabled: true, required: false },
{ name: "sceneType", type: "input", input: "", disabled: true, required: false },
],
outputType: 'json',
},
{
icon: touchSvg,
name: "AI评估执行",
type: "serviceNode",
desc: "AI评估执行",
action: 'AI_EVALUATION_END',
nodeType: "AE",
nodeParams: [
{ name: "videoUrl", type: "input", input: "", disabled: true }
],
outputType: 'json',
}
],
},
]