PromptVault.TokenCounter behaviour (PromptVault v0.1.0)
View SourceBehaviour for token counting implementations.
Token counters are responsible for counting tokens in content for specific models. Implementations should handle both atom and string model names.
Summary
Callbacks
Counts tokens in the given content for the specified model.
Types
@type t() :: term()
Callbacks
@callback count(model :: atom() | String.t(), content :: iodata()) :: non_neg_integer()
Counts tokens in the given content for the specified model.