sessionCountTokens method
Token count of the whole conversation, or of text when given.
Implementation
@override
Future<int> sessionCountTokens(String sessionId, {String? text}) async {
final s = _session(sessionId);
return estimateTokens(
text ?? s.transcript.followedBy(s.pending).join('\n'),
);
}