Add elvis to getTokens when populating legacy context.

This commit is contained in:
maver 2023-08-20 19:46:46 +02:00
parent 7676409197
commit ea72584f39
1 changed files with 1 additions and 1 deletions

View File

@ -1194,7 +1194,7 @@ PromptManagerModule.prototype.populateTokenCounts = function (messages) {
PromptManagerModule.prototype.populateLegacyTokenCounts = function (messages) {
// Update general token counts
const chatHistory = messages.getItemByIdentifier('chatHistory');
const startChat = chatHistory?.getCollection()[0].getTokens() || 0;
const startChat = chatHistory?.getCollection()[0]?.getTokens() || 0;
const continueNudge = chatHistory?.getCollection().find(message => message.identifier === 'continueNudge')?.getTokens() || 0;
this.tokenHandler.counts = {