From d2f86323683fb33195bf34a3aa2da37dfee4f637 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 23 Dec 2023 05:55:44 -0500 Subject: [PATCH] Remove populateLegacyTokenCounts Unused and the documentation says it should probably be removed --- public/scripts/PromptManager.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 094fe49cc..4e8fb84a8 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -1293,34 +1293,6 @@ class PromptManager { this.log('Updated token usage with ' + this.tokenUsage); } - /** - * Populates legacy token counts - * - * @deprecated This might serve no purpose and should be evaluated for removal - * - * @param {MessageCollection} messages - */ - populateLegacyTokenCounts(messages) { - // Update general token counts - const chatHistory = messages.getItemByIdentifier('chatHistory'); - const startChat = chatHistory?.getCollection()[0]?.getTokens() || 0; - const continueNudge = chatHistory?.getCollection().find(message => message.identifier === 'continueNudge')?.getTokens() || 0; - - this.tokenHandler.counts = { - ...this.tokenHandler.counts, - ...{ - 'start_chat': startChat, - 'prompt': 0, - 'bias': this.tokenHandler.counts.bias ?? 0, - 'nudge': continueNudge, - 'jailbreak': this.tokenHandler.counts.jailbreak ?? 0, - 'impersonate': 0, - 'examples': this.tokenHandler.counts.dialogueExamples ?? 0, - 'conversation': this.tokenHandler.counts.chatHistory ?? 0, - }, - }; - } - /** * Empties, then re-assembles the container containing the prompt list. */