pub struct AttributionReport {
pub uses: Vec<ContextUse>,
pub usage: UsageReport,
}Expand description
Every ContextUse for one request, alongside the UsageReport that
says what those frames cost.
Cost and outcome are kept in one place on purpose: separately, each is
nearly useless. “This frame cost 400 tokens” prompts no decision, and “this
frame was never cited” prompts the wrong one if it cost four. Together they
give value_per_token — the ranking signal #31
and the token-cost work (#8) each supply half of.
Fields§
§uses: Vec<ContextUse>One record per frame the host selected, keyed by the same identity the usage report bills.
usage: UsageReportThe cost side of the ledger for the same request.
Implementations§
Source§impl AttributionReport
impl AttributionReport
Sourcepub fn new(uses: Vec<ContextUse>, usage: UsageReport) -> Self
pub fn new(uses: Vec<ContextUse>, usage: UsageReport) -> Self
Pair outcome records with the cost report for the same request.
Sourcepub fn use_of(&self, frame: &FrameId) -> Option<&ContextUse>
pub fn use_of(&self, frame: &FrameId) -> Option<&ContextUse>
The record for one frame identity, if the host observed it.
Sourcepub fn cited_tokens(&self) -> u64
pub fn cited_tokens(&self) -> u64
Summed token_cost of frames that reached the prompt and were cited.
Sourcepub fn uncited_rendered_tokens(&self) -> u64
pub fn uncited_rendered_tokens(&self) -> u64
Summed token_cost of frames that reached the prompt and were not
cited — the budget retrieval spent without visible return.
The share of rendered budget that earned a citation, in [0, 1].
None when nothing was rendered — a request that retrieved nothing has
no retrieval quality to report, and returning 0.0 would drag an
average down with a turn that never asked anything of retrieval.
Sourcepub fn is_reconcilable(&self) -> bool
pub fn is_reconcilable(&self) -> bool
Whether every record is internally coherent and names a frame the usage report actually billed.
The second half is what makes attribution auditable: a record about a frame nobody was charged for cannot be reconciled against the bill, and is the shape a mis-keyed identity takes.
Trait Implementations§
Source§impl Clone for AttributionReport
impl Clone for AttributionReport
Source§fn clone(&self) -> AttributionReport
fn clone(&self) -> AttributionReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more