Skip to content

Text Result

Base schema for modality-to-text results in Gen AI applications.

This module defines the foundational data structure for representing results from any modality conversion operation (image, audio, video). It provides: - Base class for all modality conversion results - Common fields and validation rules - Type hints for result attributes

TextResult

Bases: BaseModel

Base class for all modality-to-text operation results.

This class provides the foundation for structured results from any modality conversion operation, including: - Image Captioning - OCR / Scene Text Detection - Audio Transcription - Video Captioning

Attributes:

Name Type Description
result str

The extracted or generated text from the source. This is the primary output of any modality conversion operation. May be empty if the operation fails or no text is found.

tag str

A label identifying the type of conversion that produced this result (e.g. "captions", "ocr").

metadata dict[str, Any] | BaseModel | None

Additional metadata from the conversion process.