pub struct Catalog {
pub extracted_at: String,
pub source: String,
pub currency: String,
pub afp_yuan: f64,
pub windows: WindowShare,
pub plans: Vec<Plan>,
pub enterprise: Vec<Enterprise>,
pub models: Vec<Model>,
pub media: Vec<Media>,
pub harness: Vec<Media>,
pub notes: BTreeMap<String, String>,
}Fields§
§extracted_at: String§source: String§currency: String§afp_yuan: f64Yuan per AFP — 0.002 at every tier.
windows: WindowShare§plans: Vec<Plan>§enterprise: Vec<Enterprise>§models: Vec<Model>§media: Vec<Media>§harness: Vec<Media>§notes: BTreeMap<String, String>Implementations§
Source§impl Catalog
impl Catalog
pub fn plan(&self, plan_id: &str) -> Option<&Plan>
pub fn plan_ids(&self) -> Vec<&str>
Sourcepub fn grants(&self, plan_id: &str, min_plan: &str) -> bool
pub fn grants(&self, plan_id: &str, min_plan: &str) -> bool
The tier a model needs, compared by rank so --plan large grants a
Medium-only model too.
Sourcepub fn coef_at(&self, model: &Model, at_ms: i64) -> f64
pub fn coef_at(&self, model: &Model, at_ms: i64) -> f64
The coefficient in force at at_ms: a promo halves it until its own date.
Sourcepub fn afp(
&self,
model_id: &str,
at_ms: i64,
input: u64,
cache_read: u64,
output: u64,
) -> Option<f64>
pub fn afp( &self, model_id: &str, at_ms: i64, input: u64, cache_read: u64, output: u64, ) -> Option<f64>
AFP for one text/embedding turn, or None for a model with no
coefficient (unknown, or media which meters in its own unit).
Cache-read tokens are billed: measured on this account, cache-excluded arithmetic gave 40.9 AFP against a 706.5 meter, cache-inclusive gave 705.2 — 0.2% apart.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Catalog
impl<'de> Deserialize<'de> for Catalog
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
Auto Trait Implementations§
impl Freeze for Catalog
impl RefUnwindSafe for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
impl UnwindSafe for Catalog
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