embeddings

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package embeddings provides a vector embedding interface with implementations for OpenAI, Ollama, and Cohere providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	GenerateEmbedding(ctx context.Context, input *Input) (*Embedding, error)
}

Embedder generates vector embeddings for text.

func NewNoopEmbedder

func NewNoopEmbedder() Embedder

NewNoopEmbedder returns an Embedder that returns an empty vector and no error. Intended for tests and local development.

type Embedding

type Embedding struct {
	GeneratedAt time.Time
	SourceText  string
	Model       string
	Provider    string
	Vector      []float32
	Dimensions  int
}

Embedding is the result of embedding a single piece of content. It carries provenance alongside the vector so that re-embedding and ETL pipelines can be driven from the stored result alone.

type Input

type Input struct {
	// Content is the text to embed.
	Content string

	// Model optionally overrides the provider's configured DefaultModel.
	// Leave empty to use the default from the provider's Config.
	Model string
}

Input is the content to be embedded.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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