From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +0800
Subject: [PATCH] 修改
---
app/components/workflow/nodes/question-classifier/panel.tsx | 64 +++++++-------------------------
1 files changed, 14 insertions(+), 50 deletions(-)
diff --git a/app/components/workflow/nodes/question-classifier/panel.tsx b/app/components/workflow/nodes/question-classifier/panel.tsx
index d2e0fb0..7d27a89 100644
--- a/app/components/workflow/nodes/question-classifier/panel.tsx
+++ b/app/components/workflow/nodes/question-classifier/panel.tsx
@@ -3,7 +3,6 @@
import { useTranslation } from 'react-i18next'
import VarReferencePicker from '../_base/components/variable/var-reference-picker'
import ConfigVision from '../_base/components/config-vision'
-import { findVariableWhenOnLLMVision } from '../utils'
import useConfig from './use-config'
import ClassList from './components/class-list'
import AdvancedSetting from './components/advanced-setting'
@@ -16,7 +15,6 @@
import Split from '@/app/components/workflow/nodes/_base/components/split'
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
import { FieldCollapse } from '@/app/components/workflow/nodes/_base/components/collapse'
-import type { Props as FormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form/form'
const i18nPrefix = 'workflow.nodes.questionClassifiers'
@@ -38,7 +36,6 @@
hasSetBlockStatus,
availableVars,
availableNodesWithParent,
- availableVisionVars,
handleInstructionChange,
inputVarValues,
varInputs,
@@ -54,56 +51,15 @@
handleStop,
runResult,
filterVar,
- visionFiles,
- setVisionFiles,
} = useConfig(id, data)
const model = inputs.model
- const singleRunForms = (() => {
- const forms: FormProps[] = []
-
- forms.push(
- {
- label: t('workflow.nodes.llm.singleRun.variable')!,
- inputs: [{
- label: t(`${i18nPrefix}.inputVars`)!,
- variable: 'query',
- type: InputVarType.paragraph,
- required: true,
- }, ...varInputs],
- values: inputVarValues,
- onChange: setInputVarValues,
- },
- )
-
- if (isVisionModel && data.vision?.enabled && data.vision?.configs?.variable_selector) {
- const currentVariable = findVariableWhenOnLLMVision(data.vision.configs.variable_selector, availableVisionVars)
-
- forms.push(
- {
- label: t('workflow.nodes.llm.vision')!,
- inputs: [{
- label: currentVariable?.variable as any,
- variable: '#files#',
- type: currentVariable?.formType as any,
- required: false,
- }],
- values: { '#files#': visionFiles },
- onChange: keyValue => setVisionFiles(keyValue['#files#']),
- },
- )
- }
-
- return forms
- })()
-
return (
<div className='pt-2'>
- <div className='space-y-4 px-4'>
+ <div className='px-4 space-y-4'>
<Field
title={t(`${i18nPrefix}.model`)}
- required
>
<ModelParameterModal
popupClassName='!w-[387px]'
@@ -122,7 +78,6 @@
</Field>
<Field
title={t(`${i18nPrefix}.inputVars`)}
- required
>
<VarReferencePicker
readonly={readOnly}
@@ -145,14 +100,12 @@
/>
<Field
title={t(`${i18nPrefix}.class`)}
- required
>
<ClassList
- nodeId={id}
+ id={id}
list={inputs.classes}
onChange={handleTopicsChange}
readonly={readOnly}
- filterVar={filterVar}
/>
</Field>
<Split />
@@ -190,7 +143,18 @@
<BeforeRunForm
nodeName={inputs.title}
onHide={hideSingleRun}
- forms={singleRunForms}
+ forms={[
+ {
+ inputs: [{
+ label: t(`${i18nPrefix}.inputVars`)!,
+ variable: 'query',
+ type: InputVarType.paragraph,
+ required: true,
+ }, ...varInputs],
+ values: inputVarValues,
+ onChange: setInputVarValues,
+ },
+ ]}
runningStatus={runningStatus}
onRun={handleRun}
onStop={handleStop}
--
Gitblit v1.8.0