From 54355d5a7a142c8dd8d8cf29602b159f1a969a27 Mon Sep 17 00:00:00 2001 From: josc146 Date: Sat, 28 Oct 2023 23:06:19 +0800 Subject: [PATCH] improve the compatibility between frontend presets and chatgpt api --- frontend/src/pages/Chat.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Chat.tsx b/frontend/src/pages/Chat.tsx index 69398b2..53b6609 100644 --- a/frontend/src/pages/Chat.tsx +++ b/frontend/src/pages/Chat.tsx @@ -339,9 +339,9 @@ const ChatPanel: FC = observer(() => { model: commonStore.settings.apiChatModelName, // 'gpt-3.5-turbo' temperature: apiParams.temperature, top_p: apiParams.topP, - user_name: commonStore.activePreset?.userName, - assistant_name: commonStore.activePreset?.assistantName, - presystem: commonStore.activePreset?.presystem + user_name: commonStore.activePreset?.userName || undefined, + assistant_name: commonStore.activePreset?.assistantName || undefined, + presystem: commonStore.activePreset?.presystem && undefined }), signal: chatSseController?.signal, onmessage(e) {