pub struct FocusScoreEvaluator { /* private fields */ }Expand description
Focus score evaluator for message relevance assessment.
This evaluator provides two scoring modes:
- Fast rule-based scoring (for compression efficiency)
- AI-based scoring (for critical decisions, optional)
Implementations§
Source§impl FocusScoreEvaluator
impl FocusScoreEvaluator
Sourcepub fn with_thresholds(high_priority: f32, preserve: f32) -> Self
pub fn with_thresholds(high_priority: f32, preserve: f32) -> Self
Create an evaluator with custom thresholds.
Sourcepub fn evaluate(&self, message: &Message, focus: &ConversationFocus) -> f32
pub fn evaluate(&self, message: &Message, focus: &ConversationFocus) -> f32
Evaluate a message’s relevance to current focus.
Returns a score from 0.0 to 1.0:
- 1.0: Directly addresses current question/task
- 0.7-0.9: Highly relevant, important context
- 0.4-0.6: Moderately relevant
- 0.1-0.3: Low relevance, may be compressed
- 0.0: Not relevant to current focus
Sourcepub fn evaluate_for_focus_point(
&self,
message: &Message,
focus: &FocusPoint,
) -> f32
pub fn evaluate_for_focus_point( &self, message: &Message, focus: &FocusPoint, ) -> f32
Evaluate a message’s relevance to a FocusPoint.
Sourcepub fn evaluate_for_manager(
&self,
message: &Message,
manager: &FocusManager,
) -> f32
pub fn evaluate_for_manager( &self, message: &Message, manager: &FocusManager, ) -> f32
Evaluate using FocusManager (multi-focus aware).
Returns the highest score across all active focuses.
Sourcepub fn should_preserve(&self, score: f32) -> bool
pub fn should_preserve(&self, score: f32) -> bool
Check if a message should be preserved during compression.
Sourcepub fn is_high_priority(&self, score: f32) -> bool
pub fn is_high_priority(&self, score: f32) -> bool
Check if a message is high priority (must preserve intact).
Sourcepub fn preserve_threshold(&self) -> f32
pub fn preserve_threshold(&self) -> f32
Get preservation threshold.
Sourcepub fn high_priority_threshold(&self) -> f32
pub fn high_priority_threshold(&self) -> f32
Get high priority threshold.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FocusScoreEvaluator
impl RefUnwindSafe for FocusScoreEvaluator
impl Send for FocusScoreEvaluator
impl Sync for FocusScoreEvaluator
impl Unpin for FocusScoreEvaluator
impl UnsafeUnpin for FocusScoreEvaluator
impl UnwindSafe for FocusScoreEvaluator
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