embed

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package embed chunks notes and obtains local embedding vectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunks

func Chunks(title, body string) []string

Chunks prefers paragraph ends near 200 words and carries forty words forward. Oversized paragraphs split at the word limit. Even an empty note embeds its title.

Types

type Embedder

type Embedder interface {
	Embed(context.Context, []string) ([][]float32, error)
	Model() string
}

type ErrUnavailable

type ErrUnavailable struct{ URL, Model, Reason string }

func (*ErrUnavailable) Error

func (e *ErrUnavailable) Error() string

type Ollama

type Ollama struct {
	URL, ModelName string
	Client         *http.Client
}

func (Ollama) Embed

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

Embed sends at most sixteen inputs per request; failures never return partial vectors.

func (Ollama) Model

func (o Ollama) Model() string

Directories

Path Synopsis
Package embedtest provides a deterministic local Ollama double.
Package embedtest provides a deterministic local Ollama double.

Jump to

Keyboard shortcuts

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