ASM.Cost (ASM v0.9.2)

Copy Markdown View Source

Cost helpers for token usage projection and accumulation.

Summary

Types

totals()

@type totals() :: %{
  input_tokens: non_neg_integer(),
  output_tokens: non_neg_integer(),
  cost_usd: float()
}

usage()

@type usage() :: map()

Functions

accumulate(current, update)

@spec accumulate(totals(), ASM.Control.CostUpdate.t()) :: totals()

from_usage(provider, model, usage)

@spec from_usage(atom(), String.t() | nil, usage()) :: ASM.Control.CostUpdate.t()