reranker

package
v1.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.1.0

type Config = internalreranker.Config

Config configures an HTTPReranker: BaseURL, optional APIKey, and Model.

type HTTPReranker added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL