In your bot's conversation design, each intent represents a unique user goal or action triggering a specific block.
Yet, users might say the same thing at different points in the conversation. For instance, one could expect to trigger a "yes" intent for different reasons. In this type of scenario, you can re-use the same intent (in this example: "yes") in different contexts.
Context acts as a differentiating factor, allowing the bot to understand the specific conditions under which the same intent should be interpreted differently.
For this tutorial, we’re going to use pizza bot where intent yes and no has been used in order_pizza flow and you want to use yes and no intent inside of free dessert flow.
For this tutorial, we’re going to use a pizza ordering bot where the intents yes and no are used in order_pizza flow. Now, we want to use yes and no intents inside the free dessert flow.
To do so, we need to add an output context to a block, and a required context to an Intent block.
To add an output context to your block:
1. Drag and drop a Message block into your flow.
2. Add a Text message.
3. Navigate to the NLP section within the tab bar.
4. Add an output context named free_dessert.
5. Click on Save.
1. Drag and drop an intent block onto your canvas and select the existing yes intent.
2. Again, head to the NLP section and add a required context.
3. Type free_dessert to match the output context created earlier. Please note that an intent can have multiple required contexts, since it can be re-used at different points in the conversation.
4. Click on Save.
Link the yes intent to a message block tailored for users who want the free dessert.
Creating a clear and understandable bot conversation flow is essential. While direct connection arrows to intent nodes aren't possible, enhancing your flow's clarity through visual connections between message blocks and intents is achievable. This approach visually delineates the conversation's progression and response logic based on user interactions.
To enhance your context visualisation on the canvas, we sugget to use Parent connections. Parent connections are nothing but a visual tool: they do not bear any logic.
To add Parent connections to your blocks with context:
1. Open the block that bears the ouput context.
2. Navigate to the Settings tab.
3. Under Parent dropdown, select the Free_dessert block.
4. Click Save.
See also: