Struct Cost Estimate
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 CostEstimate {
pub total: Option<f64>,
pub currency: String,
pub input: Option<f64>,
pub output: Option<f64>,
pub cache_read: Option<f64>,
pub cache_write: Option<f64>,
pub source: i32,
pub pricing_provider: Option<String>,
pub pricing_model: Option<String>,
pub pricing_as_of: Option<String>,
pub pricing_source: Option<String>,
}
Normalized monetary cost with provenance for estimates and provider-reported values.
Fields
total: Option<f64>
Total cost in currency.
currency: String
ISO 4217 currency code for the cost fields.
input: Option<f64>
Uncached prompt/input token cost in currency.
output: Option<f64>
Completion/output token cost in currency.
cache_read: Option<f64>
Prompt cache read cost in currency.
cache_write: Option<f64>
Prompt cache write cost in currency.
source: i32
Origin of this cost value.
pricing_provider: Option<String>
Provider associated with the cost or pricing estimate, if known.
pricing_model: Option<String>
Model ID associated with the cost or pricing estimate, if known.
pricing_as_of: Option<String>
Date the pricing value was last verified, if known.
pricing_source: Option<String>
Source URL or label for the pricing value, if known.
Implementations
impl CostEstimate
impl CostEstimate
total
pub fn total(&self) -> f64
Returns the value of total, or the default value if total is unset.
input
pub fn input(&self) -> f64
Returns the value of input, or the default value if input is unset.
output
pub fn output(&self) -> f64
Returns the value of output, or the default value if output is unset.
cache_read
pub fn cache_read(&self) -> f64
Returns the value of cache_read, or the default value if cache_read is unset.
cache_write
pub fn cache_write(&self) -> f64
Returns the value of cache_write, or the default value if cache_write is unset.
source
pub fn source(&self) -> CostSource
Returns the enum value of source, or the default if the field is set to an invalid enum value.
set_source
pub fn set_source(&mut self, value: CostSource)
Sets source to the provided enum value.
pricing_provider
pub fn pricing_provider(&self) -> &str
Returns the value of pricing_provider, or the default value if pricing_provider is unset.
pricing_model
pub fn pricing_model(&self) -> &str
Returns the value of pricing_model, or the default value if pricing_model is unset.
pricing_as_of
pub fn pricing_as_of(&self) -> &str
Returns the value of pricing_as_of, or the default value if pricing_as_of is unset.
pricing_source
pub fn pricing_source(&self) -> &str
Returns the value of pricing_source, or the default value if pricing_source is unset.
Trait Implementations
impl Clone for CostEstimate
impl Clone for CostEstimate
clone
fn clone(&self) -> CostEstimate
clone_from
fn clone_from(&mut self, source: &Self)
impl Debug for CostEstimate
impl Debug for CostEstimate
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for CostEstimate
impl Default for CostEstimate
default
fn default() -> Self
impl Message for CostEstimate
impl Message for CostEstimate
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 CostEstimate
impl Name for CostEstimate
NAME
const NAME: &'static str = "CostEstimate"
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 CostEstimate
impl PartialEq for CostEstimate
eq
fn eq(&self, other: &CostEstimate) -> bool
ne
fn ne(&self, other: &Rhs) -> bool
impl WireValue<CostEstimate> for CostEstimate
impl WireValue<CostEstimate> for CostEstimate
to_wire
fn to_wire(self) -> Result<CostEstimate>
from_wire
fn from_wire(value: CostEstimate) -> Result<Self>
impl StructuralPartialEq for CostEstimate
impl StructuralPartialEq for CostEstimate