embedding

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

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupported       = errors.New("unsupported")         // This Error occurs whem the model does not support the content type provided.
	ErrMaxLengthExceeded = errors.New("max length exceeded") // This Error occurs when the content exceeds the maximum length.
	ErrNoResult          = errors.New("no result")           // This Error occurs when the model does not return any result.
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Dimension int
}

type Model

type Model interface {
	TextEmbedding(ctx context.Context, text string, task TaskType) ([]float64, error) // Returns the embedding of the text.
}

type TaskType

type TaskType uint16
const (
	TaskTypeGeneral TaskType = iota
	TaskTypeSearchQuery
	TaskTypeSearchDocument
	TaskTypeSemanticSimilarity
	TaskTypeClassification
	TaskTypeClustering
	TaskTypeFactVerification
	TaskTypeQA
)

func (TaskType) String

func (i TaskType) String() string

Jump to

Keyboard shortcuts

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