PhoenixKitAgent.Schemas.LimitEvent (PhoenixKitAgent v0.1.0)

Copy Markdown View Source

A limit notice that was sent (phoenix_kit_agent_limit_events): at most one per user, kind and period (period_key is "2026-10-19" for a day, "2026-10" for a month), which is how a limit is announced once. A warn_80 row names its limit in the key — "cost:2026-10-19", "cost:2026-10", "turns:2026-10-19" — so each of the three limits warns once (PhoenixKitAgent.Limits); the watchers' event of a limit reached is keyed "w:<period>". used and limit are in the limit's own unit (micro-dollars or turns; none for ai_budget). user_uuid is set by the caller.

Summary

Functions

Builds a limit notice.

The kinds of limit notice.

Types

t()

@type t() :: %PhoenixKitAgent.Schemas.LimitEvent{
  __meta__: term(),
  inserted_at: term(),
  limit: term(),
  limit_kind: term(),
  notified_at: term(),
  period_key: term(),
  used: term(),
  user: term(),
  user_uuid: term(),
  uuid: term()
}

Functions

changeset(event, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Builds a limit notice.

kinds()

@spec kinds() :: [String.t()]

The kinds of limit notice.