pub struct ContextSource {
pub name: String,
pub origin: ContextOrigin,
pub calls: u64,
pub tokens: u64,
pub cost_usd: f64,
}Expand description
One source of a session’s context: what its results have added to the prompt, and what sending that on every inference since has cost.
The tokens are the growth of the prompt between one response and the
next, attributed to the tool results submitted in between; the cost is
those tokens charged at the prompt rate of every response that carried
them, the first read included. The rows sum to the session’s prompt-side
cost. See docs/accounting.md.
Fields§
§name: String§origin: ContextOrigin§calls: u64Tool results attributed to this source. Zero for Other.
tokens: u64Tokens the source added to the prompt over the session.
cost_usd: f64USD those tokens have cost across every response that read them. An estimate; zero when the model has no price.
Trait Implementations§
Source§impl Clone for ContextSource
impl Clone for ContextSource
Source§fn clone(&self) -> ContextSource
fn clone(&self) -> ContextSource
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 ContextSource
impl Debug for ContextSource
Source§impl Default for ContextSource
impl Default for ContextSource
Source§fn default() -> ContextSource
fn default() -> ContextSource
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContextSource
impl<'de> Deserialize<'de> for ContextSource
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
Source§impl PartialEq for ContextSource
impl PartialEq for ContextSource
Source§impl Serialize for ContextSource
impl Serialize for ContextSource
impl StructuralPartialEq for ContextSource
Auto Trait Implementations§
impl Freeze for ContextSource
impl RefUnwindSafe for ContextSource
impl Send for ContextSource
impl Sync for ContextSource
impl Unpin for ContextSource
impl UnsafeUnpin for ContextSource
impl UnwindSafe for ContextSource
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