Skip to main content
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:
export type ContentItem = | TextContentItem
  | ImageBufferContentItem
  | ImageUrlContentItem;

Examples

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",
  };
}