embed

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	// Embed takes a slice of strings and returns a corresponding slice of float32 vectors.
	Embed([]string) ([][]float32, error)
	// EmbedSingle is a convenience method for embedding a single string.
	EmbedSingle(string) ([]float32, error)
	// Available indicates whether the embedder is properly configured and can be used.
	Available() bool
}

Embedder defines the interface for generating vector embeddings from text.

type HttpEmbedder

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

HttpEmbedder implements the Embedder interface by making HTTP requests to an embedding service.

func New

func New(conf config.Config) *HttpEmbedder

New creates a new HttpEmbedder with the given configuration.

func (*HttpEmbedder) Available

func (e *HttpEmbedder) Available() bool

func (*HttpEmbedder) Embed

func (e *HttpEmbedder) Embed(text []string) ([][]float32, error)

func (*HttpEmbedder) EmbedSingle

func (e *HttpEmbedder) EmbedSingle(text string) ([]float32, error)

type NoopEmbedder

type NoopEmbedder struct{}

func (*NoopEmbedder) Available

func (e *NoopEmbedder) Available() bool

func (*NoopEmbedder) Embed

func (e *NoopEmbedder) Embed([]string) ([][]float32, error)

func (*NoopEmbedder) EmbedSingle

func (e *NoopEmbedder) EmbedSingle(string) ([]float32, error)

Jump to

Keyboard shortcuts

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