summaryrefslogtreecommitdiff
path: root/libpanto/src/public.zig
diff options
context:
space:
mode:
Diffstat (limited to 'libpanto/src/public.zig')
-rw-r--r--libpanto/src/public.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpanto/src/public.zig b/libpanto/src/public.zig
index 8a55e47..d547af3 100644
--- a/libpanto/src/public.zig
+++ b/libpanto/src/public.zig
@@ -218,6 +218,17 @@ pub const Agent = agent_mod.Agent;
pub const Pricing = pricing_mod.Pricing;
pub const PricingRegistry = pricing_mod.Registry;
+/// Compute the cost of a single turn's `Usage` under the given `Pricing`,
+/// in micro-cents (1/1,000,000 of a cent per token). Returns null when any
+/// priced component of any nonzero category is null (the poison rule —
+/// don't pretend a turn with unknown cache pricing is free). Aliased
+/// through `libpanto` because the embedder accumulates session totals
+/// across potentially-switched models.
+pub const costMicroCents = pricing_mod.costMicroCents;
+/// Add a turn's micro-cents cost to a running session total. Either
+/// side null => result null. The single accumulation point for the
+/// per-turn session cost (see `pricing.zig` for why).
+pub const addCost = pricing_mod.addCost;
// ===========================================================================
// Sessions