Fix: In the model settings, setting the degree of freedom to 0 and then saving caused the DeepSeek model call to fail. (#17725)

This commit is contained in:
balibabu
2026-08-03 16:41:33 +08:00
committed by GitHub
parent 3b4a96d421
commit 8494f242d7

View File

@@ -1,6 +1,6 @@
import { variableEnabledFieldMap } from '@/constants/chat';
import { TFunction } from 'i18next';
import { camelCase } from 'lodash';
import { camelCase, isNil } from 'lodash';
import omit from 'lodash/omit';
// chat model setting and generate operator
@@ -55,11 +55,13 @@ export function setLLMSettingEnabledValues(
pre[field] =
initialLlmSetting === undefined
? false
: !!initialLlmSetting[
variableEnabledFieldMap[
field as keyof typeof variableEnabledFieldMap
]
];
: !isNil(
initialLlmSetting[
variableEnabledFieldMap[
field as keyof typeof variableEnabledFieldMap
]
],
);
return pre;
}, {});
return values;