Baton.StepStat (Baton v0.1.0)

Copy Markdown View Source

Ecto schema for per-step LLM usage stats.

One row per job execution (not per attempt — retries that hit the idempotency cache are recorded with from_cache: true and zero token counts).

Summary

Types

t()

@type t() :: %Baton.StepStat{
  __meta__: term(),
  attempt: integer(),
  cache_read_tokens: integer() | nil,
  cache_write_tokens: integer() | nil,
  cost_usd: Decimal.t() | nil,
  from_cache: boolean(),
  id: term(),
  input_tokens: integer() | nil,
  inserted_at: term(),
  latency_ms: integer() | nil,
  model: String.t() | nil,
  oban_job_id: integer(),
  output_tokens: integer() | nil,
  step_name: String.t(),
  worker: String.t(),
  workflow_id: String.t(),
  workflow_label: String.t() | nil
}

Functions

changeset(stat \\ %__MODULE__{}, attrs)