Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embedder ¶
type Embedder interface {
// Embed returns a vector embedding for the given text.
Embed(ctx context.Context, text string) ([]float32, error)
// EmbedBatch returns vector embeddings for multiple texts.
EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)
// Dimension returns the embedding vector dimension.
Dimension() int
}
Embedder generates vector embeddings from text.
type OllamaEmbedder ¶
type OllamaEmbedder struct {
// contains filtered or unexported fields
}
OllamaEmbedder implements Embedder using the Ollama HTTP API.
func NewOllamaEmbedder ¶
func NewOllamaEmbedder(baseURL, model string, dimension int, logger *slog.Logger) *OllamaEmbedder
NewOllamaEmbedder creates a new Ollama-based embedder.
func (*OllamaEmbedder) Dimension ¶
func (o *OllamaEmbedder) Dimension() int
func (*OllamaEmbedder) EmbedBatch ¶
Click to show internal directories.
Click to hide internal directories.