pub struct CohereRerankerConfig {
pub api_key: String,
pub model: String,
pub top_n: Option<usize>,
pub base_url: String,
}Expand description
Configuration for the Cohere Reranker.
Fields§
§api_key: StringCohere API key.
model: StringReranker model name (default: "rerank-v3.5").
top_n: Option<usize>Maximum number of documents to return. If None, all documents are returned.
base_url: StringBase URL for the Cohere API (default: "https://api.cohere.ai/v2").
Implementations§
Source§impl CohereRerankerConfig
impl CohereRerankerConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create a new configuration with the given API key and default settings.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the reranker model.
Sourcepub fn with_top_n(self, top_n: usize) -> Self
pub fn with_top_n(self, top_n: usize) -> Self
Set the maximum number of results to return.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set a custom base URL for the API.
Trait Implementations§
Source§impl Clone for CohereRerankerConfig
impl Clone for CohereRerankerConfig
Source§fn clone(&self) -> CohereRerankerConfig
fn clone(&self) -> CohereRerankerConfig
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 CohereRerankerConfig
impl RefUnwindSafe for CohereRerankerConfig
impl Send for CohereRerankerConfig
impl Sync for CohereRerankerConfig
impl Unpin for CohereRerankerConfig
impl UnsafeUnpin for CohereRerankerConfig
impl UnwindSafe for CohereRerankerConfig
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