vision

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package vision describes images via a secondary multimodal model. It exists so a non-vision main model can still work with screenshots and pasted images: the loop routes image blocks here, gets text back, and injects that text.

Two wire shapes are supported: an OpenAI-compatible /chat/completions endpoint (works with omlx / LM Studio / vLLM / hosted qwen-VL) and ollama /api/generate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Model    string
	Endpoint string
	APIKey   string
	API      string
}

Client points at a multimodal model. API selects the wire shape: "openai" (default) or "ollama". APIKey is optional (local servers skip auth).

func (Client) Describe

func (c Client) Describe(ctx context.Context, img []byte, mediaType, question string) (string, error)

Describe sends one image and returns the model's text description. mediaType is e.g. "image/png"; it defaults to image/png when empty. question overrides the default prompt.

Jump to

Keyboard shortcuts

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