When defining a User Utterance Model, it is possible to encounter intents that require additional information from the user before processing can be done. For example, when setting an alarm, the intent requires knowledge of the time. If the user simply says "Set alarm", we would need to ask for more information, such as the time, to complete the task.
To obtain this additional information, we use a Slot-Filling Prompt, which is a type of entity that needs to be filled in by the user. The prompt is used to retrieve an entity that is necessary for processing the intent.
Defining Essential Entities
- In the Play Builder menu, click on Actions > Custom Actions and select the action that will use the Slot-Filling Prompt.
- Map the essential entity to the Utterance Parameter in the response needed section and check the "Required" box.
- Enter the Slot-Filling Prompt.
The Slot-Filling Prompt is a stack-based structure that follows the LIFO (Last In First Out) principle. Multiple prompts can be entered, and the last one entered will be used first.
If the user's response does not match the entity type specified in the prompt (e.g., asking for time instead of date), the next prompt will be triggered. The process continues until the first prompt is reached, at which point the session will be terminated.
Considerations when writing Slot-Filling Prompts
- Avoid repetitive prompting: Try to minimize the number of times you need to ask the user for information.
- Clearly guide the user's response: Make sure the user knows what they are being asked and provide clear guidance on how to respond.
- Limit the number of options: Provide no more than two options for the user to choose from.
Examples:
- Instead of asking "When would you like to do it?", ask "What time would you like to set the alarm?"
- Provide a clear example of what is expected, such as: "Do you want to pay? -> Yes" vs. "Do you want to pay? -> No"
By following these guidelines and using Slot-Filling Prompts effectively, you can create a more efficient and user-friendly conversational AI experience.