Struct LlmOptimization Tokens
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
pub struct LlmOptimizationTokens {
pub prompt_tokens: Option<u64>,
pub completion_tokens: Option<u64>,
pub cache_read_tokens: Option<u64>,
pub cache_write_tokens: Option<u64>,
pub total_tokens: Option<u64>,
}
Optional token evidence; missing categories remain unknown rather than zero.
Fields
prompt_tokens: Option<u64>
Input/prompt tokens.
completion_tokens: Option<u64>
Output/completion tokens.
cache_read_tokens: Option<u64>
Tokens read from a provider prompt cache.
cache_write_tokens: Option<u64>
Tokens written to a provider prompt cache.
total_tokens: Option<u64>
Total tokens when supplied by the producer.
Implementations
impl LlmOptimizationTokens
impl LlmOptimizationTokens
prompt_tokens
pub fn prompt_tokens(&self) -> u64
Returns the value of prompt_tokens, or the default value if prompt_tokens is unset.
completion_tokens
pub fn completion_tokens(&self) -> u64
Returns the value of completion_tokens, or the default value if completion_tokens is unset.
cache_read_tokens
pub fn cache_read_tokens(&self) -> u64
Returns the value of cache_read_tokens, or the default value if cache_read_tokens is unset.
cache_write_tokens
pub fn cache_write_tokens(&self) -> u64
Returns the value of cache_write_tokens, or the default value if cache_write_tokens is unset.
total_tokens
pub fn total_tokens(&self) -> u64
Returns the value of total_tokens, or the default value if total_tokens is unset.
Trait Implementations
impl Clone for LlmOptimizationTokens
impl Clone for LlmOptimizationTokens
clone
fn clone(&self) -> LlmOptimizationTokens
clone_from
fn clone_from(&mut self, source: &Self)
impl Debug for LlmOptimizationTokens
impl Debug for LlmOptimizationTokens
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for LlmOptimizationTokens
impl Default for LlmOptimizationTokens
default
fn default() -> Self
impl Hash for LlmOptimizationTokens
impl Hash for LlmOptimizationTokens
hash
fn hash<__H: Hasher>(&self, state: &mut __H)
hash_slice
fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
Self: Sized,
impl Message for LlmOptimizationTokens
impl Message for LlmOptimizationTokens
encoded_len
fn encoded_len(&self) -> usize
clear
fn clear(&mut self)
encode
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
encode_to_vec
fn encode_to_vec(&self) -> Vec<u8> where
Self: Sized,
encode_length_delimited
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
encode_length_delimited_to_vec
fn encode_length_delimited_to_vec(&self) -> Vec<u8> where
Self: Sized,
decode
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
decode_length_delimited
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
merge
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
merge_length_delimited
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
impl Name for LlmOptimizationTokens
impl Name for LlmOptimizationTokens
NAME
const NAME: &'static str = "LlmOptimizationTokens"
PACKAGE
const PACKAGE: &'static str = "nvidia.nemo.relay.worker.v1"
full_name
fn full_name() -> String
type_url
fn type_url() -> String
impl PartialEq for LlmOptimizationTokens
impl PartialEq for LlmOptimizationTokens
eq
fn eq(&self, other: &LlmOptimizationTokens) -> bool
ne
fn ne(&self, other: &Rhs) -> bool
impl WireValue<LlmOptimizationTokens> for LlmOptimizationTokens
impl WireValue<LlmOptimizationTokens> for LlmOptimizationTokens
to_wire
fn to_wire(self) -> Result<LlmOptimizationTokens>
from_wire
fn from_wire(value: LlmOptimizationTokens) -> Result<Self>
impl Copy for LlmOptimizationTokens
impl Copy for LlmOptimizationTokens
impl Eq for LlmOptimizationTokens
impl Eq for LlmOptimizationTokens
impl StructuralPartialEq for LlmOptimizationTokens
impl StructuralPartialEq for LlmOptimizationTokens