nomicembedder

package
v0.2.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder struct {
	// contains filtered or unexported fields
}

func New

func New() *Embedder

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, texts []string) ([]embedder.Embedding, error)

Embed returns the embeddings for the given texts

func (*Embedder) WithAPIKey

func (e *Embedder) WithAPIKey(apiKey string) *Embedder

func (*Embedder) WithModel

func (e *Embedder) WithModel(model Model) *Embedder

func (*Embedder) WithTaskType

func (e *Embedder) WithTaskType(taskType TaskType) *Embedder

type Model

type Model string
const (
	ModelNomicEmbedTextV1 Model = "nomic-embed-text-v1"
	ModelAllMiniLML6V2    Model = "all-MiniLM-L6-v2"
)

type TaskType

type TaskType string
const (
	TaskTypeSearchQuery    TaskType = "search_query"
	TaskTypeSearchDocument TaskType = "search_document"
	TaskTypeClustering     TaskType = "clustering"
	TaskTypeClassification TaskType = "classification"
)

type Usage

type Usage struct {
	TotalTokens int `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

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