embed

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 7 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 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