import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import MemoryConfig from '../_base/components/memory-config' import VarReferencePicker from '../_base/components/variable/var-reference-picker' import Editor from '../_base/components/prompt/editor' import ResultPanel from '../../run/result-panel' import ConfigVision from '../_base/components/config-vision' import useConfig from './use-config' import type { ParameterExtractorNodeType } from './types' import ExtractParameter from './components/extract-parameter/list' import ImportFromTool from './components/extract-parameter/import-from-tool' import AddExtractParameter from './components/extract-parameter/update' import ReasoningModePicker from './components/reasoning-mode-picker' import Field from '@/app/components/workflow/nodes/_base/components/field' import Split from '@/app/components/workflow/nodes/_base/components/split' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import { InputVarType, type NodePanelProps } from '@/app/components/workflow/types' import Tooltip from '@/app/components/base/tooltip' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' import { VarType } from '@/app/components/workflow/types' const i18nPrefix = 'workflow.nodes.parameterExtractor' const i18nCommonPrefix = 'workflow.common' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const { readOnly, inputs, handleInputVarChange, filterVar, isChatModel, isChatMode, isCompletionModel, handleModelChanged, handleImportFromTool, handleCompletionParamsChange, addExtractParameter, handleExactParamsChange, handleInstructionChange, hasSetBlockStatus, handleMemoryChange, isSupportFunctionCall, handleReasoningModeChange, availableVars, availableNodesWithParent, inputVarValues, varInputs, isVisionModel, handleVisionResolutionChange, handleVisionResolutionEnabledChange, isShowSingleRun, hideSingleRun, runningStatus, handleRun, handleStop, runResult, setInputVarValues, } = useConfig(id, data) const model = inputs.model return (
<> {!readOnly && ( )} {!readOnly && (
)}
) : undefined } > {t(`${i18nPrefix}.instruction`)} {t(`${i18nPrefix}.instructionTip`)}
} triggerClassName='w-3.5 h-3.5 ml-0.5' /> } value={inputs.instruction} onChange={handleInstructionChange} readOnly={readOnly} isChatModel={isChatModel} isChatApp={isChatMode} isShowContext={false} hasSetBlockStatus={hasSetBlockStatus} nodesOutputVars={availableVars} availableNodes={availableNodesWithParent} /> <> {/* Memory */} {isChatMode && (
)} {isSupportFunctionCall && (
)}
{inputs.parameters?.length > 0 && (<>
<> {inputs.parameters.map((param, index) => ( ))}
)} {isShowSingleRun && ( } /> )} ) } export default React.memo(Panel)