vision

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package vision converts standalone image files (.png, .jpg, ...) to markdown by describing them with a vision LLM. The emitted markdown carries a `type: image` frontmatter and is then parsed, chunked and indexed like any other document — no change to the indexing layer.

Index

Constants

This section is empty.

Variables

View Source
var DefaultExtensions = []string{".png", ".jpg", ".jpeg", ".webp", ".gif"}

DefaultExtensions are the image formats accepted by the mainstream vision providers, and the extensions routed to this converter when none are given.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter turns an image file into its markdown description.

func NewConverter

func NewConverter(describer vision.Describer, extensions ...string) *Converter

NewConverter builds a converter routing extensions (DefaultExtensions when none are given) to describer.

func NewConverterWithOptions

func NewConverterWithOptions(describer vision.Describer, extensions []string, funcs []Option) *Converter

NewConverterWithOptions is NewConverter with the extra options; it exists because the extension list is variadic.

func (*Converter) Convert

func (c *Converter) Convert(ctx context.Context, filename string, r io.Reader) (io.ReadCloser, error)

Convert implements convert.Converter.

func (*Converter) SupportedExtensions

func (c *Converter) SupportedExtensions() []string

SupportedExtensions implements convert.Converter.

type Option

type Option func(*Converter)

Option configures a Converter.

func WithBlobStore

func WithBlobStore(store blob.Store) Option

WithBlobStore stores the converted image and references it in the emitted markdown as `![title](amoxtli://images/<hash>)`, so an agent can ask for the image back (see the fetch_image MCP tool) instead of only reading about it. It also fixes the dead-link problem: the image is served from the store even if the original file has moved.

Jump to

Keyboard shortcuts

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