Documentation
¶
Overview ¶
Package vision provides provider-neutral image preprocessing helpers.
Index ¶
Constants ¶
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 ¶
NormalizeViewImageDetail validates and normalizes the optional detail field.
func SupportsImageInputs ¶
SupportsImageInputs reports whether the current provider/model combination can accept image inputs.
func SupportsViewImageOriginalDetail ¶
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.
func MakeViewImageResultBytes ¶
func MakeViewImageResultBytes(fileBytes []byte, label, detail, model, provider string) (*Result, error)
MakeViewImageResultBytes preprocesses a persisted image without a runner filesystem round trip. Artifact payloads are bounded to 32 MiB and 40 million decoded pixels before decoding.