data

package
v0.0.0-...-68061ec Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmbeddings

func GetEmbeddings(ctx context.Context, text []string, llm *openai.Client) ([]openai.Embedding, error)

func ParseEmbeddings

func ParseEmbeddings(r io.Reader) ([]openai.Embedding, error)

Types

type DistanceFunc

type DistanceFunc func(embeddingsA []float32, embeddingsB []float32) float32

type RelatedEmbedding

type RelatedEmbedding struct {
	Embedding      openai.Embedding
	RelevanceScore float32
	Query          string
}

func RankEmbeddingsByRelatedness

func RankEmbeddingsByRelatedness(
	llm openai.Client,
	kbEmbeddings []openai.Embedding,
	queryEmbedding openai.Embedding,
	distanceFunc DistanceFunc,
	maxResults int,
	ctx context.Context) []RelatedEmbedding

Jump to

Keyboard shortcuts

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