diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx index 36d7f89d9f..947abb853d 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx @@ -61,7 +61,9 @@ const ChatItem: FC = ({ annotation_reply: features.annotationReply, } as ChatConfig }, [configTemplate, features]) - const inputsForm = modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] + const inputsForm = useMemo(() => { + return modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] + }, [modelConfig.configs.prompt_variables]) const { chatList, chatListRef, diff --git a/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx b/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx index 906a2032e5..2cbfe91f16 100644 --- a/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx +++ b/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx @@ -63,7 +63,9 @@ const DebugWithSingleModel = forwardRef item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] + const inputsForm = useMemo(() => { + return modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] + }, [modelConfig.configs.prompt_variables]) const { chatList, chatListRef,