pub struct ModelPricing {
pub model_name: String,
pub input_cost_per_1k: f64,
pub output_cost_per_1k: f64,
}Available on crate feature
eval only.Expand description
Per-model pricing configuration.
Defines the cost per 1,000 input and output tokens for a specific model.
Used by CostTracker to compute estimated dollar
costs from token counts extracted during evaluation.
Fields§
§model_name: StringModel identifier (e.g., “gemini-2.5-flash”, “gpt-4o”)
input_cost_per_1k: f64Cost per 1,000 input tokens in USD
output_cost_per_1k: f64Cost per 1,000 output tokens in USD
Implementations§
Source§impl ModelPricing
impl ModelPricing
Sourcepub fn new(
model_name: impl Into<String>,
input_cost_per_1k: f64,
output_cost_per_1k: f64,
) -> ModelPricing
pub fn new( model_name: impl Into<String>, input_cost_per_1k: f64, output_cost_per_1k: f64, ) -> ModelPricing
Create a new ModelPricing entry.
§Arguments
model_name- Model identifier stringinput_cost_per_1k- Cost per 1K input tokens (USD)output_cost_per_1k- Cost per 1K output tokens (USD)
§Example
use adk_eval::pricing::ModelPricing;
let pricing = ModelPricing::new("gpt-4o", 0.0025, 0.01);
assert_eq!(pricing.model_name, "gpt-4o");Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§fn clone(&self) -> ModelPricing
fn clone(&self) -> ModelPricing
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 ModelPricing
impl Debug for ModelPricing
Source§impl<'de> Deserialize<'de> for ModelPricing
impl<'de> Deserialize<'de> for ModelPricing
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelPricing, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelPricing, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelPricing
impl PartialEq for ModelPricing
Source§fn eq(&self, other: &ModelPricing) -> bool
fn eq(&self, other: &ModelPricing) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ModelPricing
impl Serialize for ModelPricing
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 StructuralPartialEq for ModelPricing
Auto Trait Implementations§
impl Freeze for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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