Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesAsVec ¶
BytesAsVec converts a raw byte blob back to a float32 vector.
func VecAsBytes ¶
VecAsBytes converts a float32 vector to a raw byte blob (for DB storage).
Types ¶
type Embedder ¶
type Embedder interface {
Embed(texts []string) ([][]float32, error)
Dims() int
Name() string // unique key for caching, e.g. "openai-3small-512"
}
Embedder produces vector embeddings from text.
func NewFromProvider ¶
NewFromProvider constructs an Embedder by provider name. "auto" (default) tries ollama first, falls back to openai. "ollama": model and baseURL are optional (defaults apply). "openai": reads OPENAI_API_KEY from environment.
Click to show internal directories.
Click to hide internal directories.