Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ui/src/workflow-canvas/nodes/llm-node/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, inject, onMounted, ref, useTemplateRef } from 'vue'
import { computed, inject, nextTick, onMounted, ref, useTemplateRef } from 'vue'

import type { FormInstance } from 'element-plus'
import type { ModelItem, ModelProviderItem } from '@/api/types'
Expand Down Expand Up @@ -79,6 +79,10 @@ function updateNodeData(setting: Partial<LlmNodeForm>) {
model.properties.node_data = { ...formData.value, ...setting }
}

function handleContextEnabledChange(enabled: boolean) {
if (!enabled) void nextTick(() => formRef.value?.clearValidate('context_variable'))
}

async function validate() {
return formRef.value?.validate().catch((error) => Promise.reject({ node: model, errMessage: error }))
}
Expand Down Expand Up @@ -164,7 +168,7 @@ onMounted(() => {
<MkIcon name="icon_info_outlined" class="text-N600!" />
</MkTooltip>
</span>
<el-switch v-model="formData.enable_context" size="small" />
<el-switch v-model="formData.enable_context" size="small" @change="handleContextEnabledChange" />
</div>
</template>
<NodeCascader
Expand Down
Loading