From 9f92cf5c70143f4c186af648db3c111c26d5cd98 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sun, 19 Mar 2023 15:35:23 +0800 Subject: [PATCH] fix: max tokens bug --- src/hooks/useSubmit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useSubmit.ts b/src/hooks/useSubmit.ts index 28284ea..a798b9e 100644 --- a/src/hooks/useSubmit.ts +++ b/src/hooks/useSubmit.ts @@ -55,7 +55,7 @@ const useSubmit = () => { let stream; const messages = limitMessageTokens( chats[currentChatIndex].messages, - 4000 + chats[currentChatIndex].config.max_tokens ); if (messages.length === 0) throw new Error('Message exceed max token!');