Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config = internalreranker.Config
Config configures an HTTPReranker: BaseURL, optional APIKey, and Model.
type HTTPReranker ¶
type HTTPReranker = internalreranker.HTTPReranker
HTTPReranker speaks the Cohere-compatible rerank API shape, also understood by self-hosted alternatives (HuggingFace TEI, vLLM). LangSearchReranker is HTTPReranker preconfigured for LangSearch's hosted API - both names refer to the same underlying type.
func New ¶
func New(cfg Config) *HTTPReranker
New creates an HTTPReranker from an explicit Config - use this to point at a self-hosted rerank server (e.g. a local TEI or vLLM instance serving BAAI/bge-reranker-v2-m3) instead of LangSearch's hosted API.
func NewFromEnv ¶
func NewFromEnv() *HTTPReranker
NewFromEnv builds a reranker from RAG_RERANK_URL / RAG_RERANK_MODEL / RAG_RERANK_API_KEY, falling back to LangSearch's hosted API when only LANGSEARCH_API_KEY is set. See internal/rag/reranker's package doc.
type LangSearchReranker ¶
type LangSearchReranker = internalreranker.LangSearchReranker
LangSearchReranker is HTTPReranker preconfigured for LangSearch's hosted rerank API (langsearch.com - no credit card required for the free tier). Kept as a distinct name for backward compatibility; for a fully free, self-hosted alternative requiring no API key, use New/NewFromEnv with a BaseURL pointing at a local TEI or vLLM instance instead - see reranker.go's package doc.
func NewLangSearchRerankerWithKey ¶
func NewLangSearchRerankerWithKey(apiKey string) *LangSearchReranker
NewLangSearchRerankerWithKey builds a reranker pointed at LangSearch's hosted API specifically. An empty apiKey produces an unconfigured reranker rather than one pointed at LangSearch with no credentials.