rerank

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package rerank defines the common reranking request and response structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	// Model is the reranker model to use.
	Model string
	// Query is the search query to rank documents against.
	Query string
	// Documents is the list of documents to rerank.
	Documents []string
	// TopN limits the number of results returned (0 means return all).
	TopN int
}

Request represents a reranking request.

type Response

type Response struct {
	// Model is the model that was used for reranking.
	Model string
	// Results contains the reranked documents with their scores.
	Results Results
}

Response represents a reranking response.

type Result

type Result struct {
	// Index is the original position of the document in the input.
	Index int
	// RelevanceScore indicates how relevant the document is to the query.
	RelevanceScore float64
}

Result represents a single reranked document.

type Results

type Results []Result

Results is a collection of reranked results.

func (Results) Indices

func (r Results) Indices() []int

Indices returns the document indices in ranked order.

Jump to

Keyboard shortcuts

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