Skip to content

Commit

Permalink
Merge branch 'feat/model-provider-based-on-runtime' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh committed Jan 2, 2024
2 parents 269bdca + 117eb06 commit 841b2f4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({

const handleChangeParams = () => {
const newCompletionParams = parameterRules.reduce((acc, parameter) => {
if (parameter.default !== undefined)
if (parameter.default !== undefined && completionParams[parameter.name] === undefined)
acc[parameter.name] = parameter.default

return acc
}, {} as Record<string, any>)

onCompletionParamsChange(newCompletionParams)
onCompletionParamsChange({
...completionParams,
...newCompletionParams,
})
}

useEffect(() => {
Expand Down

0 comments on commit 841b2f4

Please sign in to comment.