Creating lex bot

In this chapter we will be configuring the lex bot to work with our lambda function and add data to our dynamodb databases

Configure lex bot

  1. go to intent tab on lex bot and Click on NewIntent that was created when you create the bot lex7

    If you don’t have a intent name NewIntent you can create one by click on create Intent

  2. name the intent as BotIntent lex7
  3. In the Sample utterances :
    • click on Plain text
    • then add the code bellow
register information
my name is {FirstName}  phone number {PhoneNumEmp} and position {job_position}

lex7 4. In Slots :

  • click on Add Slot lex7
  • Add the name : PhoneNumEmp
  • Add the slot types : AMAZON.PhoneNumber
  • Add the Prompts : what your phone number ? lex7
  • do the same for the employees name
  • Add the name : FirstName
  • Add the slot types : AMAZON.FirstName
  • Add the Prompts : tell me your name ? lex7
  • do the same for the employees job
  • Add the name : FirstName
  • Add the slot types : AMAZON.FirstName
  • Add the Prompts : tell me your name ? lex7
  1. in the Confirmation :

    • click Active
    • fill the Confirmation prompt : so your name is {FirstName} , phone number {PhoneNumEmp} and current job postion is {job_position} correct ?
    • Decline response prompt : okay we will ask again lex7
    • In Fulfillment click on Active
  2. finally click on Use a Lambda function for initialization and validation then click on build lex7

  3. configure the test :

    • Click on test
    • Click on the setting icon
    • for the source choose BotFunction
    • then choose Save lex7
  4. fill in the require information to test out the bot lex7 lex7

  5. then check the databases to see if the Information is register go to AWS Dynamodbv2

  6. click on Explore items lex7

  7. in Explore item click on EmployeesDataBases : lex7 We can see that the information have been log into our databases