Beginner Tutorial


Using the Dialogue Component and Amazon Lex to Build a Chatbot


25 minutes

Learn Sumerian
Using the Dialogue Component and Amazon Lex to Build a Chatbot

Tags

text-to-speech
host
polly
lex
chatbot
bot

In this tutorial you will learn about:


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

Prerequisites

Before you begin, be sure you complete 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.

For more information about Amazon Cognito, see the AWS CloudFormation stack template to set up your Amazon Cognito identity pool ID.

  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 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

  1. From the Dashboard, create a new scene or open an existing 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.

  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 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.