sizeInTokens method

  1. @override
Future<int> sizeInTokens(
  1. String text
)
override

Implementation

@override
Future<int> sizeInTokens(String text) async {
  // Approximate token count (LiteRT-LM doesn't expose tokenizer directly)
  // Using ~4 chars per token as rough estimate
  return (text.length / 4).ceil();
}