pub struct ContextAnalyzer;Expand description
Service for analyzing context usage and generating warnings.
Implementations§
Source§impl ContextAnalyzer
impl ContextAnalyzer
Sourcepub fn analyze(context: &ContextUsage) -> ContextWarningLevel
pub fn analyze(context: &ContextUsage) -> ContextWarningLevel
Analyzes context usage and returns warning level.
Sourcepub fn warning_message(context: &ContextUsage) -> Option<String>
pub fn warning_message(context: &ContextUsage) -> Option<String>
Generates a warning message if applicable.
Sourcepub fn estimate_remaining_turns(
context: &ContextUsage,
avg_tokens_per_turn: u64,
) -> Option<u64>
pub fn estimate_remaining_turns( context: &ContextUsage, avg_tokens_per_turn: u64, ) -> Option<u64>
Estimates remaining “turns” based on average token usage per turn.
Sourcepub fn cache_efficiency(context: &ContextUsage) -> f64
pub fn cache_efficiency(context: &ContextUsage) -> f64
Calculates cache efficiency (cache reads vs total input).
Auto Trait Implementations§
impl Freeze for ContextAnalyzer
impl RefUnwindSafe for ContextAnalyzer
impl Send for ContextAnalyzer
impl Sync for ContextAnalyzer
impl Unpin for ContextAnalyzer
impl UnsafeUnpin for ContextAnalyzer
impl UnwindSafe for ContextAnalyzer
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