needsCompression static method

Future<bool> needsCompression({
  1. required String text,
  2. int tokenThreshold = 2000,
})

Check if text needs compression based on token estimate.

Returns true if estimated tokens exceed threshold.

Implementation

static Future<bool> needsCompression({
  required String text,
  int tokenThreshold = 2000,
}) async {
  return rust.shouldCompress(text: text, tokenThreshold: tokenThreshold);
}