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.
Click to show internal directories.
Click to hide internal directories.