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

This commit is contained in:
jimmyfen 2025-03-19 17:48:18 +08:00 committed by GitHub
parent b8ef3149ef
commit 425ea4e5b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}