# Slots

Slots describe the input and output fields associated with the intents, which are used for processing the intent. These might also include the inputs for the Web API requests, if any, associated with the intent. You can define the Slots by using the slot button under the Action column.&#x20;

![Use Slot Button in Intents and Automation](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2FT7GF1vN9t3EfelRcznmZ%2Fintents-and-automation.PNG?alt=media\&token=a5dbc457-9553-4feb-aea3-2bd4ca15db19)

### **Define Slots**

![Slots](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2FLuUr6YfwXOPXGKUFfL8G%2FSlots-main-ui.JPG?alt=media\&token=32eedb9e-5d91-4060-88d6-05fae051746a)

Slots UI displays all the available (created) slots. You can create a new slot using the \`+\` button on the top right corner. Each slot are characterized by

* Name
* Display Name&#x20;
* Slot Type
* Custom Entity Type
* Allow Multiple
* Delay Template
* Only English
* Last Option
* Sensitive
* Actions

Name is a unique identifier of the type string to identify the slot. The slot can also have a display name. Slots Type defines the data type of the slot.&#x20;

Available data types include

* INTEGER
* DATE&#x20;
* TIME&#x20;
* NAME&#x20;
* ARTEFACT&#x20;
* LOCATION
* BOOLEAN
* CODE
* PAST\_DATE
* FUTURE\_DATE
* ADDRESS
* RELATIONSHIP
* PASS\_THROUGH
* PHONE\_NUMBER
* EMAIL\_ID
* NUM\_PLATE
* EVENTS
* SYSTEM FILLED
* QUERY\_PHRASE

{% hint style="info" %}
In addition to the in-build types, Dhee.AI also supports custom types. If the developer needs to select a Custom Type, the *\_Slot Type\_* needs to be set to *\_Custom\_* and *\_Custom Entity Type\_* needs to be set the user-defined custom entity type
{% endhint %}

The rest of the configuration options include

| Flag           | Description                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| Allow Multiple | If *true* indicates a list of values                                                                             |
| Delay Template | if *true* Entity based slot extraction has priority over template based extraction of slots                      |
| Only English   | If *true*, prioritize English values over the language of conversation. Useful for handling names                |
| Last Option    | If a conflict exists for the candidate for a slot, prefer capturing other slots before capturing the current one |
| Sensitive      | Mask the slot value before storing in conversation logs                                                          |

### **Templates**

In natural language, users often provide multiple information in a single sentence, especially in commonly used phrases. Consider the following examples

```
// Captures email id and phone number
You can contact me on a*****.gmail.com or 98******

// Captures Start and End Date of leaves
I would like to take a vacation from 24th till 29th of this month
```

Templates allow multiple slots to be captured together from User utterances. In the above examples, multiple slots can be captured from the slot from single sentences. To define a template, select the \`Template\` button under the *\_Action\_*.

![](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2Fg2y1aI9Nk1QpqV304Wnj%2FSlots-main-ui.JPG?alt=media\&token=63d62239-8920-475a-9fb1-a7bad2b2c809)

Templates allow multiple slots to be captured together from User utterances. In the above examples, multiple slots can be captured from the slot from single sentences. In order to define a template, select the `Template` button under the *Action*.

![](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2F0bCDiweKpcD30m9ym3D7%2Fslots-templates.JPG?alt=media\&token=9db66d33-e3e6-487e-9cfb-64c049c85cf9)

Templates are defined by using the `$slotName` syntax for capturing slots. For example, assuming we have *startDate* and *endDate* as our slot names, a template in a leave management application might look like

```
leaves from ${startDate} to ${endDate}
```

The Templates can be instructed to support multilingual functionality if the bot was designed to the multilingual. You can enable the functionality by using the *Auto-translate* flag.

We can use the *Templates* to read multiple inputs together from user utterances. For example, for the *startDate*, we can define the template as "*leaves from ${startDate} to ${endDate}*". This would ensure the *startDate* and *endDate* are filled when the user utterance is similar to any of the following.

### Prompts

In addition, you can also define *Prompts* for each of the slots if the User fails to provide the required inputs. These are the messages which the chatbot would ask the user when there is missing information. For example, for the *startDate* the prompt could be defined as

```
From when are you planning to go on leave?
```

![](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2Fff226OYOP59XPUMNDbHe%2Fslots-prompts_1.JPG?alt=media\&token=563564cf-1779-4a4a-a816-203e603b98f4)

Dhee.AI also allows configuring slots using prompts that show predefined values. For example, We could *prompt* the user for specifying the reason for leave application using predefined custom values. For example,

```
OK. Why do you want the leave ? [[EXT:BUTTON|Medical|Casual]]
```

This would show a prompt including the possible reasons for leave as shown in the image below.

![Predefined values in Prompt](https://2566128011-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUn1oKrw7P8P5qiTjWXjv%2Fuploads%2FtwMGTE9GwPt5Hywjg60B%2Fprompt-leave-reason.JPG?alt=media\&token=6cab3fa1-77f6-4659-8820-27f47e1f5a0e)
