Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: model changed but completion params not change (#16156)

jimmyfen425ea4e5b60d
diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx
index b99d7184968..c655188536e 100644
--- a/web/app/components/workflow/nodes/llm/panel.tsx
+++ b/web/app/components/workflow/nodes/llm/panel.tsx
@@ -124,6 +124,16 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
return forms
})()
+ const handleModelChange = useCallback((model: {
+ provider: string
+ modelId: string
+ mode?: string
+ }) => {
+ handleCompletionParamsChange({})
+ handleModelChanged(model)
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [])
+
return (
<div className='mt-2'>
<div className='px-4 pb-4 space-y-4'>
@@ -138,7 +148,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
provider={model?.provider}
completionParams={model?.completion_params}
modelId={model?.name}
- setModel={handleModelChanged}
+ setModel={handleModelChange}
onCompletionParamsChange={handleCompletionParamsChange}
hideDebugWithMultipleModel
debugWithMultipleModel={false}