Image Extraction
This Engine extracts data from any image into your desired structure.
Image Extraction Engine Inputs
Image Extraction Configuration
The Image Extraction Engine Configuration has four parameters that take in values:
- instruction: optional. A string used to prompt the Agent during job execution.
- image: required. The image to extract from.
- model: required. The model to use for extraction.
- output_schema: optional. Defines the exact structure of the JSON output that the extracted data will populate. Follows the standard JSON schema specification.
See Template Strings for dynamic parameter configuration.
Image Extraction Output
The output will always be a JSON value of the structure specified in the output_schema (if you defined it).
Image Extraction Example
Let’s run through an example using this engine together.
Create an Agent
Click on the “Add Agent” button in the top right corner of the Agents page.
Enter a name and an optional description of your Agent.
Select the Image Extraction Engine
Configure the engine as follows
-
instruction: $instruction
-
image: $image
-
model: $model
-
output_schema: Copy and paste the JSON schema below (hit Use Text).
{
"type": "array",
"description": "An array of line items",
"items": {
"type": "object",
"properties": {
"item_name": {
"type": "string",
"description": "Name of the item"
},
"unit_price": {
"type": "number",
"description": "Price per unit item"
},
"final_price": {
"type": "number",
"description": "Final total price of the line item"
}
},
"description": "Invoice line item"
}
}
You can click Use Widget to then view the JSON schema in the UI.
Create the Agent
Hit the Create button. Now, let’s run it on an image through the UI.
View the Agent you just created
Create a new Agent job
Fill in the Agent inputs
Leave instruction empty.
image: Download and use this image
model: gpt-4o
Here are the filled-in Agent inputs:
Run the job
Hit the Create button at the bottom to start the image extraction job.
View the Results
Click View of the respective job to view its status and results.
Scroll down the Agent Job Details page and you’ll see the job outputs.