Entities
Entities are necessary when you collect data and information from a customer. In this article, you will learn what entities are, what built-in entities avatar has, and how to create a custom entity.
What are entities?
Avatar entities are data types that an avatar can extract from the customer speech if there is a task to collect some data from the customer. When you store data received from the customer, you can assign it a specific format — entity.
There are some built-in entities and there are custom entities that you can create yourself.
The built-in entities are:
Numbers and numeric values (systemNumber)
Date and time (systemTime)
Time ranges (systemTimeRange)
Time durations (systemDuration)
Measurement units and money (systemUnit)
Names and people (systemPerson)
Locations (systemLocation)
You can collect information from a customer, for example, with the help of avatar form state. When filling out the form, specify the entity
parameter in the form field to specify the type.
You can see the form state scenario example in the avatar scenarios article.
Creating custom entities
Sometimes, built-in entities are not enough to fulfill your needs. In this case, you can create custom entities.
For example, you have a pizza restaurant and want an avatar to understand when customers talk about different kinds of pizza. In this case, you can create a "pizza" entity, and give it some entries with your pizza types.
Let us see how it works. To create an entity:
- Log in to your control panel and go to the Avatar section.
- Choose an existing avatar, or create a new one.
- Go to the Entities section within an avatar.
- To add a new entity, click the Add button.
An avatar application can have up to 128 custom entities.
- Give the entity a name. You use this name in the scenario when you specify the
entity
parameter. A custom entity's name cannot have more than 258 characters.
In our case, let us give the "pizza" name to our new entity type.
- After you create the entity, open it and add some entries.
In our case, the entries can be "pepperoni", "carbonara", "margherita" and other kinds of pizza you have.
Each custom entry can have up to 100000 entry values.
- You can add some synonyms for each entry.
You need synonyms in case a customer calls your pizza with a mistake, for example, "carbanana" instead of "carbonara". Avatar understands the correct entry by analyzing all the synonyms and fills out the form.
Each custom entry can have up to 32 synonyms.
After you close your new entity, it is ready for your scenario. Specify it in the entity
parameter to the form field the same as the built-in entity, to specify the type of this field.