Skip to main content

CrossEncoderReranker

Trait CrossEncoderReranker 

Source
pub trait CrossEncoderReranker: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    fn max_candidates(&self) -> u32;
    fn rerank(
        &self,
        query: &str,
        candidates: &[RerankCandidate],
    ) -> OrbokResult<Vec<RerankScore>>;
}
Expand description

Optional local cross-encoder reranker (RFC-010 §5).

  • Reranking is always optional; missing model must not break search.
  • Implementors must not log passage_text (NFR-014).

Required Methods§

Source

fn name(&self) -> &str

Source

fn version(&self) -> &str

Source

fn max_candidates(&self) -> u32

Maximum candidates to rerank (RFC-010 §9 top-N limit).

Source

fn rerank( &self, query: &str, candidates: &[RerankCandidate], ) -> OrbokResult<Vec<RerankScore>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§