Creating a chatbot with Amazon Lex, AWS Lambda, and Integrating with WhatsApp (Part 2).

Poojitha Ravuri
3 min readApr 17, 2022

--

Hope you enjoyed and followed part 1 carefully.

Now its time to create ChatBot using Amazon Lex.

Lets deep dive into it.

Step 2— Create a bot

  • Go to services console, type lex and select Amazon Lex.
  • select Get Started and then select Create.
  • On the Create your Lex bot page, choose Custom bot.
  • App name: ReferralBot
  • Output voice: Salli
  • Session timeout: 5 minutes.
  • Keep the remaining fields as default ones and COPPA to No.
  • Select Create.

Now, create the ReferralBot intent , an action that the user wants to perform, with the minimum information needed. You add slot types for the intent and then configure the intent later.

  • In the Amazon Lex console choose Create new intent.
  • In the Create intent dialogue box, type the name of the intent referralBotIntent, and then choose Add.

To create slot types

  • In the left menu, choose the plus sign (+) next to Slot types.
  • Select Slot type name — boolean
  • Description — any info about it.
  • Choose Restrict to Slot values and Synonyms
  • Value —Type “yes”. Press tab and in the Synonym field type stuffed. Choose the plus sign (+). Type thin and then choose the plus sign (+) again.
  • Choose Add slot to intent.
  • On the Intent page, choose Required. Change the name of the slot from slotOne to boolean
  • Change the prompt to Are you a student?
  • Repeat the previous steps for creating other slot types and slots.
  • Give some sample utterances. For this, you can give start so that all the slots which you entered will be asked in line.
  • In Lambda initialization and validation Leave the default setting.
  • In Confirmation prompt, you can Leave the default setting or provide a confirmation string.
  • In Fulfillment Choose AWS Lambda function and select the earlier created ReferralProcessor lambda function.
  • Choose ok to the Add permission to Lambda function dialog box
  • Leave None selected.

Step 3 — Build and test the bot

  • To build the ReferralBot bot, choose Build.
  • It can take some time to complete the build.
  • In the Test Bot window, start communicating with your Amazon Lex bot.
  • After testing if your bot works fine click the publish button.
  • Select Alias BETA.

Integrating with WhatsApp will be continued in next part.

Links to part 1 and part 3 are below.

Part 1: https://ravuri-poojitha123.medium.com/creating-a-chatbot-with-amazon-lex-aws-lambda-and-integrating-with-whatsapp-part-1-cabacecc0a1

Part 3: https://ravuri-poojitha123.medium.com/creating-a-chatbot-with-amazon-lex-aws-lambda-and-integrating-with-whatsapp-part-3-8fab2e5ec441

--

--

No responses yet