retract_request(
self,
recorded: RecordedRequest,
) -> None| Name | Type | Description |
|---|---|---|
recorded* | RecordedRequest | Ledger entry describing the contribution to reverse. |
Reverse the record_request call that produced recorded.
A request whose usage arrives across several stream chunks is recorded as soon as the first chunk lands, so the display can react, and then re-recorded with its running totals as later chunks arrive. Retracting the previous version first keeps that one API call counted once, with one per-model row, instead of once per chunk.
Takes the ledger entry rather than loose values so the retraction cannot drift from what was recorded: a mismatch would desync the session totals from the per-kind and per-model breakdowns silently.