pub struct AdvisorTokenUsage {
pub model: String,
pub calls: u32,
pub input_tokens: u32,
pub cache_read_tokens: u32,
pub cache_write_tokens: u32,
pub output_tokens: u32,
}Expand description
What an advisor model spent while it helped answer one request.
The four token counts are kept apart because they are priced apart, and
they do not overlap: input_tokens is input read fresh, neither written to
nor read from the cache. (The answering model’s prompt_tokens is the sum
of all three input kinds; the advisor’s is not, so no count is added twice
when the two are priced.)
Fields§
§model: StringThe advisor’s model. Empty when it was offered but never consulted and the provider names none.
calls: u32How many times the answering model consulted it.
input_tokens: u32Input tokens read fresh.
cache_read_tokens: u32Input tokens read from the prompt cache.
cache_write_tokens: u32Input tokens written to the prompt cache.
output_tokens: u32Tokens the advisor generated.
Trait Implementations§
Source§impl Clone for AdvisorTokenUsage
impl Clone for AdvisorTokenUsage
Source§impl Debug for AdvisorTokenUsage
impl Debug for AdvisorTokenUsage
Source§impl Default for AdvisorTokenUsage
impl Default for AdvisorTokenUsage
Source§impl<'de> Deserialize<'de> for AdvisorTokenUsage
impl<'de> Deserialize<'de> for AdvisorTokenUsage
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
impl Eq for AdvisorTokenUsage
Source§impl PartialEq for AdvisorTokenUsage
impl PartialEq for AdvisorTokenUsage
Source§impl Serialize for AdvisorTokenUsage
impl Serialize for AdvisorTokenUsage
impl StructuralPartialEq for AdvisorTokenUsage
Auto Trait Implementations§
impl Freeze for AdvisorTokenUsage
impl RefUnwindSafe for AdvisorTokenUsage
impl Send for AdvisorTokenUsage
impl Sync for AdvisorTokenUsage
impl Unpin for AdvisorTokenUsage
impl UnsafeUnpin for AdvisorTokenUsage
impl UnwindSafe for AdvisorTokenUsage
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.