Sycophant.Pricing (sycophant v0.5.0)

Copy Markdown

Represents pricing metadata from LLMDB's component-based pricing model.

Attached to Sycophant.Usage as reference data after cost calculation. Contains the currency and all pricing components (tokens, tools, images, storage).

Summary

Functions

Finds a component by ID.

Converts an LLMDB pricing map (atom-keyed) into a Pricing struct.

t()

Types

t()

@type t() :: %Sycophant.Pricing{
  __type__: binary(),
  components: [
    %Sycophant.Pricing.Component{
      __type__: binary(),
      id: nil | binary(),
      kind: nil | binary(),
      meter: nil | binary(),
      notes: nil | binary(),
      per: nil | integer(),
      rate: nil | number(),
      size_class: nil | binary(),
      tool: nil | binary(),
      unit: nil | binary()
    }
  ],
  currency: nil | binary()
}

Functions

find_component(pricing, id)

@spec find_component(t(), String.t()) :: Sycophant.Pricing.Component.t() | nil

Finds a component by ID.

from_llmdb(map)

@spec from_llmdb(map()) :: t()

Converts an LLMDB pricing map (atom-keyed) into a Pricing struct.

t()