Actions on Google system entities

Google calls the built-in slots system entities:

System entities are pre-built entities provided by Dialogflow that facilitate handling the most popular common concepts.

BotTalk provides the multi-platform alternatives for some the common slot types using the prefix @bottalk.

However, when you develop a BotTalk scenario that is targeting Google Actions platform specifically, take a look at the System entities documentation page.


Using Google Actions System Entities in BotTalk

Let’s create a BotTalk Scenario that will support some of system entities described in the Google’s documentation page:

  • @sys.music-artist
  • @sys.age
  • @sys.geo-city

Here is what the Scenario steps would look like:

    - name: Initial step
      actions:
        - sendText: 'What is your favorite music artist?'
        - getInput:
      next:
        artist_answer: Age Question
        AMAZON.CancelIntent: Exit
        AMAZON.StopIntent: Exit
        AMAZON.HelpIntent: Help
        
    - name: Age Question
      actions:
        - sendText: 'And how old were you, when you first heard {{ artist }}?'
        - getInput:
      next:
        age_answer: City Question
        
    - name: City Question
      actions:
        - sendText: 'And where was it?'
        - getInput: 
      next:
        city_anwer: Finish
        
    - name: Finish
      actions:
        - sendText: >
            The streets of {{ city }} filled with {{ artist }} sounds, when you,
            {{ age.amount }} {{ age.unit }} old, crancked that volume all the way up.

Notice, how in the last step, when we use the age variable, we access ammount and unit keys. The reason for that is simple. Some of the system entities Google recognizes come back from Dialogflow as an object:

@sys.age system entity documentation description

In your Intents section:

---
intents:
  artist_answer:
    - '{artist}'
  age_answer:
    - '{age}'
  city_anwer:
    - '{city}'

And your Slots section:

---
slots:

  artist: '@sys.music-artist'
  age: '@sys.age'
  city: '@sys.geo-city'

Finally, save and deploy to Dialogflow

The result in the Google Assistant Simulator:

Google Assistant Simulator testing system entities with bottalk


Written by Andrey Esaulov on 05 June 2019

Updated on 05 June 2019