embed

package
v0.2.0 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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