1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Rerank API for document relevance scoring
//!
//! This module provides reranking functionality to score and reorder documents
//! based on their relevance to a query. It's commonly used in RAG (Retrieval
//! Augmented Generation) systems to improve retrieval quality.
//!
//! ## Supported Providers
//! - Cohere (rerank-english-v3.0, rerank-multilingual-v3.0)
//! - Jina AI (jina-reranker-v2-base-multilingual)
//! - Voyage AI (rerank-2, rerank-2-lite)
//! - OpenAI (via embeddings + similarity)
//!
//! ## Example
//! ```rust,no_run
//! # use litellm_rs::core::rerank::{RerankRequest, RerankDocument, RerankProvider};
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let request = RerankRequest {
//! model: "cohere/rerank-english-v3.0".to_string(),
//! query: "What is the capital of France?".to_string(),
//! documents: vec![
//! RerankDocument::text("Paris is the capital of France."),
//! RerankDocument::text("London is the capital of England."),
//! RerankDocument::text("Berlin is the capital of Germany."),
//! ],
//! top_n: Some(2),
//! return_documents: Some(true),
//! ..Default::default()
//! };
//!
//! // provider.rerank(request).await? would be called here
//! # Ok(())
//! # }
//! ```
// Re-export all public types
pub use ;
pub use ;
pub use ;
pub use ;