use crate::reply::prices::{Prices, Rate};
use crate::reply::spend::Cost;
use crate::ui::Model;
use super::super::{own, seated};
pub(crate) fn rate(provider: &str, input: u64, output: u64) -> Rate {
Rate {
provider: provider.to_owned(),
model: "*".to_owned(),
input: input.into(),
output: output.into(),
cache_read: 0_u64.into(),
cache_write: 0_u64.into(),
}
}
pub(crate) fn table() -> Prices {
Prices {
rows: vec![rate("housevendor", 3, 15), rate("subscription", 0, 0)],
ceiling: Some(25_u64.into()),
spent: Some(Cost {
usd: "$4.25".to_owned(),
unpriced_tokens: 12,
}),
released: Some(2),
}
}
pub(crate) fn priced() -> Model {
Model {
lookup: Some(crate::ui::Lookup::Pricing),
pricing: crate::ui::Pricing {
tables: vec![crate::ui::PriceTable {
channel: own().channel,
prices: table(),
}],
..crate::ui::Pricing::default()
},
..seated()
}
}