Intents and Slots

Now you taught your Assistant how to talk and how to listen. Perfect! This part is even more existing. Here you’ll learn how to make your assistant understand.

Let’s take a quick look at the code you’ve written so far:


    - name: My first step
      actions:
        - sendText: >
            Hello, World!
            Do you want a personal greeting?
        - getInput:

So after giving a general “Hello, World!” greeting (with help of sendText action) your Assistant will ask a user if he would want a more personal and maybe even warm welcome. And then an Assistant will switch to the listening mode with getInput action.

Head over to the Intents sections in the editor. You already will have one intent there called ok_great - just to get you started. But we’ll create a new one. Try to imagine what a user might say to the question “Do you want a personal greeting?

Let’s start small. A user may say yes, for example:

---
intents:
  ok_great:
    - 'OK'
    - 'Great'
  yes:
    - yes
    - sure
    - of course
    - go for it
    - yeah
    - I might
    - it would be nice

In the code above we defined one intent named yes and just below are all the possible variants how a user might say that (they are called utterances).

So someone who doesn’t talk a lot would just say: “Sure”, but there are folks out there who really give an effort and want to be polite, so they would go with something like “It would be nice”.

It’s your job as a designer of a voice app to come up with those variants. As you can imagine, people are different. And so is the way they choose to answer even simplest, straightforward questions. The more variants (utterances) you will provide for each intent, the more likely your voice app will be remembered as a good one.

The Assistants are as “smart” as we’ll make them.

Ok, let’s get back to our script. So now you’ve covered only one possible answer to the question “Do you want a personal greeting?”. Let’s introduce some negativity into our script:

---
intents:
  ok_great:
    - 'OK'
    - 'Great'
  yes:
    - yes
    - sure
    - of course
    - go for it
    - yeah
    - I might
    - it would be nice
  no:
    - no
    - nope
    - never
    - just leave me alone

Again, just take brief moment to appreciate how different human no can sound.

That was it for this chapter. You taught your Assistant how to understand some basic answers (and variants) different users can give.

In the next chapter you’ll learn how to teach your Assistant to decide