pub struct ModelInvocation {
pub requested_model: Option<String>,
pub selected_model: Option<String>,
pub model: Option<String>,
pub provider: Option<String>,
pub latency_ms: Option<u64>,
pub actual_cost_micros: Option<u64>,
pub baseline_cost_micros: Option<u64>,
pub retries: Option<u32>,
}Expand description
One model-route observation that complements normalized token usage.
A model invocation can carry economic and latency observations that are not guaranteed to be present in a provider usage payload. Optional fields stay optional until the final projection onto the legacy fixed-width receipt.
Fields§
§requested_model: Option<String>The model requested by the caller, if routing changed it.
selected_model: Option<String>Model selected by the router, when this invocation has one.
model: Option<String>Compatibility alias for callers that use model for the selected name.
provider: Option<String>§latency_ms: Option<u64>§actual_cost_micros: Option<u64>§baseline_cost_micros: Option<u64>§retries: Option<u32>Implementations§
Source§impl ModelInvocation
impl ModelInvocation
Sourcepub fn new(provider: impl Into<String>, model: impl Into<String>) -> Self
pub fn new(provider: impl Into<String>, model: impl Into<String>) -> Self
Creates a model invocation with the selected provider and model.
pub fn with_requested_model(self, model: impl Into<String>) -> Self
pub fn with_latency_ms(self, latency_ms: u64) -> Self
pub fn with_actual_cost_micros(self, cost_micros: u64) -> Self
pub fn with_baseline_cost_micros(self, cost_micros: u64) -> Self
pub fn with_retries(self, retries: u32) -> Self
Trait Implementations§
Source§impl Clone for ModelInvocation
impl Clone for ModelInvocation
Source§fn clone(&self) -> ModelInvocation
fn clone(&self) -> ModelInvocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelInvocation
impl Debug for ModelInvocation
Source§impl Default for ModelInvocation
impl Default for ModelInvocation
Source§fn default() -> ModelInvocation
fn default() -> ModelInvocation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelInvocation
impl<'de> Deserialize<'de> for ModelInvocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelInvocation
Source§impl PartialEq for ModelInvocation
impl PartialEq for ModelInvocation
Source§impl Serialize for ModelInvocation
impl Serialize for ModelInvocation
impl StructuralPartialEq for ModelInvocation
Auto Trait Implementations§
impl Freeze for ModelInvocation
impl RefUnwindSafe for ModelInvocation
impl Send for ModelInvocation
impl Sync for ModelInvocation
impl Unpin for ModelInvocation
impl UnsafeUnpin for ModelInvocation
impl UnwindSafe for ModelInvocation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more