Skip to main content

Interface: VisionResult

Defined in: packages/agentos/src/io/vision/types.ts:256

Aggregated result from the vision pipeline after all configured tiers have run. Contains the best extracted text, content classification, optional embeddings, and detailed per-tier breakdowns.

Example​

const result = await pipeline.process(imageBuffer);

// Best extracted text across all tiers
console.log(result.text);

// What kind of content was detected
console.log(result.category); // 'printed-text' | 'handwritten' | ...

// CLIP embedding for similarity search
if (result.embedding) {
await vectorStore.upsert('images', [{ embedding: result.embedding }]);
}

// Inspect individual tier contributions
for (const tr of result.tierResults) {
console.log(`${tr.tier} (${tr.provider}): ${tr.confidence}`);
}

Properties​

category​

category: VisionContentCategory

Defined in: packages/agentos/src/io/vision/types.ts:268

What kind of content was detected.


confidence​

confidence: number

Defined in: packages/agentos/src/io/vision/types.ts:265

Overall confidence score 0–1, taken from the winning tier.


durationMs​

durationMs: number

Defined in: packages/agentos/src/io/vision/types.ts:292

Total wall-clock processing time in milliseconds.


embedding?​

optional embedding: number[]

Defined in: packages/agentos/src/io/vision/types.ts:277

CLIP image embedding vector, when embedding tier is enabled.


failedTiers?​

optional failedTiers: VisionFailedTier[]

Defined in: packages/agentos/src/io/vision/types.ts:289

The tiers that were due to run and failed, each with its error; absent when none failed. A tier listed here is not in tiers.


layout?​

optional layout: DocumentLayout

Defined in: packages/agentos/src/io/vision/types.ts:280

Structured document layout, when Florence-2 ran.


regions?​

optional regions: VisionTextRegion[]

Defined in: packages/agentos/src/io/vision/types.ts:283

Bounding boxes for detected text regions from the winning tier.


text​

text: string

Defined in: packages/agentos/src/io/vision/types.ts:262

Best extracted text: from OCR, handwriting or layout, or from the cloud tier, which gives a description of the image with its text, or with cloudTask: 'transcribe' the text alone.


tierResults​

tierResults: VisionTierResult[]

Defined in: packages/agentos/src/io/vision/types.ts:274

Detailed results from each tier that ran, ordered by execution.


tiers​

tiers: VisionTier[]

Defined in: packages/agentos/src/io/vision/types.ts:271

Which tier(s) contributed to the final result.