Versions in this module Expand all Collapse all v0 v0.1.0 Jul 18, 2026 Changes in this version + type Candidate struct + Bytes int + Strategy Strategy + Tokens int + type Encoding string + const EncodingCL100K + const EncodingO200K + type Estimator interface + Count func(text string) (int, error) + Name func() string + func NewTokenEstimator(encoding Encoding) (Estimator, error) + type Option func(*config) error + func WithEncoding(encoding Encoding) Option + func WithEstimator(estimator Estimator) Option + func WithProfile(profile Profile) Option + func WithSavingsThresholds(table, compactJSON float64) Option + func WithTableMinRows(rows int) Option + type Profile string + const ProfileBalanced + const ProfileJSON + const ProfileReadable + const ProfileTokens + type Renderer struct + func NewRenderer(options ...Option) (*Renderer, error) + func (r *Renderer) Render(value any) (Result, error) + func (r *Renderer) RenderJSON(data []byte) (Result, error) + type Result struct + Candidates []Candidate + Encoding string + Strategy Strategy + Text string + Tokens int + func RenderJSON(data []byte, options ...Option) (Result, error) + type Strategy string + const StrategyJSON + const StrategyOutline + const StrategyTable