vision

package
v0.554.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

func New

func New(client *anthropic.Client, model string) *Analyzer

func (*Analyzer) AnalyzeBase64

func (a *Analyzer) AnalyzeBase64(ctx context.Context, b64data string, question string) (string, error)

func (*Analyzer) AnalyzeBase64WithConfidence added in v0.54.0

func (a *Analyzer) AnalyzeBase64WithConfidence(ctx context.Context, b64data, question string, threshold confidence.Score) (Result, error)

AnalyzeBase64WithConfidence mirrors AnalyzeFileWithConfidence for data-URL / raw-base64 inputs.

func (*Analyzer) AnalyzeFile

func (a *Analyzer) AnalyzeFile(ctx context.Context, path string, question string) (string, error)

AnalyzeFile remains the legacy string-only entry point for callers that don't care about confidence routing. New callers should prefer AnalyzeFileWithConfidence so they can route low-confidence results to a clarifying user-facing question.

func (*Analyzer) AnalyzeFileWithConfidence added in v0.54.0

func (a *Analyzer) AnalyzeFileWithConfidence(ctx context.Context, path, question string, threshold confidence.Score) (Result, error)

AnalyzeFileWithConfidence is the P3-29 entrypoint. threshold is the per-call abstention threshold; pass 0 to use confidence.DefaultClassifierThreshold. Behaviour matches AnalyzeFile when the model doesn't emit a confidence signal — Result.Text is populated with the original prose and LowConfidence is false.

type Result added in v0.54.0

type Result struct {
	Text          string
	Confidence    confidence.Score
	HasConfidence bool
	LowConfidence bool
}

Result is the typed envelope returned by AnalyzeWithConfidence (roadmap P3-29). Text is the model's natural-language identification of the device / remote / tag / label in the image. Confidence is the model's self-graded certainty in [0, 1]; HasConfidence reports whether the model actually emitted a confidence value (a `false` here means "no signal — treat Confidence as the default 1.0 only for the purpose of comparing against thresholds, not as a true claim of certainty"). LowConfidence is precomputed against the caller-supplied threshold so the operator-facing renderer can flip to a clarifying-question UX.

Jump to

Keyboard shortcuts

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