mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove populateLegacyTokenCounts
Unused and the documentation says it should probably be removed
This commit is contained in:
@ -1293,34 +1293,6 @@ class PromptManager {
|
|||||||
this.log('Updated token usage with ' + this.tokenUsage);
|
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.
|
* Empties, then re-assembles the container containing the prompt list.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user