Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Model provider.Provider // The reranking model provider
TopK int // Optional: only rerank top K results (0 = rerank all)
Threshold float64 // Optional: minimum score threshold after reranking
Criteria string // Optional: domain-specific relevance criteria to guide scoring
}
Config holds reranking configuration
type LLMReranker ¶
type LLMReranker struct {
// contains filtered or unexported fields
}
LLMReranker implements reranking using any LLM provider that supports the RerankingProvider interface. This includes OpenAI, Anthropic, Gemini, and DMR providers.
func NewLLMReranker ¶
func NewLLMReranker(config Config) (*LLMReranker, error)
NewLLMReranker creates a new LLM-based reranker
func (*LLMReranker) Rerank ¶
func (r *LLMReranker) Rerank(ctx context.Context, query string, results []database.SearchResult) ([]database.SearchResult, error)
Rerank re-scores results using the reranking model
type Reranker ¶
type Reranker interface {
// Rerank re-scores the given search results and returns them sorted by new scores
Rerank(ctx context.Context, query string, results []database.SearchResult) ([]database.SearchResult, error)
}
Reranker re-scores search results using a reranking model
Click to show internal directories.
Click to hide internal directories.