reranker

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LangSearchReranker

type LangSearchReranker struct {
	// contains filtered or unexported fields
}

LangSearchReranker reranks a set of documents by semantic relevance using the LangSearch free rerank API (langsearch.com — no credit card required).

func NewLangSearchReranker

func NewLangSearchReranker() *LangSearchReranker

NewLangSearchReranker reads LANGSEARCH_API_KEY from the environment.

func NewLangSearchRerankerWithKey

func NewLangSearchRerankerWithKey(apiKey string) *LangSearchReranker

func (*LangSearchReranker) IsConfigured

func (r *LangSearchReranker) IsConfigured() bool

IsConfigured reports whether an API key is set.

func (*LangSearchReranker) Rerank

func (r *LangSearchReranker) Rerank(ctx context.Context, query string, docs []string, topN int) ([]int, []float32, error)

Rerank sends docs to LangSearch and returns their indices sorted by descending relevance score, along with the score for each position. topN caps the returned list; pass 0 to return all.

Jump to

Keyboard shortcuts

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