PhoenixAI.Store.Memory.TokenCounter behaviour (PhoenixAI.Store v0.1.0)

Copy Markdown View Source

Behaviour for counting tokens in message content.

Implementations provide a heuristic or API-based token count used by memory strategies to enforce token budgets.

Summary

Callbacks

count_tokens(content, opts)

@callback count_tokens(content :: String.t() | nil, opts :: keyword()) ::
  non_neg_integer()