rerank

package
v0.0.0-...-0f488bb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRerank

func NewRerank(ctx context.Context, query string, docs []*schema.Document, topK int) (output []*schema.Document, err error)

Types

type Conf

type Conf struct {
	Model           string `json:"model"`
	ReturnDocuments bool   `json:"return_documents"`
	MaxChunksPerDoc int    `json:"max_chunks_per_doc"`
	OverlapTokens   int    `json:"overlap_tokens"`
	// contains filtered or unexported fields
}

func GetConf

func GetConf(ctx context.Context) *Conf

type Data

type Data struct {
	Query     string   `json:"query"`
	Documents []string `json:"documents"`
	TopN      int      `json:"top_n"`
}

type Req

type Req struct {
	*Data
	*Conf
}

type Resp

type Resp struct {
	ID      string    `json:"id"`
	Results []*Result `json:"results"`
}

type Result

type Result struct {
	Index          int     `json:"index"`
	RelevanceScore float64 `json:"relevance_score"`
}

Jump to

Keyboard shortcuts

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