pub trait AgentInvocationAccounting:
Send
+ Sync
+ 'static {
// Required methods
fn reference(&self) -> &AgentInvocationAccountingReference;
fn model_charge(
&self,
invocation: &ModelInvocation,
) -> AgentInvocationCharge;
fn tool_charge(&self, invocation: &ToolInvocation) -> AgentInvocationCharge;
}Expand description
Offline, deterministic pricing boundary for durable model and tool ledgers.
Implementations must perform no I/O and must be deterministic for the exact
terminal invocation snapshot. Their reference is part of the graph contract
digest, so changing a price table requires a new graph version. Returning
AgentInvocationCharge::Unpriced preserves the event in usage evidence
and causes finite monetary budget evaluation to stop before another call.
Required Methods§
Sourcefn reference(&self) -> &AgentInvocationAccountingReference
fn reference(&self) -> &AgentInvocationAccountingReference
Returns the immutable implementation and price-table reference.
Sourcefn model_charge(&self, invocation: &ModelInvocation) -> AgentInvocationCharge
fn model_charge(&self, invocation: &ModelInvocation) -> AgentInvocationCharge
Prices one committed or failed model attempt.
Sourcefn tool_charge(&self, invocation: &ToolInvocation) -> AgentInvocationCharge
fn tool_charge(&self, invocation: &ToolInvocation) -> AgentInvocationCharge
Prices one committed or failed tool attempt.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".