use async_trait::async_trait;
use super::Reranker;
use crate::{error::Result, store::ScoredChunk};
#[derive(Debug, Default, Clone)]
pub struct NoopReranker {
model_id: String,
}
impl NoopReranker {
pub fn new() -> Self {
Self {
model_id: "noop".to_string(),
}
}
pub fn with_model_id(model_id: impl Into<String>) -> Self {
Self {
model_id: model_id.into(),
}
}
}
#[async_trait]
impl Reranker for NoopReranker {
fn model_id(&self) -> &str {
&self.model_id
}
async fn rerank(&self, _query: &str, _candidates: &mut [ScoredChunk]) -> Result<()> {
Ok(())
}
}