GPT enrichment setup

This page describes how you can setup a GPT enrichment in a few steps using the Metamaze endpoint.

Follow these easy steps to set up an enrichment to use OpenAI's GPT.

Prerequisites: OpenAI credentials

You will need the following OpenAI credentials:

  • API Key

  • Organisation ID

You can find and generate these in the OpenAI platform:

1. Go to the enrichments project settings and press the create button

2. Fill in the general tab

Metadata

For the metadata there are 2 different configurations: one on the entity level and the other document level.

Type: Entity

{
  "enrichment_name": "Force Majeure",
  "enrichment_type": "entity",
  "entity_name": [
    "Force Majeure Clause"
  ],
  "prompt": "Is it possible that the agreement is terminated, due to effects of Force Majeure?",
  "answers": [
    "Yes",
    "No"
  ],
  "OPENAI_API_KEY": "xxxxxxxx",
  "OPENAI_API_ORG": "xxxxxxxx"
}
FieldDescription

enrichment_name

has to be exactly the same as the name of the enrichment in project settings

enrichment_type

fixed value: 'entity'

entity_names

names of the entity to enrich

prompt

Prompt for GPT. The task to send as instruction to GPT model.

answers

[Optional] It’s an optional field (you can skip it) to define the exact answers with which GPT can answer. However, we would recommend defining short, clear answers like "Yes", "No" for 3 reasons. Mainly, it allows for a bigger chance that GPT will respond correctly with the exact desired answer and also ensures easier automatic processing. It is also cheaper since fewer tokens are used.

OPENAI_API_KEY

OPENAI_API_ORG

Type: Document

{
  "enrichment_name": "Currency",
  "enrichment_type": "document",
  "prompt": "In which currency is the document?",
  "answers": [
    "€",
    "$"
  ],
  "OPENAI_API_KEY": "xxxxxxxx",
  "OPENAI_API_ORG": "xxxxxxxx"
}
FieldDescription

enrichment_name

has to be exactly the same as the name of the enrichment in project settings

enrichment_type

fixed value: 'document'

prompt

Prompt for GPT. The task to send as instruction to GPT model.

answers

[Optional] It’s an optional field (you can skip it) to define the exact answers with which GPT can answer. However, we would recommend defining short, clear answers like "Yes", "No" for 3 reasons. Mainly, it allows for a bigger chance that GPT will respond correctly with the exact desired answer and also ensures easier automatic processing. It is also cheaper since fewer tokens are used.

OPENAI_API_KEY

OPENAI_API_ORG

3. Fill in the trigger tab

Nothing special here, just fill in when you want the GPT enrichment to be triggered.

4. Fill in the value type tab

Choose the "String" value type.

4. Fill in the webhook tab

5. Press create

Congratulations, you have now configured your GPT enrichment! You can now start processing documents powered by Open AI's GPT.

Last updated