Documentation
¶
Overview ¶
Package embeddings provides a thin wrapper around OpenAI-compatible /v1/embeddings endpoints for generating vector embeddings.
It reuses the go-openai client library and supports any OpenAI-compatible provider (OpenAI, Ollama, GitHub Copilot, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client generates vector embeddings via an OpenAI-compatible API.
type Config ¶
type Config struct {
// Provider is the provider name (e.g. "ollama", "openai").
// Used to look up base URL defaults when BaseURL is empty.
Provider string
// Model is the embedding model ID (e.g. "text-embedding-3-small",
// "nomic-embed-text").
Model string
// BaseURL overrides the provider's default endpoint.
BaseURL string
// APIKey for authentication (empty = "no-key" for local providers).
APIKey string
// Dimensions optionally requests truncated embeddings (0 = model default).
Dimensions int
}
Config holds connection settings for the embeddings provider.
Click to show internal directories.
Click to hide internal directories.