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:
- State Machine
- Sumerian Host
- Amazon Lex and Chatbots
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.
Be sure you’re using a region that supports Lex. For more information on availability, see the AWS Region Table.
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.
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.
Download the following Amazon Lex bot example file (preseton_blog_lex.zip) zip file.
Navigate to the Lex console under Actions select Import.
Upload the preston_blog_lex.zip file you just downloaded.
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 (
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
- From the Dashboard, create a new scene
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.
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.