From 4e1d9e9db857e2642914a794f5749df8f9fa66e5 Mon Sep 17 00:00:00 2001 From: amlxv Date: Wed, 22 Mar 2023 17:40:29 +0800 Subject: [PATCH] Fix typos. --- src/routes/ChatRoute.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/ChatRoute.tsx b/src/routes/ChatRoute.tsx index 3e712ef..4cba4e0 100644 --- a/src/routes/ChatRoute.tsx +++ b/src/routes/ChatRoute.tsx @@ -132,7 +132,7 @@ export function ChatRoute() { const messages = await db.messages .where({ chatId }) .sortBy("createdAt"); - const createChatDscription = await createChatCompletion(apiKey, [ + const createChatDescription = await createChatCompletion(apiKey, [ { role: "system", content: getSystemMessage(), @@ -148,15 +148,15 @@ export function ChatRoute() { }, ]); const chatDescription = - createChatDscription.data.choices[0].message?.content; + createChatDescription.data.choices[0].message?.content; - if (createChatDscription.data.usage) { + if (createChatDescription.data.usage) { await db.chats.where({ id: chatId }).modify((chat) => { chat.description = chatDescription ?? "New Chat"; if (chat.totalTokens) { - chat.totalTokens += createChatDscription.data.usage!.total_tokens; + chat.totalTokens += createChatDescription.data.usage!.total_tokens; } else { - chat.totalTokens = createChatDscription.data.usage!.total_tokens; + chat.totalTokens = createChatDescription.data.usage!.total_tokens; } }); }