embed

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package embed provides text embedding adapters. v0.1 ships:

  • "none" — disabled; semantic_search falls back to substring search
  • "voyage" — Voyage AI HTTP API (recommended default for quality)
  • "openai" — OpenAI text-embedding-3-small/large
  • "local" — Ollama on localhost (e.g. nomic-embed-text)

Only the disabled embedder is implemented in v0.1's first cut. Real providers can be slotted in without changing the storage interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	Embed(ctx context.Context, text string) ([]float32, error)
	Dimension() int
	Name() string
	Enabled() bool
}

Embedder mirrors types.Embedder but is repeated here to avoid an import cycle with packages that pull only the embed adapter.

func Disabled

func Disabled() Embedder

Disabled returns an Embedder whose Enabled() reports false. Callers should route to substring search when this is in use.

func New

func New(provider, model, apiKey string, dim int) Embedder

New constructs an embedder by provider name. v0.1 only returns the disabled adapter for unknown/unimplemented providers and logs the situation upstream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL