We will be creating an assistant to take your orders at the Christmas drinks...
- Go to this link and create an account: https://ibm.biz/BdzkM9.
- If you already have an account, go to the same link and click Log in on the top right of the page to continue.
- Once logged in, click on
Catalogpositioned on the right-hand side of the topbar. - Search for
Assistant. - Under the
AICategory, click onWatson Assistant. - Scroll down and make sure
LitePlan is selected for the free plan. - Click
Create. - Click on
Launch Watson Assistant.
Once in the tooling, click the My first skill tile to go to the Skills section.
-
Once in the
Skillssection, clickCreate intent. -
Name the new intent
order-drink. -
Add a description of what the intent will do. For this, let's use "User wants to order a drink.".
-
Hit
Enterto create the intent. -
Start adding a few examples of how a user would order a drink (at least 5 examples are recommended). Click
Add exampleto add a sample line. Let's use the following lines:- I would like to order a gluhwein please
- I need something to drink
- order a wine
- a hot chocolate would be great
- a drink please
-
Open the
Try it Outpanel by clicking on the speech bubble in the upper right corner. This allows you to test how your assistant will respond. -
Wait for the assistant to finish training, then type
can I order something to drink. It should classify the intent as#order-drink. Even though you didn't train the intent on this exact sentence, Watson can still understand it.Note that because we haven't trained the assistant yet on how to respond, the answer is still
I didn't understand. You can try rephrasing.. This will change once we will create the dialog. -
Add a few more intents to make your assistant more robust. For this, click the
button, followed by the Create Intentbutton. Next, create the following intents and add a few examples to each:- #see-menu (User wants to see what's on the menu)
- #greetings (User greets the assistant)
- #thanks (User thanks the assistant)
Below the output of the finished intents:
Tip: Instead of creating general intents like greetings and thanks yourself, you can also add a set of intents from the content catalog. For this, browse in the menu on the left-hand side to Content Catalog. You'll see some industry specific sets, but also a general one. Click on Add to skill to add a set to your skill.
-
In the menu on the lef-hand side, click on
Entities. -
Click
Create entityand add the namedrink. Press Enter to actually create the intent. -
Turn
Fuzzy Matchingon if you want Watson to understand misspellings (should be on by default). -
Add a value
coffeewith the synonymcafe. ClickAdd valueto actually add the new value with its synonym. -
Complete this section by adding some additional values that you allow your users to order and any synonyms, for example:
- gluhwein
- hot chocolate
- wine
- beer
- cappuccino
-
Exit the page by clicking (1).
-
Click on
System entities(2) in theEntitiessection and turn on@sys-number.Here is how your finished entity
@drinkshould look:
- In the menu on the lef-hand side, click
Dialog. This brings you to the dialog that was already part of theMy first skillskill. - Click on the
Welcomenode if you would like to change the intro message. - Click
Add node, and name itGreetings. - Add your
#greetingsintent as the field forIf assistant recognizes. - Fill in a response that says something like "Hi! How can I help you today?".
- Create two more nodes for
#thanksand#see-menuand add responses. - Create another node and name it
Order Drink. - To the right of the name, click on
Customize. - Turn on
Slotsand hitApply. - Add the intent
#order-drinktoIf assistant recognizes. - Under
Check for, add the entity@drink. - Under
If not present, askadd a question like "What would you like to drink?". - Click
Add slot, and add a condition and prompt for@sys-number: "How many cups of $drink would you like?" (Note: the syntax$variableis short hand for accessing Context variables. Context variables allow you to pass information between your application and Watson Assistant). - Add in the response, "Ok, I have $number $drink coming right up!".
Below an example of the finished dialog tree with the Order Drinks node open:
🎄 🎄 🎅 🎅 CONGRATULATIONS!! 🎅 🎅 🎄 🎄
You successfully completed the lab!! Want to learn more? Try some of the following methods to bolster your Santa Holiday Assistant.
If your user orders a drink and completes the flow, and they try to make another order, the values found from the first flow will still be there so they will not be able to order something else. To fix this, we need to clear the context after a successful order so the values are not stored for the next order.
-
Create a node above the Slots node
Order DrinkscalledOrder Drinks - Clear Context. -
Set the condition to
#order-drink. -
In the
Assistant respondssection, click on the three button menu on the right and click onOpen context editor. -
Fill in both variables (
drinkandnumber) and set the values tonull. -
Click on the three dot menu on the right side of original Slots node
Order Drinks, and selectMove. Then, click the new context clearing node and move toAs Child Node(So, the parent node is the context clearing node, and the slots node is the child). -
Go to the section called
Then assistant shouldat the bottom of the context clearing node. SelectSkip user input. -
Try it out! Without clearing the try it out panel, order a drink. Once finished, try ordering another drink and it should prompt you for the two needed variables again. Here's what the finished context clearing node will look like:
Sometimes, you want an intent to be handled no matter where the user is in their flow. Think of Digressions as a global 'manage handlers': they allow you to respond to an intent even if a user is in the middle of a process flow, and then it allows them to return to their prior flow. If your user wants some help talking to the assistant anywhere in your assistant, this is a good intent to have digressions enabled.
-
Create a
#helpintent with examples like: "I need help". -
Create a node below your
Order Drinksnode. -
Add the condition of
#helpwith a response like: "I can help you order a Christmas drink!! Just say 'order drink' to get started!". -
Go into the
Customizeportion of the node by clicking in the upper right. -
Click on the
Digressionstab. -
Expand
Digressions can come into this nodeand enableReturn after digressions(Digressions should be on by default, this setting allows you to handle the intent and then return back to the flow). ClickApplyto complete this step. -
Now, to test this out, we need to get in the middle of our order drink flow. But first, since it is a slot, we need to go into the
Digressionstab in theOrder Drinksslots node. -
Turn on
Allow digressions away while slot fillingand check the option that only allows nodes with returns enabled. This will help you to control which nodes you want to allow to digress to. Finally, clickApplyto complete this step. -
Try it out by saying "order drink", then when asked for what kind of drink you want, say "help". You should see a response from your help node with another follow up message for the next slot filling question.






