Enable TokenHandler to return total token count

This commit is contained in:
maver 2023-06-10 20:10:16 +02:00
parent eb315993b4
commit 64c04957c2
1 changed files with 5 additions and 2 deletions

View File

@ -979,9 +979,12 @@ class TokenHandler {
return token_count;
}
getTotal() {
return Object.values(this.counts).reduce((a, b) => a + b);
}
log() {
const total = Object.values(this.counts).reduce((a, b) => a + b);
console.table({ ...this.counts, 'total': total });
console.table({ ...this.counts, 'total': this.getTotal() });
}
}