embed

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAll

func ApplyAll(cfg *config.Config, cmd *cli.Command)

ApplyAll calls Apply on all registered plugins that define one.

func Names

func Names() []string

Names returns all registered embedder plugin names.

func PluginFlags

func PluginFlags(cfg *config.Config) []cli.Flag

PluginFlags returns CLI flags contributed by all registered embedder plugins.

func Register

func Register(p Plugin)

Register adds an embedder plugin.

Types

type Embedder

type Embedder interface {
	// EmbedTexts returns a vector embedding for each input text, in the same order.
	EmbedTexts(ctx context.Context, texts []string) ([][]float32, error)
	// ModelName returns the model identifier used for embedding.
	ModelName() string
	// Dimension returns the dimensionality of the embeddings.
	Dimension() int
}

Embedder produces vector embeddings from text.

type Loader

type Loader func(ctx context.Context) (Embedder, error)

Loader creates an Embedder from config.

func Select

func Select(name string) (Loader, error)

Select returns the loader for the named embedder plugin.

type Plugin

type Plugin struct {
	Name   string
	Loader Loader
	Flags  func(cfg *config.Config) []cli.Flag
	Apply  func(cfg *config.Config, cmd *cli.Command)
}

Plugin represents an embedder plugin.

Jump to

Keyboard shortcuts

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