extract_from_image: Extract Structured Data From Image

View source: R/image_api.R

extract_from_imageR Documentation

Extract Structured Data From Image

Description

Extract schema-constrained structured data from an image using a multimodal language model.

Usage

extract_from_image(
  model,
  image,
  schema,
  prompt = "Extract the requested structured information from this image.",
  system = NULL,
  registry = NULL,
  ...
)

Arguments

model

A LanguageModelV1 object or provider:model string.

image

Image source accepted by input_image().

schema

A z_schema object used as response_format.

prompt

Prompt describing the extraction task.

system

Optional system prompt.

registry

Optional provider registry.

...

Additional arguments passed to generate_text().

Value

A GenerateResult.


aisdk documentation built on May 29, 2026, 9:07 a.m.