> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ContentItem

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 variants:

* `TextContentItem`: [TextContentItem](../type-references/TextContentItem) for text data extraction
* `ImageBufferContentItem`: [ImageBufferContentItem](../type-references/ImageBufferContentItem) for image data stored as bytes buffer
* `ImageUrlContentItem`: [ImageUrlContentItem](../type-references/ImageUrlContentItem) for image data accessible via URL

```python theme={null}
type ContentItem = TextContentItem | ImageBufferContentItem | ImageUrlContentItem
```

## Examples

<CodeGroup>
  ```python Text Content theme={null}
  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"
      }
  ```

  ```python Image Buffer Content theme={null}
  from intuned_browser.ai import ImageBufferContentItem
  async def automation(page, params, **_kwargs):
      # Assuming you have image data as bytes
      with open("image.png", "rb") as f:
          image_data = f.read()

      image_content: ImageBufferContentItem = {
          "type": "image-buffer",
          "image_type": "png",
          "data": image_data
      }
  ```

  ```python Image URL Content theme={null}
  from intuned_browser.ai import ImageUrlContentItem
  async def automation(page, params, **_kwargs):
      image_content: ImageUrlContentItem = {
          "type": "image-url",
          "image_type": "jpeg",
          "data": "https://example.com/image.jpg"
      }
  ```
</CodeGroup>
