pub struct RerankingExecutor { /* private fields */ }Expand description
Reranker executor
Implementations§
Source§impl RerankingExecutor
impl RerankingExecutor
Sourcepub fn with_config(self, config: RerankingConfig) -> Self
pub fn with_config(self, config: RerankingConfig) -> Self
Sets the reranking configuration
Sourcepub fn with_top_n(self, n: usize) -> Self
pub fn with_top_n(self, n: usize) -> Self
Sets the number of documents returned in the final result
Sourcepub fn with_min_score(self, score: f32) -> Self
pub fn with_min_score(self, score: f32) -> Self
Sets the minimum score threshold
Sourcepub fn with_preserve_original_score(self, preserve: bool) -> Self
pub fn with_preserve_original_score(self, preserve: bool) -> Self
Sets whether to preserve the original score
Sourcepub fn rerank(
&self,
query: &str,
results: Vec<SearchResult>,
) -> Result<Vec<SearchResult>, RerankingError>
pub fn rerank( &self, query: &str, results: Vec<SearchResult>, ) -> Result<Vec<SearchResult>, RerankingError>
Re-ranks the retrieval results, returning the reranked scored results
Sourcepub fn rerank_documents(
&self,
query: &str,
documents: Vec<Document>,
) -> Result<Vec<SearchResult>, RerankingError>
pub fn rerank_documents( &self, query: &str, documents: Vec<Document>, ) -> Result<Vec<SearchResult>, RerankingError>
Scores and re-ranks a document list directly, returning scored results
Auto Trait Implementations§
impl !RefUnwindSafe for RerankingExecutor
impl !UnwindSafe for RerankingExecutor
impl Freeze for RerankingExecutor
impl Send for RerankingExecutor
impl Sync for RerankingExecutor
impl Unpin for RerankingExecutor
impl UnsafeUnpin for RerankingExecutor
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