Using the Dialogue component, Amazon Sumerian hosts can sync with Amazon Lex to create chatbots. In this tutorial, we will use an example Amazon Lex bot and connect it with a Sumerian host using the Dialogue component and the State Machine.
You’ll learn about:
- AWS configuration
- Amazon Cognito identity pool ID
- Dialogue component
- State Machine
Before you begin, be sure you complete the following tasks and tutorials:
- Download a WebGL-compatible browser. We recommend the latest version of Google Chrome or Firefox Quantum
- Speech Component tutorial
- Create this AWS CloudFormation stack template.
Watch the video tutorial from the Hosts Course.
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.
For more information about Amazon Cognito, see the AWS CloudFormation stack template to set up your Amazon Cognito identity pool ID. For more resources on this topic, watch a video tutorial for setting up AWS resources.
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 Lex Bot to Use
For this tutorial, you first need to create a Lex bot. This tutorial uses the example Lex bot, BookTrip which is already included in the AWS CloudFormation stack template provided. This example bot enables you to converse with the Lex bot to make a hotel reservation or make a car rental reservation.
To create custom Lex bot, we highly recommend completing all of the tutorials on creating a Lex bot on building a custom conversation bot.
Step 3: Create a Chatbot Using a Lex Bot and a Host
We have a Lex bot (an example or custom), we need to connect the bot to Sumerian.
Setting up the Scene
From the Dashboard, create a new scene or open an existing 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.
Click Import Assets above the canvas to open the asset library. Choose a Host to add to your scene. In this exercise, we use the Cristine scene template. Navigate to the Assets panel and under the Host asset pack, find the Host entity (hexagon icon), and drag the entity into your scene.