vision

package
v0.3.34-beta Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package vision provides provider-neutral image preprocessing helpers.

Index

Constants

View Source
const (
	ViewImageMaxWidth  = 2048
	ViewImageMaxHeight = 768
)

Variables

This section is empty.

Functions

func MetadataFromResult

func MetadataFromResult(result *Result) *tooltypes.ViewImageMetadata

MetadataFromResult converts a processed image result into structured metadata.

func NormalizeViewImageDetail

func NormalizeViewImageDetail(detail, model string) (string, error)

NormalizeViewImageDetail validates and normalizes the optional detail field.

func SupportsImageInputs

func SupportsImageInputs(provider, model string) bool

SupportsImageInputs reports whether the current provider/model combination can accept image inputs.

func SupportsViewImageOriginalDetail

func SupportsViewImageOriginalDetail(model string) bool

SupportsViewImageOriginalDetail returns true when the model supports the optional original detail mode.

Types

type Result

type Result struct {
	Path      string
	ImageURL  string
	MimeType  string
	Width     int
	Height    int
	Detail    string
	Assistant string
}

Result stores the processed image payload used across providers.

func MakeViewImageResult

func MakeViewImageResult(path string, detail string, model string, provider string) (*Result, error)

MakeViewImageResult validates and preprocesses a local image path into a provider-neutral data URL plus dimensions metadata.

Jump to

Keyboard shortcuts

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