mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Enable TokenHandler to return total token count
This commit is contained in:
@ -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() });
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user