pub struct UsageV2 {
pub input_tokens: u32,
pub output_tokens: u32,
}Expand description
Re-exports of the v2 wire types per ADR 0015. v2 is shipped as
part of inferd-client 0.2 so consumers building against v2 can
reach the proto types without a separate inferd-proto dep.
Token-count usage report carried on v2 done frames.
Field names (input_tokens / output_tokens) match Anthropic’s
shape; v1’s prompt_tokens / completion_tokens matched
llama.cpp’s terminology. Both refer to the same underlying counts.
Fields§
§input_tokens: u32Tokens consumed by the prompt (including templated chat structure).
output_tokens: u32Tokens generated in the response.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UsageV2
impl<'de> Deserialize<'de> for UsageV2
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UsageV2, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UsageV2, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for UsageV2
impl Serialize for UsageV2
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for UsageV2
impl Eq for UsageV2
impl StructuralPartialEq for UsageV2
Auto Trait Implementations§
impl Freeze for UsageV2
impl RefUnwindSafe for UsageV2
impl Send for UsageV2
impl Sync for UsageV2
impl Unpin for UsageV2
impl UnsafeUnpin for UsageV2
impl UnwindSafe for UsageV2
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