Inputs

prompt (String | File): Description of the task to be performed. You can describe the desired output entities and define the output schema here. Can be uploaded in the form of a text file.

target (String | File): The data to extract from.

Output

The output will always be a stringified JSON value of the structure specified in the prompt input (if defined) containing the extraction results.

Example Usage

Let’s run through an example using this Agent together.

1

Download the invoice file

Click on Resources in the sidebar and then Roe Datasets.

Click on View dataset for the invoice-extraction-example dataset.

Click on Download to download the file.

2

Go to the Default Extraction Agent's details page

3

Create a new Agent job

4

Fill in the Agent inputs

prompt: Change to Input Text option and paste below prompt.

returns following structure: {
    from: {
        name: <from company name>
        address: <from company address>
    },
    recipient: {
        name: <recipient company name>
        address: <recipient company address>
    },
    line_items: [
        {
            name: <item name>
            quantity: <item quantity>
            cost: <item total cost>
        },
        <more line items>
    ],
    subtotal: <amount before tax>
    tax: <tax amount>
    total: <total amount due>
    note: <invoice note>
}

target: Upload the invoice file you downloaded.

5

Run the job

Hit the Create button at the bottom to start the extraction job.

6

View the Results

Click View on the respective job to view its status and results.

Scroll down the Agent Job Details page and you’ll see the job outputs.

Notice that the JSON output only contains the information we specified in the prompt and in the exact structure!