From 7abe76f07eb9d0a6bb78b5ea71aa20449bac5471 Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Wed, 9 Oct 2024 17:24:43 +0800 Subject: [PATCH] fix: basic chat --- .../debug/debug-with-multiple-model/chat-item.tsx | 4 +++- .../app/configuration/debug/debug-with-single-model/index.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 36d7f89d9f37e2..947abb853d6dc2 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 906a2032e562ae..2cbfe91f169d4b 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,