pub struct ProviderRequestAccounting {
pub turn_id: String,
pub request_id: String,
pub attempt: u32,
pub provider: String,
pub model: String,
pub serialized_bytes: ByteMeasurement,
pub estimated_input_tokens: TokenMeasurement,
pub provider_usage: Option<ProviderUsage>,
pub context: Vec<ContextItemSnapshot>,
pub shadow_receipts: Vec<ContextReductionReceipt>,
pub model_projection: Vec<ModelProjectionMessage>,
}Expand description
Accounting for one successful serialized provider request.
Fields§
§turn_id: StringSession turn that owns this request.
request_id: StringStable request identity across event delivery and session persistence.
attempt: u32One-based retry attempt for this request identity.
provider: StringProvider adapter label.
model: StringSelected model id.
serialized_bytes: ByteMeasurementExact serialized request body size.
estimated_input_tokens: TokenMeasurementConservative input estimate from the same serialized bytes.
provider_usage: Option<ProviderUsage>Provider usage, when the successful response reported it.
context: Vec<ContextItemSnapshot>All context candidates considered for this request, once each.
shadow_receipts: Vec<ContextReductionReceipt>Shadow reducer receipts for this request.
model_projection: Vec<ModelProjectionMessage>In-memory model projection for the selected request.
This is not durable session data and is skipped during serialization; the application may use it to build an explicit bounded export.
Implementations§
Source§impl ProviderRequestAccounting
impl ProviderRequestAccounting
Sourcepub fn from_serialized_request(
turn_id: impl Into<String>,
request_id: impl Into<String>,
attempt: u32,
provider: &str,
model: &str,
bytes: &[u8],
context: Vec<ContextItemSnapshot>,
) -> Self
pub fn from_serialized_request( turn_id: impl Into<String>, request_id: impl Into<String>, attempt: u32, provider: &str, model: &str, bytes: &[u8], context: Vec<ContextItemSnapshot>, ) -> Self
Create accounting from the exact serialized request body.
Sourcepub fn with_model_projection(
self,
projection: Vec<ModelProjectionMessage>,
) -> Self
pub fn with_model_projection( self, projection: Vec<ModelProjectionMessage>, ) -> Self
Attach a bounded in-memory model projection without changing durable accounting or provider request bytes.
Trait Implementations§
Source§impl Clone for ProviderRequestAccounting
impl Clone for ProviderRequestAccounting
Source§fn clone(&self) -> ProviderRequestAccounting
fn clone(&self) -> ProviderRequestAccounting
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more