Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Provider string // "ollama" (default), "openai"
URL string // Provider-specific URL
APIKey string // API key (required for cloud providers)
Model string // Model name (optional, provider has defaults)
}
Config holds embedding provider configuration from environment variables.
type Embedder ¶
type Embedder interface {
Embed(ctx context.Context, texts []string) ([][]float32, error)
EmbedOne(ctx context.Context, text string) ([]float32, error)
}
Embedder converts text into vector embeddings. Implementations: Ollama (local), OpenAI, Voyage AI, etc.
type OllamaClient ¶
type OllamaClient struct {
// contains filtered or unexported fields
}
func NewOllamaClient ¶
func NewOllamaClient(baseURL string) *OllamaClient
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
OpenAIClient implements Embedder using the OpenAI embeddings API. Compatible with any OpenAI-compatible endpoint (OpenAI, Azure, Mistral, etc).
func NewOpenAIClient ¶
func NewOpenAIClient(apiKey string, opts ...OpenAIOption) *OpenAIClient
type OpenAIOption ¶
type OpenAIOption func(*OpenAIClient)
func WithOpenAIModel ¶
func WithOpenAIModel(model string) OpenAIOption
func WithOpenAIURL ¶
func WithOpenAIURL(url string) OpenAIOption
Click to show internal directories.
Click to hide internal directories.