# 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="/files/ovOJjinEMZwpuUqBmPAO" 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**](/documentation/connectors-and-triggers/connectors/tools/jolt-v2.md): Available in the **JOLT** field.
* [**REST V2**](/documentation/connectors-and-triggers/connectors/web-protocols/rest-v2.md): 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](/documentation/connectors-and-triggers/double-braces/overview.md) (`{{ 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 %}


---

# 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.digibee.com/documentation/developer-guide/development-cycle/build-overview/canvas/connector-ai-assistant.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.
