AWS Integration, Part 1 (Using Voice Commands with Amazon Lex)

By Luis Lopez Soria and Saurabh Shrivastava | Posted February 5, 2019


Learn Sumerian
AWS Integration, Part 1 (Using Voice Commands with Amazon Lex)

Tags

lex
entities
host
voice
interact

In this you will learn about:

Learn how to interact with entities with your voice by leveraging a virtual host and Amazon Lex

Using the Dialogue component, Amazon Sumerian hosts can sync with Amazon Lex to create chatbots. In this tutorial, we will create a custom Amazon Amazon Lex bot and connect it with a Sumerian host using the Dialogue component, State Machine, and a custom script. By doing so we will be able to interact with other entities in the scene using our voice. Check out this completed scene to see what you will create in this exercise. For best results, use the latest version your web browser. Make sure you have enabled your microphone.

You’ll learn about:

  • Scripting
  • Entities
  • State Machine
  • Sumerian Host
  • Amazon Lex and Chatbots

Prerequisites

Before you begin, you should have completed the following tasks and tutorials:

Step 1: Create an Amazon Cognito Identity Pool ID

Before we get to editing a scene in Sumerian, we need to set up an AWS CloudFormation stack. This will also allow us to set up your Amazon Cognito Identity Pool ID, which will be added to our scene.

  1. Sign in to Amazon Sumerian with your AWS account and open the AWS CloudFormation stack template.

  2. Be sure you’re using a region that supports Lex. For more information on availability, see the AWS Region Table.

  3. Once you have the creation page pulled up, update the Stack name and select the acknowledgement check box at the bottom of the page. Then choose Create.

  4. Once the stack loads and reads “CREATE_COMPLETE”, expand the Output section and copy the CognitoIdentityPoolID value. You will enter this value in Sumerian.

Step 2: Create an Amazon Amazon Lex bot

For this tutorial, you first need to create a Amazon Lex bot. We are providing you with a bot template to import, here is the documentation on how to Import a Amazon Lex bot.

  1. Download the following Amazon Lex bot example file (preseton_blog_lex.zip) zip file.

  2. Navigate to the Lex console under Actions select Import.

  3. Upload the preston_blog_lex.zip file you just downloaded.

  4. Once the Import is complete Build and Publish your preston_blog Amazon Lex bot.

This Amazon Lex bot contains one intent, TransformIntent, that looks for two slot values (action and figure) in your utterances. We will interact with this Amazon Lex bot in your Sumerian scene. Feel free to add new intents and sample utterances to the chat bot.

Step 3: Create a Chatbot Using a Amazon Lex bot and a Host

Now that we have a Amazon Lex bot, we need to connect it to a Host in our Sumerian Scene.

Setting up the Scene

  1. From the Dashboard, create a new scene
  2. Select the top level entity in the Entities panel and navigate to the Inspector pane. Insert your Cognito Identity Pool ID into the AWS configuration component.

    By specifiying our Cognito Identity Pool ID we are allowing our scene to assume the IAM role created by the CloudFormation template in Step 1

    This tutorial requires three entities, a host, a sphere, and a box.

  3. Click Import Assets above the canvas to open the asset library. Choose a Host to add to your scene. In this exercise, we use Preston. Navigate to the Assets panel and under the Host asset pack, find the Host entity (hexagon icon), and drag the entity into your scene.