Skip to main content

Module token_counting

Module token_counting 

Source
Expand description

Token counting utilities for context management.

Provides both approximate (character-based) and accurate (tiktoken-based) token estimation for message lists.

Structs§

CharApproxCounter
Approximate token counter using the 4-characters ≈ 1-token heuristic.

Traits§

TokenCounter
Trait for pluggable token counting backends.