embed

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package embed implements the optional embeddings path decided in https://github.com/cheetahbyte/lore/issues/7: vector search is opt-in, never generated in-process (no bundled/local model, per the research on issue #6) — always an external API call.

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, texts []string) ([][]float32, error)
}

Embedder turns text into vectors via an external service.

type OpenAICompatible

type OpenAICompatible struct {
	HTTPClient *http.Client
	Endpoint   string // e.g. https://api.openai.com/v1 or http://localhost:11434/v1
	APIKey     string
	Model      string
}

OpenAICompatible talks to any embeddings endpoint that speaks the OpenAI /v1/embeddings request/response shape — this covers both configured providers from issue #3 (config.toml's embeddings.provider: "openai" or "ollama", since Ollama serves an OpenAI-compatible endpoint).

func New

func New(endpoint, apiKey, model string) *OpenAICompatible

func (*OpenAICompatible) Embed

func (o *OpenAICompatible) Embed(ctx context.Context, texts []string) ([][]float32, error)

Jump to

Keyboard shortcuts

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