Documentation
¶
Overview ¶
Package embed provides embedder implementations for Dory. Each implementation satisfies the [dory.Embedder] interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ollama ¶
type Ollama struct {
// contains filtered or unexported fields
}
Ollama implements the [dory.Embedder] interface using the Ollama local HTTP API.
func NewOllama ¶
func NewOllama(config OllamaConfig) *Ollama
NewOllama creates a new Ollama embedder with the given configuration.
func (*Ollama) Dimensions ¶
Dimensions returns the dimensionality of the vectors this embedder produces.
type OllamaConfig ¶
type OllamaConfig struct {
// Model is the Ollama model name, e.g. "nomic-embed-text".
Model string
// URL is the base URL of the Ollama HTTP API.
// Defaults to "http://localhost:11434" if empty.
URL string
// Dimensions is the dimensionality of the vectors this model produces.
Dimensions int
}
OllamaConfig holds the configuration for an Ollama embedder.
type OpenAI ¶
type OpenAI struct {
// contains filtered or unexported fields
}
OpenAI implements the [dory.Embedder] interface using the official OpenAI Go SDK. Reads the API key from the OPENAI_API_KEY environment variable by default.
func (*OpenAI) Dimensions ¶
Dimensions returns the dimensionality of the vectors this embedder produces.