Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
// Name returns the provider name (e.g., "openai", "ollama").
Name() string
// Dimensions returns the embedding dimensionality this provider produces.
Dimensions() int
// Embed returns one embedding per input string.
Embed(ctx context.Context, inputs []string) ([][]float32, error)
}
Provider defines a simple embeddings provider interface. Implementations should be concurrency-safe.
func NewFromEnv ¶
func NewFromEnv() Provider
NewFromEnv constructs a provider based on environment variables. EMBEDDINGS_PROVIDER: "openai", "ollama", "gemini", "vertexai", "localai", or empty for disabled.
type StaticProvider ¶
type StaticProvider struct {
N int
}
NewStaticProvider returns a deterministic provider for tests
func (*StaticProvider) Dimensions ¶
func (s *StaticProvider) Dimensions() int
func (*StaticProvider) Name ¶
func (s *StaticProvider) Name() string
Click to show internal directories.
Click to hide internal directories.