> ## 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
extractStructuredData function for extracting data from text, image buffers, or image URLs
without requiring a page source.

**Type variants:**

* `TextContentItem`: [TextContentItem](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/ai/type-references/TextContentItem.md) for text data extraction
* `ImageBufferContentItem`: [ImageBufferContentItem](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/ai/type-references/ImageBufferContentItem.md) for image data stored as Buffer
* `ImageUrlContentItem`: [ImageUrlContentItem](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/ai/type-references/ImageUrlContentItem.md) for image data accessible via URL

```typescript theme={null}
export type ContentItem = | TextContentItem
  | ImageBufferContentItem
  | ImageUrlContentItem;
```

## Examples

```typescript Text Content theme={null}
import { TextContentItem } from "@intuned/browser";
import { BrowserContext, Page } from "playwright";

interface Params {}

export default async function handler(
  params: Params,
  page: Page,
  context: BrowserContext
) {
  const textContent: TextContentItem = {
    type: "text",
    data: "John Doe, age 30, works as a Software Engineer at Tech Corp",
  };
}
```

```typescript Image Buffer Content theme={null}
import { ImageBufferContentItem } from "@intuned/browser";
import { BrowserContext, Page } from "playwright";

interface Params {}

export default async function handler(
  params: Params,
  page: Page,
  context: BrowserContext
) {
  // Assuming you have image data as Buffer
  const imageData = fs.readFileSync("image.png");

  const imageContent: ImageBufferContentItem = {
    type: "image-buffer",
    image_type: "png",
    data: imageData,
  };
}
```

```typescript Image URL Content theme={null}
import { ImageUrlContentItem } from "@intuned/browser";
import { BrowserContext, Page } from "playwright";

interface Params {}

export default async function handler(
  params: Params,
  page: Page,
  context: BrowserContext
) {
  const imageContent: ImageUrlContentItem = {
    type: "image-url",
    image_type: "jpeg",
    data: "https://example.com/image.jpg",
  };
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.