VOGO Voice – Knowledge Base

Switch ABC

Estimated reading time: 4 min

Switch component when configured into an interaction flow adopts a choice based mechanism that permits to switch paths based on the incoming choice/user – input value. The user’s choice captured through switch input is evaluated and compared with the values added within the component displayed as cases to determine the flow of execution of the multi-branched paths. 

This instructional tutorial is dedicated towards enabling users to understand the functionality of the Switch component through an active interaction model. Let’s outline the process by citing a food related example where the Switch component is employed to serve the purpose of handling multiple option type interaction to provide information about the calories in a specific food type based on the user’s choice.

Prerequisites

  •  VOGO Voice account: https://www.vogovoice.com/
  • Access rights to the Slots and Intents section under Settings.
  • Access rights to Interaction builder platform.

Steps to create a custom slot titled ‘FOOD_TYPE’

  1. Log into your VOGO Voice account to be directed to VOGO Voice Management Console (https://account.vogovoice.com)
  2. Navigate to Settings on the top right-hand corner of the screen and select Slots from the list of tabs displayed. 
    Settings > Slots
  3. Click on the create New Slot button on the bottom right-hand corner of the screen.

4. In the Add New Slot pop-up window that appears, create a slot by the name FOOD_TYPE and add hamburger,
hotdog and pizza as slot values together with defining its respective synonyms. When finished click the Save button
at the bottom of the window.

To learn how to create custom slots refer the guide: https://university.vogovoice.com/kb/guide-creating-custom-slots/

Steps to create a ‘Calories in Food type’ Intent

In order to execute an interaction flow for the users to gather information about the calories in various food types, you need to create a custom intent to be invoked through the skill. 

Create an intent titled ‘Calories in Food type’ with a set of suitable sample utterances mapped to it. Let’s say the sample utterances are: “What are the calories in {food}”, “How many calories in {food}”, “How many calories are there in {food}”,  where ‘food’ is the slot name. Assign the slot type to FOOD_TYPE, which is the custom slot created in the initial part of the tutorial with suitable values assigned to it. 

To learn how to create custom intents refer the guide: https://university.vogovoice.com/kb/creating-intents/

How to create a ‘Calories in Food type’ interaction.

Now that we have created a Calories in Food type intent, let’s create an interaction flow associated with the intent to be executed through the skill.

  1. Navigate to Interactions on the vertical bar displayed on the left-hand side of the Dashboard.
  2. Click on the Interaction button at the bottom right-hand corner of the screen and select the ‘Calories in Food type’ intent to be directed into the Interaction builder platform. 

3. In the flow diagram area you will be able to see the Start and Response component.
4. Drag and drop the Switch component into the flow diagram area.
5. Connect the Start component to Switch, and configure the component to proceed with the interaction flow.
1. Click the Edit symbol on the top right-hand side of the component card  and add the switch input in the field
titled Value to capture the user specific incoming choice.  
2. Set the data type as path as the syntax used for switch input (inputs.<slot name>.value) represents a path.
Here, the syntax statement for Switch input will be inputs.food.value, where ‘food’ is the slot name.

👍 Note: Another alternative to populate the switch input would be by navigating to value within the input under Data next to the Components tab on the left hand side of the interaction builder platform. 
Data>input>value
Click and drag the value to drop it within the Value field of switch input. The syntax of the displayed value will show up as inputs.<slot name>.value

6. Click on the ‘+’ symbol under Cases and add the suitable values to be displayed as case labels on the component card.
The values added within the component should be the same as the slot values assigned in FOOD_TYPE. Here, the
cases will be hamburger, hotdog and pizza.   
1. Set the data type for each of these cases as string. They will need to match the same spelling as the slot
name. All synonyms will be appropriately mapped to the main slot name and link to the correct case.

To know about the different data types refer https://university.vogovoice.com/kb/data-types-functions/

7. Drag and drop 4 Response components into the flow diagram area out of which 3 should be chained to the anchor
symbol of each of the cases on the Switch card. The 4th Response card should be linked to the Default case. 

To know more about the Switch component refer the guide: https://university.vogovoice.com/kb/switch/

8. Roll the mouse over each of the Response component to see the voice, computer and camera icon on the top right-
hand side of the component.
9. Clicking on the Voice icon opens up a Speak pop-up window with a field titled Say wherein you need to type the voice
action intended to be spoken to the user in regard to the intent to provide information on the calories in different food
types.
To proceed further based on the voice action conveyed through Say, you may include an Expect Response. 

10. Similarly type in suitable voice messages in the Say field of the Response cards chained to Case hotdog and Case
pizza respectively.
11. Provide a relevant voice message in the Response card linked to Default case as well.

To learn more about the additional parameters in the Response component visithttps://university.vogovoice.com/kb/guide-response-component/

12. After populating the relevant fields click the Save button.

To add a display message

  1. Click on the Computer icon, and type in a condensed version of the voice message in the field titled Display Message of the Show pop-up window.
  2. Populate the required fields and click the Save button. 

3. Similarly type in suitable display messages in the Response cards chained to Case hotdog and Case pizza respectively.

For further reference on how to populate the additional fields visit https://university.vogovoice.com/kb/guide-response-component/

Testing and Validation

  1. Click on the Test button next to the Flow Editor button on the interaction builder platform. 

2. In the Tests pop-up window that appears click the + button on its top right-hand corner. 

3. Fill the Name field of the Test Response window that shows up, then populate the field titled ‘With slots’ under
Conversation with any one of the defined cases to test its response and click the Save button.

4. To validate the Test Response, click on the lightning symbol on the left-hand side of the test case. 

5. On the resultant Test Response window, the blue chat bubble will cumulatively present the previously input messages
within the Response component chained to  Case hamburger. 

👍 Note: The value in the field titled With slots within the Test Response window can be replaced with other case values to test their respective responses. Leave the With slots field empty to test the default response.

6. Click on the chat bubble to see the details of the individual responses.

Congratulations! You have successfully configured a Switch component within a Calories in Food type interaction model for your skill.

👍 Note: To test the functioning of the Calories in Food type interaction on your device you have to deploy the custom skill to facilitate the skill with the new edits. To accomplish this, click on the Deploy button seen at the bottom of the Skill Settings pop-up window.

To know how to deploy a custom skill visit https://university.vogovoice.com/kb/deploying-a-skill/

Tags:
Was this article helpful?
Dislike 0
Previous: Learn More
Next: How to Integrate Twitter Feed without Emoji