fix: model changed but completion params not change

This commit is contained in:
jimmyfen 2025-03-19 10:07:27 +08:00 committed by GitHub
parent ac80c04bd3
commit e72a4a98f6
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}