function extractStructuredDataFromContent(content, options): Promise<any>

Extracts structured data from content items (text or images).

Examples

Parameters

content: TextContentItem | ImageBufferContentItem | ImageUrlContentItem | (TextContentItem | ImageBufferContentItem | ImageUrlContentItem)[]

The content items from which to extract the structured data.

options

options.dataSchema: ObjectSchema

The JSON schema of the data you’re trying to extract.

options.label: string

A label for this extraction process, used for billing and monitoring.

options.model: | "claude-3-opus" | "claude-3-sonnet" | "claude-3.5-sonnet" | "claude-3-haiku" | "gpt4-turbo" | "gpt-4o" | "gpt3.5-turbo"

The model to use for extraction.

options.prompt?: string

Optional. A prompt to guide the extraction process.

Returns

Promise<any>

A promise that resolves to the extracted structured data.