diff --git a/src/views/flow/components/ParamsDrawer.vue b/src/views/flow/components/ParamsDrawer.vue index 5c76987..92088a6 100644 --- a/src/views/flow/components/ParamsDrawer.vue +++ b/src/views/flow/components/ParamsDrawer.vue @@ -38,6 +38,7 @@ import RecognizeNodeParams from './params/RecognizeNodeParams.vue' import DeviceUniversal from './params/DeviceUniversal.vue' import SwitchNodeParams from './params/SwitchNodeParams.vue' import ActionQueueParams from './params/ActionQueueParams.vue' +import MediaAnalysisParams from './params/MediaAnalysisParams.vue' const props = defineProps({ drawer: Boolean, @@ -65,6 +66,7 @@ const currentComponent = computed(() => { if (type === 'recognize') return RecognizeNodeParams if (['deviceUniversal', 'device_universal'].includes(type)) return DeviceUniversal if (type === 'actionQueue') return ActionQueueParams + if (type === 'mediaAnalysis') return MediaAnalysisParams if (type === 'branch') return SwitchNodeParams return null }) diff --git a/src/views/flow/components/params/MediaAnalysisParams.vue b/src/views/flow/components/params/MediaAnalysisParams.vue new file mode 100644 index 0000000..d25554f --- /dev/null +++ b/src/views/flow/components/params/MediaAnalysisParams.vue @@ -0,0 +1,244 @@ + + + + + {{ title }} + {{ description }} + + + + + + + + 场景决定识别标签、判断阈值和分析要求。 + + + + + + + + + + + + + + + + + + + + + 自动模式优先快速分析,结果不完整时自动切换精确分析。 + + + + 节点输出 + + + {{ item.name }} + {{ item.desc }} + + + + + + + + diff --git a/src/views/flow/config.js b/src/views/flow/config.js index 9f47e60..d3b5c85 100644 --- a/src/views/flow/config.js +++ b/src/views/flow/config.js @@ -492,6 +492,49 @@ function handler(params) { { 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: "audioUrl", type: "quote", input: "", quote: "", required: true, disabled: true }, + ], + outputType: "json", + outputParams: [ + { 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: "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: false, disabled: true }, + { name: "analysisMode", type: "input", input: "AUTO", required: false, disabled: true }, + ], + outputType: "json", + outputParams: [ + { name: "passed", type: "boolean", desc: "是否通过", disabled: true }, + { name: "conclusion", type: "string", desc: "分析结论", disabled: true }, + { name: "summary", type: "string", desc: "分析摘要", disabled: true }, + { name: "events", type: "array", desc: "关键事件", children: [], disabled: true }, + { name: "analysisMode", type: "string", desc: "实际分析模式", disabled: true }, + { name: "fallback", type: "boolean", desc: "是否切换精确分析", disabled: true }, + ], + }, { icon: microphoneSvg, name: "获取触控坐标", diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue index 7d45c71..1a25138 100644 --- a/src/views/flow/index.vue +++ b/src/views/flow/index.vue @@ -1066,7 +1066,7 @@ const validateSingleNodeParams = () => { ElMessage.warning("请输入参数名"); return false; } - if (param.input === "" || param.input === null || param.input === undefined) { + if ((param.input === "" || param.input === null || param.input === undefined) && param.required !== false) { ElMessage.warning(`请输入参数 ${param.name} 的值`); return false; }
{{ item.name }}