Skip to main content

Refiner

Trait Refiner 

Source
pub trait Refiner: Send + Sync {
    // Required method
    fn refine(
        &self,
        chunks: Vec<Value>,
        budget_tokens: Option<usize>,
    ) -> Result<Vec<Value>>;

    // Provided method
    fn trim(
        &self,
        _block: &[Value],
        _query: &str,
        _budget_tokens: usize,
    ) -> Option<Vec<Value>> { ... }
}
Expand description

Online refiner — trims or adapts recalled chunks.

Required Methods§

Source

fn refine( &self, chunks: Vec<Value>, budget_tokens: Option<usize>, ) -> Result<Vec<Value>>

Provided Methods§

Source

fn trim( &self, _block: &[Value], _query: &str, _budget_tokens: usize, ) -> Option<Vec<Value>>

Trim a block to fit within budget_tokens given the active query. Returns None if trimming is not supported or the block cannot be trimmed while preserving hard-dep closure integrity.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§