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) EmbedSingle ¶
func (e *HttpEmbedder) EmbedSingle(text string) ([]float32, error)
type NoopEmbedder ¶
type NoopEmbedder struct{}
func (*NoopEmbedder) Available ¶
func (e *NoopEmbedder) Available() bool
func (*NoopEmbedder) EmbedSingle ¶
func (e *NoopEmbedder) EmbedSingle(string) ([]float32, error)
Click to show internal directories.
Click to hide internal directories.