Remove populateLegacyTokenCounts

Unused and the documentation says it should probably be removed
This commit is contained in:
valadaptive 2023-12-23 05:55:44 -05:00
parent f53e051cbf
commit d2f8632368
1 changed files with 0 additions and 28 deletions

View File

@ -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.
*/