From 80fe0810cd025e01fa71e359a87ed1de348989b7 Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Mon, 6 Nov 2023 21:55:49 +0100 Subject: [PATCH] bug: fix wrong var used --- src/ai/AIAssistant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai/AIAssistant.ts b/src/ai/AIAssistant.ts index 7b8259e..d22ebf3 100644 --- a/src/ai/AIAssistant.ts +++ b/src/ai/AIAssistant.ts @@ -13,7 +13,7 @@ import { getModelMaxTokens } from "./getModelMaxTokens"; export const getTokenCount = (text: string, model: Model) => { // gpt-3.5-turbo-16k is a special case - it isn't in the library list yet. Same with gpt-4-1106-preview. let m = model === "gpt-3.5-turbo-16k" ? "gpt-3.5-turbo" : model; - m = model === "gpt-4-1106-preview" ? "gpt-4" : model; + m = m === "gpt-4-1106-preview" ? "gpt-4" : m; return encodingForModel(m).encode(text).length; };