# AI Assistant for Connectors

The **AI Assistant for Connectors** is an AI-powered assistant available in specific connectors. It helps you configure your integrations more quickly by generating configuration content based on the input and context you provide.

## **How to use the** AI Assistant for Connectors

In supported connectors, you’ll see the **Write with AI** button. This means the connector has fields that can be configured with the help of AI.

<figure><img src="https://866970526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjvO5S91EQURCEhbZOuuZ%2Fuploads%2FcJIpXaI2H78DsBbNGd5W%2Fconnector-level-helper.gif?alt=media&#x26;token=885ce40b-8a0b-4d9d-975c-c22dab91f2a6" alt=""><figcaption></figcaption></figure>

Clicking the button opens a side panel next to the connector configuration form. In this panel, you can provide the following information:

* **Input**: Insert or upload a JSON file representing the expected input.
* **Output**: Insert or upload a JSON file representing the desired output.
* **Prompt**: Provide additional context or instructions to guide the AI.

The AI will analyze the data and generate a response directly in the connector’s configuration form.

{% hint style="info" %}
You can refine the AI’s response up to 5 times. After that, you’ll need to reset the AI to continue.
{% endhint %}

### **What are the supported connectors?**

* [**Transformer (JOLT) V2**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/tools/jolt-v2): Available in the **JOLT** field.
* [**REST V2**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/web-protocols/rest-v2): Available in the **Body** field when performing **POST** operations.

## **AI Assistant usage examples**

### **Transformer (JOLT) V2**

Let’s say you want to enrich customer data by adding a default birth date.

#### **AI configuration**

**Input:**

```json
{
  "customer": {
    "name": "Customer Default",
    "ssn": "123-45-6789"
  }
}
```

**Output:**

```json
{
  "customer": {
    "name": "Customer Default",
    "ssn": "123-45-6789",
    "birthDate": "01/01/1970"
  }
}
```

**Prompt:**

Ensure that the output JSON includes the `birthDate` field, even if it’s missing from the input.

#### **AI-generated response**

The AI might generate the following JOLT specification:

```json
[
  {
    "operation": "default",
    "spec": {
      "customer": {
        "birthDate": "01/01/1970"
      }
    }
  }
]
```

{% hint style="info" %}
AI responses are generative, which means the structure and wording may vary slightly across attempts.
{% endhint %}

### **REST V2**

Suppose you want to transform user information into a transaction object, mapping the user’s `id`, `email`, and `name` directly, while populating the `role` field with a [Double Braces expression](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/double-braces) (`{{ message.role.id }}`).

#### **AI configuration**

**Input:**

```json
{
  "user": {
    "name": "Alice",
    "email": "alice@example.com",
    "id": 123
  }
}
```

**Output:**

```json
{
  "transaction": {
    "user_id": "",
    "contact": {
      "email": "",
      "full_name": ""
    },
    "role": ""
  }
}
```

**Prompt:**

Fill the **`"transaction"`** object with input user data (no Double Braces):

* `"user_id"` = user.id
* `"contact.email"` = user.email
* `"contact.full_name"` = user.name
* `"role"` = `{{ message.role.id }}`

{% hint style="warning" %}
By default, empty fields are populated with Double Braces expressions. If you don’t want them applied, make sure to indicate this in the prompt.
{% endhint %}

#### **AI-generated response**

The AI may produce the following JSON:

```json
{
  "transaction": {
    "user_id": 123,
    "contact": {
      "email": "alice@example.com",
      "full_name": "Alice"
    },
    "role": "{{ message.role.id }}"
  }
}
```

{% hint style="info" %}
AI responses are generative, so the structure and wording may vary slightly across attempts.
{% endhint %}
