pub struct PromptCacheEffectivenessSample {
pub schema_version: u64,
pub recorded_at_unix_secs: u64,
pub session_source: String,
pub session_path: String,
pub session_modified_unix_secs: Option<u64>,
pub prompt_tokens: u64,
pub cached_input_tokens: u64,
pub cache_creation_input_tokens: u64,
pub cached_input_ratio: Option<f64>,
pub net_cached_input_tokens: i64,
pub read_create_regressions: usize,
}Expand description
One persisted prompt-cache effectiveness reading for a single session.
Fields§
§schema_version: u64§recorded_at_unix_secs: u64§session_source: String§session_path: String§session_modified_unix_secs: Option<u64>§prompt_tokens: u64§cached_input_tokens: u64§cache_creation_input_tokens: u64§cached_input_ratio: Option<f64>§net_cached_input_tokens: i64§read_create_regressions: usizeImplementations§
Source§impl PromptCacheEffectivenessSample
impl PromptCacheEffectivenessSample
Sourcepub fn from_tokens(
recorded_at_unix_secs: u64,
session_source: impl Into<String>,
session_path: impl Into<String>,
session_modified_unix_secs: Option<u64>,
prompt_tokens: u64,
cached_input_tokens: u64,
cache_creation_input_tokens: u64,
) -> Self
pub fn from_tokens( recorded_at_unix_secs: u64, session_source: impl Into<String>, session_path: impl Into<String>, session_modified_unix_secs: Option<u64>, prompt_tokens: u64, cached_input_tokens: u64, cache_creation_input_tokens: u64, ) -> Self
Build a sample from a session’s raw token totals, deriving the
cached_input_ratio, net_cached_input_tokens, and
read_create_regressions exactly the way the per-fixture effectiveness
report does so persisted history stays consistent with the live gate.
Trait Implementations§
Source§impl Clone for PromptCacheEffectivenessSample
impl Clone for PromptCacheEffectivenessSample
Source§fn clone(&self) -> PromptCacheEffectivenessSample
fn clone(&self) -> PromptCacheEffectivenessSample
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<'de> Deserialize<'de> for PromptCacheEffectivenessSample
impl<'de> Deserialize<'de> for PromptCacheEffectivenessSample
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 StructuralPartialEq for PromptCacheEffectivenessSample
Auto Trait Implementations§
impl Freeze for PromptCacheEffectivenessSample
impl RefUnwindSafe for PromptCacheEffectivenessSample
impl Send for PromptCacheEffectivenessSample
impl Sync for PromptCacheEffectivenessSample
impl Unpin for PromptCacheEffectivenessSample
impl UnsafeUnpin for PromptCacheEffectivenessSample
impl UnwindSafe for PromptCacheEffectivenessSample
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