Skip to main content

TokenEstimator

Protocol for records that can estimate their own token count.

Methods​


estimate_tokens()​

@classmethod
def estimate_tokens() -> int

Protocol for records that can estimate their own token count.

Returns​

TypeDescription
intThe calculated number of tokens representing the record's content, used for batching and rate-limiting.