# GPT enrichment setup

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:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td></td><td><img src="/files/OC0g5toRfjRKAIn9F2DW" alt=""></td><td></td><td></td></tr><tr><td></td><td><img src="/files/2mYkYXtiSny3Ft58qUII" alt=""></td><td></td><td></td></tr></tbody></table>

## 1. Go to the [enrichments project settings](/project/project-settings/enrichments.md) and press the create button

<figure><img src="/files/t7I4MXVEuI4AptN5JPEE" alt=""><figcaption></figcaption></figure>

## 2. Fill in the [general tab](/project/project-settings/enrichments.md#general-settings)

<figure><img src="/files/SarwRu9cofootVyp4TPU" alt=""><figcaption></figcaption></figure>

### Metadata <a href="#metadata-examples" id="metadata-examples"></a>

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

#### **Type: Entity**&#x20;

```json
{
  "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"
}
```

<table><thead><tr><th width="236">Field</th><th>Description</th></tr></thead><tbody><tr><td>enrichment_name</td><td>has to be exactly the same as the name of the enrichment in project settings</td></tr><tr><td>enrichment_type</td><td>fixed value: <code>'entity'</code></td></tr><tr><td>entity_names</td><td>names of the entity to enrich</td></tr><tr><td>prompt</td><td>Prompt for GPT. The task to send as instruction to GPT model.</td></tr><tr><td>answers</td><td>[Optional]<br><br>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.</td></tr><tr><td>OPENAI_API_KEY</td><td>API Key (see <a data-mention href="#prerequisites-openai-credentials">#prerequisites-openai-credentials</a>)</td></tr><tr><td>OPENAI_API_ORG</td><td>Organisation ID (see <a data-mention href="#prerequisites-openai-credentials">#prerequisites-openai-credentials</a>)</td></tr></tbody></table>

#### **Type: Document**

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

<table><thead><tr><th width="236">Field</th><th>Description</th></tr></thead><tbody><tr><td>enrichment_name</td><td>has to be exactly the same as the name of the enrichment in project settings</td></tr><tr><td>enrichment_type</td><td>fixed value: <code>'document'</code></td></tr><tr><td>prompt</td><td>Prompt for GPT. The task to send as instruction to GPT model.</td></tr><tr><td>answers</td><td>[Optional]<br><br>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.</td></tr><tr><td>OPENAI_API_KEY</td><td>API Key (see <a data-mention href="#prerequisites-openai-credentials">#prerequisites-openai-credentials</a>)</td></tr><tr><td>OPENAI_API_ORG</td><td>Organisation ID (see <a data-mention href="#prerequisites-openai-credentials">#prerequisites-openai-credentials</a>)</td></tr></tbody></table>

## 3. Fill in the [trigger tab](/project/project-settings/enrichments.md#triggers)

<figure><img src="/files/cVhGG5nAbNFT7qDpPhlP" alt=""><figcaption></figcaption></figure>

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

## 4. Fill in the [value type tab](/project/project-settings/enrichments.md#value-type)

<figure><img src="/files/LHILUCLAev4FKCud0D2x" alt=""><figcaption></figcaption></figure>

Choose the "String" value type.

## 4. Fill in the [webhook tab](/project/project-settings/enrichments.md#webhook)

<figure><img src="/files/FDIAhek8GolsGfkyZR2C" alt=""><figcaption></figcaption></figure>

## 5. Press create

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.app.metamaze.eu/project/project-settings/enrichments/gpt-enrichment-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
