PromptVault.TokenCounter behaviour (PromptVault v0.1.0)

View Source

Behaviour 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

t()

@type t() :: term()

Callbacks

count(model, content)

@callback count(model :: atom() | String.t(), content :: iodata()) :: non_neg_integer()

Counts tokens in the given content for the specified model.