reranker

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CHUNK_OVERLAP = 200
View Source
const COHERE_RERANK_MODEL = "rerank-english-v3.0"

Variables

View Source
var TOP_N_CHUNKS int = 8

Functions

func SplitHtml

func SplitHtml(text string, separators []string, chunkSize int) []string

Types

type ReRankInterface

type ReRankInterface interface {
	ReRank(request ReRankRequest) (*[]ReRankResult, error)
}

func CreateCohereClientFromEnv

func CreateCohereClientFromEnv() ReRankInterface

func NewCohereClient

func NewCohereClient(token string) ReRankInterface

NewCohereClient creates a new cohere client.

type ReRankRequest

type ReRankRequest struct {
	Query     string
	Documents []string
}

type ReRankResult

type ReRankResult struct {
	Index int
	Score float64
}

Jump to

Keyboard shortcuts

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