Replies

A reply is a sentence that will be sent by the bot based on the logic defined in Stories.

A reply can have multiple variations. Whenever the bot is supposed to send a given reply, it will pick one of the variations at random. The star icon lets you choose which variation will be visible in AEI Studio, but it has no weight in terms of which one will be picked by the bot. The more variations you add, the more your bot will sound human. On the other hand, if you only have a single variation, the bot will always answer to a particular intent in the same way, making it feel more “robotic”.

Using Slots in Replies

Next to each variation is a slot menu that lets you choose among your slots. This is useful if you want to insert a slot in the middle of a sentence.

Let’s imagine you saved the user’s name into a slot called Name. You can then create a reply with the sentence “Hi Name, how are you?”. Name will be replaced by the actual value of the slot.

Plurals

If you insert a slot of type Number in a reply and click on that slot, a menu appears and lets you change a part of the sentence based on the value of the slot. This is useful to handle pluralization, i.e. when a word should be written differently whether the quantity is zero, one or more.

We want the bot to reply something like “You ordered x items.”, x being a slot. If x is 1, we shouldn’t say “1 items”, but “1 item” or “an item”.

By clicking on the slot and selecting the Plural option, you can input how to express the item quantity for each of the cases: Default (more than one), Zero and One. # will be replaced by the actual number.

reply plural

Ordinal Numbers

You can use the same feature to handle ordinal numbers, as shown in the example below:

reply ordinal

Date Formatting

By clicking on a slot of type Date inside a reply, you can choose how to format the date for display. It is possible to display only the date, only the time or any combination of years, months, days, hours, etc. You should input an ICU Format and the bot will apply it accordingly.

The following example will display dates like this: 1985/11/22 05:20

reply date