Skip to main content

Crate obol_core

Crate obol_core 

Source
Expand description

obol-core: parse agent transcripts and estimate token cost.

Re-exports§

pub use error::ObolError;
pub use model::Approximation;
pub use model::CostEstimate;
pub use model::MessageUsage;
pub use model::ModelCost;
pub use model::Provider;
pub use model::TokenBuckets;
pub use transcript::Dialect;

Modules§

cost
Price a Vec against a PriceStore into a CostEstimate.
error
model
Public result types + the internal per-message usage record.
pricing
Price tables and the per-message cost kernel.
transcript

Structs§

RefreshReport
Report from a pricing refresh.

Enums§

Source
Where to read the transcript bytes from. The dialect hint is a separate argument to estimate_cost, so it applies equally to a path or to bytes.

Functions§

estimate_cost
Estimate the cost of a transcript. dialect is an optional hint; when None, the dialect is detected from the content. Loads the active price snapshot from disk (errors with PricingTablesMissing if absent).
refresh_pricing_tables
Fetch the LiteLLM sheet and write it as the active snapshot. as_of is the caller’s date string (the library has no clock).