summarize

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package summarize genera resúmenes de nodos del índice con un backend pluggable. El default de nem es heurístico (en internal/index, sin deps); acá viven los backends con LLM —Ollama (local) y una API compatible con OpenAI— para resúmenes ricos cuando el usuario los configura. Solo usa net/http: nem sigue Go puro.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config) error

Option configura el Summarizer.

func WithAPIKey

func WithAPIKey(k string) Option

WithAPIKey fija la API key (backend "api"). Si no, se usa OPENAI_API_KEY.

func WithEndpoint

func WithEndpoint(e string) Option

WithEndpoint fija el endpoint base del backend.

func WithModel

func WithModel(m string) Option

WithModel fija el modelo (p.ej. "llama3.2" en Ollama, "gpt-4o-mini" en API).

type Summarizer

type Summarizer interface {
	Summarize(ctx context.Context, title, text string) (string, error)
}

Summarizer produce el resumen de una sesión a partir de su texto.

func FromConfig

func FromConfig() (Summarizer, error)

FromConfig construye un Summarizer según ~/.nem/config.toml summarize. Devuelve (nil, nil) si el backend es vacío o "heuristic" (= usar el default heurístico del índice).

func New

func New(backend string, options ...Option) (Summarizer, error)

New crea un Summarizer para el backend dado: "ollama" | "api".

Jump to

Keyboard shortcuts

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