pub struct RerankRequest {
pub query: EmbedInput,
pub candidates: Vec<EmbedInput>,
pub top_k: Option<usize>,
pub min_score: Option<f64>,
}Expand description
Request for reranking operation.
Fields§
§query: EmbedInputThe query to rank against.
candidates: Vec<EmbedInput>Candidate items to rerank.
top_k: Option<usize>Maximum number of results to return.
min_score: Option<f64>Minimum score threshold (0.0-1.0).
Implementations§
Source§impl RerankRequest
impl RerankRequest
Sourcepub fn new(query: EmbedInput, candidates: Vec<EmbedInput>) -> Self
pub fn new(query: EmbedInput, candidates: Vec<EmbedInput>) -> Self
Creates a new rerank request.
Sourcepub fn text(query: impl Into<String>, candidates: Vec<String>) -> Self
pub fn text(query: impl Into<String>, candidates: Vec<String>) -> Self
Creates a text-only rerank request.
Sourcepub fn with_top_k(self, k: usize) -> Self
pub fn with_top_k(self, k: usize) -> Self
Sets the top-k limit.
Sourcepub fn with_min_score(self, score: f64) -> Self
pub fn with_min_score(self, score: f64) -> Self
Sets the minimum score threshold.
Trait Implementations§
Source§impl Clone for RerankRequest
impl Clone for RerankRequest
Source§fn clone(&self) -> RerankRequest
fn clone(&self) -> RerankRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RerankRequest
impl RefUnwindSafe for RerankRequest
impl Send for RerankRequest
impl Sync for RerankRequest
impl Unpin for RerankRequest
impl UnwindSafe for RerankRequest
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