vision

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectImageMIME

func DetectImageMIME(path string, data []byte) string

func LoadImageFromFile

func LoadImageFromFile(workDir, path string) ([]byte, string, error)

func LoadImageFromURL

func LoadImageFromURL(ctx context.Context, imageURL string) ([]byte, string, error)

func LoadImageFromURLWithOptions

func LoadImageFromURLWithOptions(ctx context.Context, imageURL string, opts web.URLSecurityOptions) ([]byte, string, error)

Types

type AnalyzeFn

type AnalyzeFn func(ctx context.Context, imageData []byte, mimeType, prompt string) (string, error)

AnalyzeFn performs vision analysis for a loaded image.

type AnalyzeWithDetailFn

type AnalyzeWithDetailFn func(ctx context.Context, imageData []byte, mimeType, prompt, detailLevel string) (string, error)

AnalyzeWithDetailFn performs vision analysis for a loaded image with the caller-requested image detail level.

type Tool

type Tool struct {
	AnalyzeFn               AnalyzeFn
	AnalyzeWithDetailFn     AnalyzeWithDetailFn
	AllowPrivateNetworkURLs bool
}

Tool analyzes images using a caller-supplied multimodal model function.

func (*Tool) Description

func (t *Tool) Description() string

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, raw json.RawMessage, workDir string) (agentsdk.ToolResult, error)

func (*Tool) InputSchema

func (t *Tool) InputSchema() json.RawMessage

func (*Tool) IsEnabled

func (t *Tool) IsEnabled(_ *agentsdk.RunContext) bool

func (*Tool) IsReadOnly

func (t *Tool) IsReadOnly() bool

func (*Tool) Name

func (t *Tool) Name() string

func (*Tool) NeedsApproval

func (t *Tool) NeedsApproval() bool

func (*Tool) TimeoutSeconds

func (t *Tool) TimeoutSeconds() int

Jump to

Keyboard shortcuts

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