cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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.

 

Add context to your bot

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.

 

Add an output context to a block

To add an output context to your block: 

1. Drag and drop a Message block into your flow.

2. Add a Text message.

 

Screenshot 2024-02-09 at 16.27.14 (1).png

3. Navigate to the NLP section within the tab bar.

4. Add an output context named free_dessert.

Screenshot 2024-02-09 at 16.29.30.png5. Click on Save.
 

Add a required context to your intent

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.

 

Screenshot 2024-02-09 at 16.42.45.png

 4. Click on Save.

 

Configure a response based on context

Link the yes intent to a message block tailored for users who want the free dessert.

Screenshot 2024-02-09 at 17.03.41.png

Enhancing flow visualization

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.

 

Screenshot 2024-02-09 at 17.06.45.png

4. Click Save.

 

See also:

Add an intent to your bot

Recognize expressions with intents

Canvas overview

Version history
Last update:
‎02-13-2024 08:18 AM
Updated by: