Package com.tnsai.reasoning
Class TokenEstimator
java.lang.Object
com.tnsai.reasoning.TokenEstimator
Rough token count estimator for text content.
Uses the ~4 characters per token heuristic for English text. Suitable for budget estimation and context window management, not for precise billing calculations.
-
Method Summary
-
Method Details
-
estimate
Estimates token count from text length.- Parameters:
text- the text to estimate- Returns:
- estimated token count, 0 if text is null or empty
-