MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_counts

Method from_counts

atomic-agent/src/provenance/detail.rs:83–89  ·  view source on GitHub ↗

Build a `PhaseTokens` from raw counts, computing cost automatically.

(input: u32, output: u32)

Source from the content-addressed store, hash-verified

81impl PhaseTokens {
82 /// Build a `PhaseTokens` from raw counts, computing cost automatically.
83 pub fn from_counts(input: u32, output: u32) -> Self {
84 Self {
85 input,
86 output,
87 cost_usd: compute_cost(input, output),
88 }
89 }
90
91 /// Add another `PhaseTokens` into `self` (used for running totals).
92 pub fn add(&mut self, other: &PhaseTokens) {

Callers

nothing calls this directly

Calls 1

compute_costFunction · 0.85

Tested by

no test coverage detected