wujingjing
2024-12-23 dd407c5da58ca201a1fc91af028ace3a6491853b
输出参数名
已修改2个文件
13 ■■■■ 文件已修改
src/components/vue-flow/VueFlowHelper.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/LLMNode.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/VueFlowHelper.ts
@@ -66,6 +66,7 @@
                    description: '调用大模型回答用户问题或者处理任务。',
                };
                data[VueFlowConstant.GROUP_PARAMS_KEY] = [
                    {
                        name: '模型设置',
@@ -85,6 +86,10 @@
                        name: '提示词',
                        [VueFlowConstant.PARAMS_KEY]: [{ key: 'prompt', label: '', type: 'textarea', value: '' }],
                    },
                    {
                        name: '输出参数名',
                        [VueFlowConstant.PARAMS_KEY]: [{ key: 'key',  type: 'input', value: '' }],
                    },
                ];
                break;
                case NodeType.Analysis:
src/components/vue-flow/ui/nodes/LLMNode.vue
@@ -5,6 +5,9 @@
        :description="VueFlowHelper.getConfigValue(data, 'description', '调用大模型回答用户问题或者处理任务。')"
    >
        <Handle :id="targetHandleId" type="target" :position="Position.Left" />
        <FieldLayout :title="outputParam.name">
            <el-input  class="w-full flex-0" v-model="outputParam.params[0].value" placeholder="输出参数名"> </el-input>
        </FieldLayout>
        <FieldLayout :title="VueFlowHelper.getConfigValue(modelSetting, 'name', '模型设置')">
            <div class="w-[340px] flex-items-center gap-x-2">
                <div class="flex-column gap-y-1.5">
@@ -49,7 +52,7 @@
import type { NodeProps } from '@vue-flow/core';
import { VueFlowConstant } from '../../VueFlowConstant';
import { VueFlowHelper } from '../../VueFlowHelper';
import { LLMNodeData, LLMNodeEvents } from './index';
import type { LLMNodeData, LLMNodeEvents } from './index';
import { deepClone } from '/@/utils/other';
import { NodeType } from '../../vueFlowEnum';
@@ -63,9 +66,8 @@
const targetHandleId = ref(VueFlowHelper.getHandleId(node.node, 'target'));
const data = ref(node.node.data);
const modelSetting = ref(VueFlowHelper.getGroupParam(data.value, 0));
const prompt = ref(VueFlowHelper.getGroupParam(data.value, 1));
const outputParam = ref(VueFlowHelper.getGroupParam(data.value, 2));
VueFlowHelper.getConfigValue(VueFlowHelper.getParams(prompt.value, 'prompt'), 'label', '');
</script>