PhoenixAI.Store.Guardrails.TokenBudget (PhoenixAI.Store v0.1.0)

Copy Markdown View Source

Guardrail policy that enforces token budgets scoped to conversations, users, or time windows.

This is a stateful policy that reads accumulated token counts from the store adapter. The adapter must implement the PhoenixAI.Store.Adapter.TokenUsage sub-behaviour.

Options

Assigns

The policy expects request.assigns to contain:

  • :adapter — the adapter module
  • :adapter_opts — keyword options for the adapter

These are injected by PhoenixAI.Store.check_guardrails/3.