Skip to main content
ContentItem = Union[TextContentItem, ImageBufferContentItem, ImageUrlContentItem]
A union type representing content items for AI data extraction from various content types. This type alias defines the complete set of content types supported by the content-based extract_structured_data function for extracting data from text, image buffers, or image URLs without requiring a page source.

Type Information

TextContentItem
type
TextContentItem for text data extraction
ImageBufferContentItem
type
ImageBufferContentItem for image data stored as bytes buffer extraction
ImageUrlContentItem
type
ImageUrlContentItem for image data accessible via URL extraction

Examples

from intuned_browser.ai import TextContentItem
async def automation(page, params, **_kwargs):
text_content: TextContentItem = {
"type": "text",
"data": "John Doe, age 30, works as a Software Engineer at Tech Corp"
}