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 ¶
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 ¶
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 ¶
SupportedExtensions implements convert.Converter.
type Option ¶
type Option func(*Converter)
Option configures a Converter.
func WithBlobStore ¶
WithBlobStore stores the converted image and references it in the emitted markdown as ``, 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.