diff --git a/web/app/components/workflow/nodes/llm/components/tools/index.tsx b/web/app/components/workflow/nodes/llm/components/tools/index.tsx index 2eb4fd5869..285eab86a9 100644 --- a/web/app/components/workflow/nodes/llm/components/tools/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/tools/index.tsx @@ -10,11 +10,13 @@ type ToolsProps = { nodeId: string tools?: ToolValue[] maxIterations?: number + hideMaxIterations?: boolean } const Tools = ({ nodeId, tools = [], maxIterations = 10, + hideMaxIterations = false, }: ToolsProps) => { const { t } = useTranslation() const { @@ -42,10 +44,12 @@ const Tools = ({ onChange={handleToolsChange} supportCollapse /> - + {!hideMaxIterations && ( + + )} ) } diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 9d336d25b4..63c59d29dc 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -10,6 +10,7 @@ import Switch from '@/app/components/base/switch' import Toast from '@/app/components/base/toast' import Tooltip from '@/app/components/base/tooltip' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' +import { FieldCollapse } from '@/app/components/workflow/nodes/_base/components/collapse' import Field from '@/app/components/workflow/nodes/_base/components/field' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import Editor from '@/app/components/workflow/nodes/_base/components/prompt/editor' @@ -23,6 +24,8 @@ import ConfigPrompt from './components/config-prompt' import ReasoningFormatConfig from './components/reasoning-format-config' import StructureOutput from './components/structure-output' import Tools from './components/tools' +import MaxIterations from './components/tools/max-iterations' +import { useNodeTools } from './components/tools/use-node-tools' import useConfig from './use-config' const i18nPrefix = 'nodes.llm' @@ -67,6 +70,10 @@ const Panel: FC> = ({ handleReasoningFormatChange, } = useConfig(id, data) + const { + handleMaxIterationsChange, + } = useNodeTools(id) + const model = inputs.model const handleModelChange = useCallback((model: { @@ -118,26 +125,6 @@ const Panel: FC> = ({ /> - {/* knowledge */} - - <> - - {shouldShowContextTip && ( -
{t(`${i18nPrefix}.notSetContextInPromptTip`, { ns: 'workflow' })}
- )} - -
- {/* Prompt */} {model.name && ( > = ({ nodeId={id} tools={inputs.tools} maxIterations={inputs.max_iterations} + hideMaxIterations /> - {/* Vision: GPT4-vision and so on */} - + {/* Advanced Settings - 折叠区 */} + +
+ {/* Context */} + + <> + + {shouldShowContextTip && ( +
{t(`${i18nPrefix}.notSetContextInPromptTip`, { ns: 'workflow' })}
+ )} + +
- {/* Reasoning Format */} - + {/* Vision: GPT4-vision and so on */} + + + {/* Max Iterations */} + + + {/* Reasoning Format */} + +
+