pub struct BudgetState {
pub tokens: u64,
pub cost_micros: u64,
pub max_total_tokens: Option<u64>,
pub max_cost_micros: Option<u64>,
}Expand description
A run’s budget as its snapshot keeps it: what was charged, and the limits the run started with (a request may have set lower ones than the engine’s, and a resumed run keeps them).
Fields§
§tokens: u64§cost_micros: u64In millionths of the price unit of the providers file.
max_total_tokens: Option<u64>§max_cost_micros: Option<u64>Implementations§
Trait Implementations§
Source§impl Clone for BudgetState
impl Clone for BudgetState
impl Copy for BudgetState
Source§impl Debug for BudgetState
impl Debug for BudgetState
Source§impl Default for BudgetState
impl Default for BudgetState
Source§impl<'de> Deserialize<'de> for BudgetState
impl<'de> Deserialize<'de> for BudgetState
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BudgetState
Source§impl PartialEq for BudgetState
impl PartialEq for BudgetState
Source§impl Serialize for BudgetState
impl Serialize for BudgetState
impl StructuralPartialEq for BudgetState
Auto Trait Implementations§
impl Forget for BudgetState
impl Freeze for BudgetState
impl Move for BudgetState
impl RefUnwindSafe for BudgetState
impl Send for BudgetState
impl Sync for BudgetState
impl Unpin for BudgetState
impl UnsafeUnpin for BudgetState
impl UnwindSafe for BudgetState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.