pub struct BulletSelector {
pub weights: HashMap<String, f64>,
pub embedding_model: String,
pub cache_file: Option<String>,
pub embedding_cache: EmbeddingCache,
}Expand description
Selects most relevant bullets for a given query.
Implements hybrid retrieval with three scoring factors:
- Effectiveness: Based on helpful/harmful feedback
- Recency: Prefers recently updated bullets
- Semantic: Query-to-bullet similarity using embeddings
Fields§
§weights: HashMap<String, f64>§embedding_model: String§cache_file: Option<String>§embedding_cache: EmbeddingCacheImplementations§
Source§impl BulletSelector
impl BulletSelector
Sourcepub fn new(
weights: Option<HashMap<String, f64>>,
embedding_model: &str,
cache_file: Option<&str>,
) -> Self
pub fn new( weights: Option<HashMap<String, f64>>, embedding_model: &str, cache_file: Option<&str>, ) -> Self
Create a new bullet selector.
Sourcepub fn select(
&self,
bullets: &[Bullet],
max_count: usize,
query: Option<&str>,
) -> Vec<Bullet>
pub fn select( &self, bullets: &[Bullet], max_count: usize, query: Option<&str>, ) -> Vec<Bullet>
Select top-K most relevant bullets.
Sourcepub fn score_bullet(&self, bullet: &Bullet, query: Option<&str>) -> ScoredBullet
pub fn score_bullet(&self, bullet: &Bullet, query: Option<&str>) -> ScoredBullet
Score a single bullet.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BulletSelector
impl RefUnwindSafe for BulletSelector
impl Send for BulletSelector
impl Sync for BulletSelector
impl Unpin for BulletSelector
impl UnsafeUnpin for BulletSelector
impl UnwindSafe for BulletSelector
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