From 8494f242d7d03eec820d9356916cd67cc02a79c0 Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 3 Aug 2026 16:41:33 +0800 Subject: [PATCH] Fix: In the model settings, setting the degree of freedom to 0 and then saving caused the DeepSeek model call to fail. (#17725) --- web/src/utils/form.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/src/utils/form.ts b/web/src/utils/form.ts index ca5cfc8880..12208ee3dd 100644 --- a/web/src/utils/form.ts +++ b/web/src/utils/form.ts @@ -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;