2025-09-03 09:16:13 +08:00
|
|
|
|
import { Group, SelectionSelect } from "@logicflow/extension";
|
|
|
|
|
|
import { registerCommon } from "./nodes/common/index";
|
|
|
|
|
|
|
|
|
|
|
|
import { registerFunction } from './nodes/function'
|
|
|
|
|
|
|
|
|
|
|
|
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 startSvg from './icon/start.svg'
|
|
|
|
|
|
import endSvg from './icon/end.svg'
|
|
|
|
|
|
import microphoneSvg from './icon/microphone.svg'
|
|
|
|
|
|
import sleepSvg from './icon/sleep.svg'
|
2025-09-22 15:42:11 +08:00
|
|
|
|
import planSvg from './icon/plan.svg'
|
|
|
|
|
|
import awakenSvg from './icon/awaken.svg'
|
|
|
|
|
|
import dialogueSvg from './icon/dialogue.svg'
|
|
|
|
|
|
import audioSvg from './icon/audio.svg'
|
2025-11-10 17:22:23 +08:00
|
|
|
|
import touchSvg from './icon/touch.svg'
|
2025-11-13 21:55:20 +08:00
|
|
|
|
import expressionSvg from './icon/expression.svg'
|
2025-09-03 09:16:13 +08:00
|
|
|
|
|
|
|
|
|
|
import { v4 as randomUUID } from 'uuid'
|
|
|
|
|
|
|
|
|
|
|
|
export const lfConfig = {
|
|
|
|
|
|
idGenerator: () => {
|
|
|
|
|
|
// 生成标准UUID并移除连字符
|
|
|
|
|
|
// return crypto.randomUUID().replace(/-/g, '');
|
|
|
|
|
|
return randomUUID().replace(/-/g, '')
|
|
|
|
|
|
},
|
|
|
|
|
|
background: {
|
|
|
|
|
|
backgroundColor: "#f6f8fa",
|
|
|
|
|
|
},
|
|
|
|
|
|
grid: false,
|
|
|
|
|
|
plugins: [Group, SelectionSelect],
|
|
|
|
|
|
animation: true,
|
|
|
|
|
|
adjustEdgeStartAndEnd: false,
|
|
|
|
|
|
// multipleSelectKey: "ctrl",
|
|
|
|
|
|
// disabledTools: ["multipleSelect"],
|
|
|
|
|
|
partial: true,
|
|
|
|
|
|
// group: {
|
|
|
|
|
|
// foldable: true, // 启用折叠功能
|
|
|
|
|
|
// foldSize: 30, // 折叠后显示的图标尺寸
|
|
|
|
|
|
// },
|
|
|
|
|
|
edgeType: "bezier",
|
2025-11-17 14:54:32 +08:00
|
|
|
|
zoomConfig: {
|
|
|
|
|
|
min: 0.05, // 最小缩放比例(支持更小值,如 0.01,但不建议过小)
|
|
|
|
|
|
max: 3, // 最大缩放比例(可自定义)
|
|
|
|
|
|
step: 0.1 // 每次滚轮缩放的步长(默认 0.1)
|
|
|
|
|
|
},
|
2025-09-03 09:16:13 +08:00
|
|
|
|
style: {
|
|
|
|
|
|
anchor: {
|
|
|
|
|
|
show: true, // 强制全局锚点显示
|
|
|
|
|
|
hoverOn: false,
|
|
|
|
|
|
visibility: "visible",
|
|
|
|
|
|
fill: "#FF5722", // 实心绿色
|
|
|
|
|
|
stroke: "#FF5722", // 边框同色
|
|
|
|
|
|
strokeWidth: 0, // 消除边框
|
|
|
|
|
|
r: 7, // 锚点半径
|
|
|
|
|
|
hover: { fill: "#FF5722" }, // 禁用悬停变色
|
|
|
|
|
|
},
|
|
|
|
|
|
anchorLine: {
|
|
|
|
|
|
stroke: "#FF5722",
|
|
|
|
|
|
strokeWidth: 2,
|
|
|
|
|
|
strokeDasharray: "3,2",
|
|
|
|
|
|
},
|
|
|
|
|
|
bezier: {
|
|
|
|
|
|
stroke: "#FF5722",
|
|
|
|
|
|
strokeWidth: 2,
|
|
|
|
|
|
arrow: false, // 关闭箭头显示
|
|
|
|
|
|
animation: true, // 开启动画效果
|
|
|
|
|
|
animationSpeed: 3,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 注册自定义节点
|
|
|
|
|
|
export const registerCustomizeNode = (lf) => {
|
|
|
|
|
|
registerCommon(lf)
|
|
|
|
|
|
registerFunction(lf)
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const deviceOptions = () => {
|
2025-11-13 21:55:20 +08:00
|
|
|
|
return [{
|
|
|
|
|
|
value: 'cam1',
|
|
|
|
|
|
label: 'cam1'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'cam2',
|
|
|
|
|
|
label: 'cam2'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'cam3',
|
|
|
|
|
|
label: 'cam3'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'cam4',
|
|
|
|
|
|
label: 'cam4'
|
|
|
|
|
|
}]
|
2025-09-03 09:16:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const audioOptions = () => {
|
2025-11-13 21:55:20 +08:00
|
|
|
|
return [{
|
|
|
|
|
|
value: 'spk1',
|
|
|
|
|
|
label: 'spk1'
|
|
|
|
|
|
}]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-03 15:31:34 +08:00
|
|
|
|
const httpMethodOptions = () => {
|
|
|
|
|
|
return [{
|
|
|
|
|
|
value: 'POST',
|
|
|
|
|
|
label: 'POST'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'GET',
|
|
|
|
|
|
label: 'GET'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'PUT',
|
|
|
|
|
|
label: 'PUT'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'DELETE',
|
|
|
|
|
|
label: 'DELETE'
|
|
|
|
|
|
}]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-13 21:55:20 +08:00
|
|
|
|
const expressOptions = () => {
|
|
|
|
|
|
return [{
|
|
|
|
|
|
value: 1,
|
|
|
|
|
|
label: '高兴'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 2,
|
|
|
|
|
|
label: '惊讶'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 3,
|
2025-12-05 13:33:46 +08:00
|
|
|
|
label: '愤怒'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 4,
|
|
|
|
|
|
label: '悲伤'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 5,
|
|
|
|
|
|
label: '睡觉'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 6,
|
|
|
|
|
|
label: '打哈欠'
|
2025-11-13 21:55:20 +08:00
|
|
|
|
}]
|
2025-09-03 09:16:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-13 15:20:51 +08:00
|
|
|
|
const taskTypeOptions = () => {
|
|
|
|
|
|
return [{
|
|
|
|
|
|
value: 'voice',
|
|
|
|
|
|
label: '语音交互'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
value: 'touch',
|
|
|
|
|
|
label: '触控交互'
|
|
|
|
|
|
}]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-03 16:26:05 +08:00
|
|
|
|
const voiceOptions = () => {
|
|
|
|
|
|
return [{
|
|
|
|
|
|
value: 'x4_xiaoyan',
|
|
|
|
|
|
label: 'x4_xiaoyan'
|
|
|
|
|
|
}]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-03 09:16:13 +08:00
|
|
|
|
export const collapseList = [
|
|
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "相机",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: cameraSvg,
|
|
|
|
|
|
name: "开启相机",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "在获取相机照片时,需要先启动相机",
|
|
|
|
|
|
action: 'CAMERA_START',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: cameraSvg,
|
|
|
|
|
|
name: "获取图片",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "获取相机拍摄的照片",
|
|
|
|
|
|
action: 'CAMERA_GETRGBIMAGE',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'img',
|
2025-09-22 15:42:11 +08:00
|
|
|
|
outputParams: [{ name: 'imageUrl', type: 'array<string>', desc: '图片地址数组', children: [], disabled: true }]
|
2025-09-03 09:16:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: cameraSvg,
|
|
|
|
|
|
name: "关闭相机",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "获取相机照片后,关闭该相机",
|
|
|
|
|
|
action: 'CAMERA_STOP',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "录像",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: videoSvg,
|
|
|
|
|
|
name: "开启录像",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "开启摄像头,并开始录像",
|
|
|
|
|
|
action: 'CAMERA_RECORDING_START',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: videoSvg,
|
|
|
|
|
|
name: "结束录像",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "停止录像,并关闭摄像头",
|
|
|
|
|
|
action: 'CAMERA_RECORDING_STOP',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'video',
|
2026-03-17 16:30:40 +08:00
|
|
|
|
outputParams: [{ name: 'videoUrl', type: 'array<string>', children: [], desc: '视频播放地址数组', disabled: true}]
|
2025-09-03 09:16:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "功能",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: loopSvg,
|
|
|
|
|
|
name: "循环",
|
|
|
|
|
|
type: "loop",
|
|
|
|
|
|
action: 'START_LOOP',
|
|
|
|
|
|
desc: "实现对列表对象循环执行一系列任务",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
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: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
2026-02-03 15:31:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
icon: expressionSvg,
|
|
|
|
|
|
name: "HTTP请求",
|
2026-02-04 13:43:49 +08:00
|
|
|
|
type: "http",
|
2026-02-03 15:31:34 +08:00
|
|
|
|
desc: "HTTP请求",
|
|
|
|
|
|
action: 'HTTP',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ 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 },
|
|
|
|
|
|
{ name: "headers", type: "input", input: "", disabled: true, required: false },
|
|
|
|
|
|
{ name: "body", type: "input", input: "", disabled: true, required: true },
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
2026-03-17 16:30:40 +08:00
|
|
|
|
outputParams: [{ name: 'result', type: 'Object', children: [], desc: 'HTTP请求结果', disabled: true}]
|
2026-03-04 14:41:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: expressionSvg,
|
|
|
|
|
|
name: "代码",
|
|
|
|
|
|
type: "code",
|
|
|
|
|
|
desc: "js代码",
|
|
|
|
|
|
action: 'CODE',
|
|
|
|
|
|
canAddFormItem: true,
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "input", type: "input", input: "", required: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
2026-03-17 16:30:40 +08:00
|
|
|
|
outputParams: [{ name: 'ret', type: 'Object', children: [], desc: 'js节点返回', disabled: true}]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: microphoneSvg,
|
|
|
|
|
|
name: "获取当前循环对象",
|
|
|
|
|
|
type: "currentLoop",
|
|
|
|
|
|
desc: "获取当前循环对象",
|
|
|
|
|
|
action: 'GET_CURRENT_OBJECT',
|
|
|
|
|
|
nodeType: 'getCurrentObject',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "array", type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
outputParams: [
|
|
|
|
|
|
{ name: 'index', type: 'number', desc: '索引', disabled: true},
|
|
|
|
|
|
{ name: 'object', type: 'Object', children: [], desc: '当前循环对象', disabled: true}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2025-09-03 09:16:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "机器人",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: videoSvg,
|
|
|
|
|
|
name: "机械臂",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "控制机器人的手臂",
|
|
|
|
|
|
action: 'ALM',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "音频",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: microphoneSvg,
|
|
|
|
|
|
name: "启动麦克风",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "用于启动麦克风的节点",
|
|
|
|
|
|
action: 'MICROPHONE_START',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
2026-01-30 14:53:55 +08:00
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: audioOptions(), disabled: true }
|
2025-09-03 09:16:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: microphoneSvg,
|
|
|
|
|
|
name: "停止麦克风",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "用于停止麦克风的节点",
|
2026-02-03 09:41:33 +08:00
|
|
|
|
action: 'MICROPHONE_STOP',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: 'EDGE',
|
2025-09-03 09:16:13 +08:00
|
|
|
|
nodeParams: [
|
2026-01-30 14:53:55 +08:00
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: audioOptions(), disabled: true }
|
2025-09-03 09:16:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-09-22 15:42:11 +08:00
|
|
|
|
icon: audioSvg,
|
2026-01-13 15:20:51 +08:00
|
|
|
|
name: "播放音频",
|
2025-09-03 09:16:13 +08:00
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "用于播放音频的节点",
|
|
|
|
|
|
action: 'SPEAKER_PLAYAUDIO',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: audioOptions(), disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json'
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2025-09-19 14:16:28 +08:00
|
|
|
|
{
|
2025-09-03 09:16:13 +08:00
|
|
|
|
collapseTitle: "大模型",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: microphoneSvg,
|
|
|
|
|
|
name: "获取触控坐标",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "用于获取触控坐标的节点",
|
|
|
|
|
|
action: 'TOUCH_COORDINATES',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "LLM",
|
2025-09-03 09:16:13 +08:00
|
|
|
|
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',
|
2026-03-17 16:30:40 +08:00
|
|
|
|
outputParams: [{ name: 'coordinates', type: 'Object', children: [], desc: '坐标对象', disabled: true}]
|
2025-09-29 17:39:35 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
icon: dialogueSvg,
|
|
|
|
|
|
name: "tts语音合成",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "将指令文本(text)处理合成语音,输出语音路径(audioPath)",
|
|
|
|
|
|
action: 'GENERATE_ADVANCED_AUDIO',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "LLM",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
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',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "LLM",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }],
|
|
|
|
|
|
outputParams: [{ name: 'type', type: 'string', desc: '1:语音交互 2:触控交互 3: 闲聊 4:知识问答', disabled: true}]
|
2026-03-03 15:50:33 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
icon: dialogueSvg,
|
|
|
|
|
|
name: "商道智能体",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "通过apiKey调用商道大模型",
|
|
|
|
|
|
action: 'AI_AGENT_PLATFORM',
|
|
|
|
|
|
nodeType: "LLM",
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: 'apiKey', type: "input", input: "", disabled: true },
|
|
|
|
|
|
{ name: 'text', type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputParams: [{ name: 'result', type: 'string', desc: '商道大模型的返回文案', disabled: true}]
|
2026-03-03 16:26:05 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
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 }
|
|
|
|
|
|
]
|
2025-09-29 17:39:35 +08:00
|
|
|
|
}
|
2025-09-03 09:16:13 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
2025-09-19 14:16:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "语音交互",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
2025-09-22 15:42:11 +08:00
|
|
|
|
icon: planSvg,
|
|
|
|
|
|
name: "方案处理",
|
|
|
|
|
|
type: "serviceNode",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
desc: "语音交互-方案处理,输入方案id(schemeId),输出唤醒语料(wakeCorpus)和测试语料数组(testCorpus)",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
action: 'VI_SCHEME',
|
|
|
|
|
|
nodeParams: [{ name: 'schemeId', type: "input", input: "", disabled: true }],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
outputParams: [
|
|
|
|
|
|
{ name: 'wakeCorpus', type: 'object', desc: '唤醒语料', children: [], disabled: true},
|
2026-01-13 15:20:51 +08:00
|
|
|
|
{ name: 'testCorpus', type: 'array<object>', desc: '测试语料数组', children: [], disabled: true},
|
|
|
|
|
|
{ name: 'sceneType', type: 'number', desc: '1:唤醒测试,2:单次对话测试,3:连续对话测试', disabled: true }
|
2025-09-22 15:42:11 +08:00
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: awakenSvg,
|
2025-09-19 14:16:28 +08:00
|
|
|
|
name: "唤醒语料",
|
|
|
|
|
|
type: "serviceNode",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
desc: "唤醒语料处理,输入唤醒语料(wakeCorpus),输出语音路径(audioPath)",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
action: 'VI_CORPUS_WAKE',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
nodeParams: [{ name: 'wakeCorpus', type: "input", input: "", disabled: true }],
|
|
|
|
|
|
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: dialogueSvg,
|
|
|
|
|
|
name: "单次对话语料",
|
|
|
|
|
|
type: "serviceNode",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
desc: "测试语料-单次对话语料处理,输入单次对话语料(testCorpus),输出语音路径(audioPath)",
|
2025-09-24 08:59:23 +08:00
|
|
|
|
action: 'VI_CORPUS_SINGLE',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
|
|
|
|
|
|
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: dialogueSvg,
|
|
|
|
|
|
name: "连续对话语料",
|
|
|
|
|
|
type: "serviceNode",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
desc: "测试语料-连续对话语料处理,输入连续对话语料(testCorpus),输出语音路径(audioPath)",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
action: 'VI_CORPUS_CONTINUOUS',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-09-19 14:16:28 +08:00
|
|
|
|
outputType: 'json',
|
2025-09-22 15:42:11 +08:00
|
|
|
|
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
|
|
|
|
|
|
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
2025-09-19 14:16:28 +08:00
|
|
|
|
},
|
2025-09-22 15:42:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
icon: audioSvg,
|
|
|
|
|
|
name: "播放语料",
|
|
|
|
|
|
type: "serviceNode",
|
2025-09-29 17:39:35 +08:00
|
|
|
|
desc: "用于播放语料的节点,需要输入语音路径(audioPath)和播放语音的设备id(deviceId)",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
action: 'VI_PLAY_CORPUS',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-09-22 15:42:11 +08:00
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: 'audioPath', type: "input", input: "", disabled: true },
|
|
|
|
|
|
{ name: 'deviceId', type: "input", input: "", disabled: true },
|
2025-12-05 13:33:46 +08:00
|
|
|
|
{ name: 'bioId', type: "input", input: "", disabled: true, required: false }
|
2025-09-22 15:42:11 +08:00
|
|
|
|
],
|
|
|
|
|
|
}
|
2025-09-19 14:16:28 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
2025-11-10 17:22:23 +08:00
|
|
|
|
{
|
|
|
|
|
|
collapseTitle: "触控交互",
|
|
|
|
|
|
nodeList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: touchSvg,
|
|
|
|
|
|
name: "触控",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "去触控坐标的点位",
|
|
|
|
|
|
action: 'TOUCH',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-11-10 17:22:23 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", disabled: true },
|
|
|
|
|
|
{ name: "touchParams", type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
2025-11-13 21:55:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: expressionSvg,
|
|
|
|
|
|
name: "开始说话",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "控制机器人说话",
|
|
|
|
|
|
action: 'BIO_HEAD_SPEAK_START',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-11-13 21:55:20 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: expressionSvg,
|
|
|
|
|
|
name: "停止说话",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "停止机器人说话",
|
|
|
|
|
|
action: 'BIO_HEAD_SPEAK_STOP',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-11-13 21:55:20 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", disabled: true }
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: expressionSvg,
|
|
|
|
|
|
name: "表情",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "控制机器人的面部表情",
|
|
|
|
|
|
action: 'BIO_HEAD_SPECIAL_EXPRESSION',
|
2025-11-17 17:32:33 +08:00
|
|
|
|
nodeType: "EDGE",
|
2025-11-13 21:55:20 +08:00
|
|
|
|
nodeParams: [
|
|
|
|
|
|
{ name: "deviceId", type: "input", input: "", disabled: true },
|
|
|
|
|
|
{ name: "expressKey", type: "input",componentType: 'select', selectOptions: expressOptions(), disabled: true },
|
|
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
},
|
2026-02-03 17:36:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
icon: touchSvg,
|
|
|
|
|
|
name: "路径搜索",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "路径搜索",
|
|
|
|
|
|
action: 'TI_PATH_SEARCH',
|
2026-02-04 11:37:11 +08:00
|
|
|
|
nodeType: "EDGE",
|
2026-02-03 17:36:41 +08:00
|
|
|
|
nodeParams: [
|
2026-02-04 08:48:31 +08:00
|
|
|
|
{ name: "currentLocation", type: "input", input: "", disabled: true },
|
|
|
|
|
|
{ name: "funcId", type: "input", input: "", disabled: true }
|
2026-02-03 17:36:41 +08:00
|
|
|
|
],
|
|
|
|
|
|
outputType: 'json',
|
|
|
|
|
|
outputParams: [
|
|
|
|
|
|
{ name: 'nextLocation', type: 'string', desc: '下一路径位置', disabled: true},
|
2026-02-04 08:48:31 +08:00
|
|
|
|
{ name: 'isEnd', type: 'string', desc: '是否结束', disabled: true},
|
|
|
|
|
|
{ name: 'iconUrl', type: 'string', desc: '图标路径', disabled: true}
|
2026-02-03 17:36:41 +08:00
|
|
|
|
]
|
2026-02-04 09:26:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
icon: touchSvg,
|
|
|
|
|
|
name: "获取触控二维坐标",
|
|
|
|
|
|
type: "serviceNode",
|
|
|
|
|
|
desc: "获取触控二维坐标",
|
|
|
|
|
|
action: 'TI_TOUCH_COORDINATES',
|
2026-02-04 11:37:11 +08:00
|
|
|
|
nodeType: "EDGE",
|
2026-02-04 09:26:00 +08:00
|
|
|
|
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},
|
|
|
|
|
|
]
|
2026-02-03 17:36:41 +08:00
|
|
|
|
}
|
2025-11-10 17:22:23 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
2026-01-13 15:20:51 +08:00
|
|
|
|
{
|
|
|
|
|
|
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',
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2025-09-03 09:16:13 +08:00
|
|
|
|
]
|