function extractStructuredDataFromFile(file, options): Promise<any>

Examples

Parameters

file: ImageFile | PdfFile | SpreadsheetFile

the file you want to extract the data from,

options

options.dataSchema: JsonSchema

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.prompt?: string

optional, a prompt to guide the extraction process and provide more context.

options.strategy?: MarkdownFileStrategy | ImageFileStrategy

optional, the strategy to use for extraction. use IMAGE if the info you’re trying to extract is visual and cannot be converted to markdown. Defaults to MARKDOWN strategy with gpt4-turbo model.

Returns

Promise<any>