An entity is a list of values and their synonyms that provides us a predefined database.
Each parameter has a type, called entity type, which is used to extract and validate pieces of data from a user’s natural language input, using the predefined database.
You can also create or import your own entity for matching custom data. For example, define a size entity that can match the types of sizes available in a pizza delivery agent.
- 1.In the left navigation, click on Properties --> Entities.
- 2.A drawer is going to open on the right, click ‘Create Entity’ on the top right.
- 3.Name the entity - for example “size” and click ‘Add new Entity Value’.
- 4.Add new entity values - for example, “small”, “medium”, and “large”, and if there are synonyms (see explanation below) add them to each value to help the agent identify more types of inputs (i.e. synonym for “large” can be “big”, "max", etc.).
- 5.To save a value, press anywhere on the screen to save.
- 6.Don't forget to hit "save" once you're done adding new values.
Sometimes there are more than one or two words that have the same or nearly the same meaning. For example, if asked "What pizza size do you want", you can answer “large” or “big” and even “huge”. To accommodate any possible user response, it’s important to add as many synonyms as you can.
Only relevant for voice agents.
If your agent is utilizing human voice recordings instead of the available robotic voices, it only makes sense to also add recordings to your entity values. Either add the recording on the spot or select it from the drop-down which shows all recordings from the Recordings Property.
Afterward, you will be able to use these recordings throughout the flow. E.g. in a Speak node.
The agent will ask the user "Which pizza size is right for you today?" and the user might answer "large". If you wanted to confirm the user's choice with "I got that you want to order a large pizza, is that correct?", the agent will be able to use the entity value of "large" using the attached recording.
Let's say in your flow, you are collecting some amount from the user with the parameter "NUMBER". Therefore, you have created an entity called "numbers" with recordings for each number 1, 2, 3, etc.
In the Collect Input or Listen node, you choose a parameter or you can create it on the spot. In this case, we are creating our "NUMBER" parameter with the "numbers" entity right there and then.
The agent will now be able to give out the value of the number collected utilizing the recording from the entity.
If you want to use the recorded response of a values in a Speak node, you can do so by clicking on the "Audio" option next to "Text to Speech" and then "Use Parameter".
- 1.When in the entities window, click 'Import Entity' on the top right.
- 2.The AI Studio will prompt you to select the relevant file from your device. The format of the file should be CSV. Make sure you format the file in a way that is compatible with the agent. Please see the correct format below. The name of your file will be the name of the entity.
- 3.If needed, you can always make changes to the entity. Don't forget to hit "save" once you're done adding new values.
You can export an entity by clicking on the little export symbol on the right of the entity. This will export a CSV file containing all values and synonyms of the entity.
The agent has predefined data that exists in all the agents you have created.