Amazon Lex V2 guide

The Lex Chat-bot that is integrated into the fronted for prod and stage is ‘tis-trainee-chatbot_QnaBot’, this bot can be found in the bots section.

Lex and Lambdas

After creating a Lambda function and preparing it for integration with the chatbot, proceed to apply it within the Lex service. Here’s how you can navigate through the process:

  1. Select the desired bot version from the available list.

  2. Under the chosen bot version, click on 'Intents' located in the hierarchy panel, under the specified language.

  3. Identify and select the intent to which you want to add or modify the Lambda function.

  4. This action will redirect you to the 'Intent Editor,' where you have the flexibility to add, remove, or modify the Lambda function, tailoring how the intent is managed.

  5. To visualize the intent's flow, click on 'Visual Builder,' situated at the bottom right of the screen. This will provide a graphical representation of the intents flow, facilitating a more intuitive understanding and navigation of the intent structure.

 

 

Update The chat-bot

When making modifications or updates to the chatbot, it's imperative to work on the draft version. After ensuring that the changes are satisfactory and the test bot operates as desired, you can initiate the creation of a new version. Here's how you do it in Amazon Lex:

  1. Navigate to the 'Bot Versions' tab and click on the 'Create Version' button.

  2. Upon creating a new version, a snapshot of the draft version is captured and saved as the latest version in the sequence.

  3. Subsequently, to activate this new version, you need to update the alias for production to point to it.

In order to update the Alias to use the latest version of the chat-bot:

  1. In Amazon Lex, go to the 'Deployment → Aliases' tab.

  2. Locate and select the alias you wish to update.

  3. Following this, update the alias to point to the new version of the chatbot, ensuring that the production environment utilizes the updated version.

  1. Then select Edit on the details page to select the latest version

If a new Alias has been created for say ‘tss-chatbot-ui-prod' you will then need to update the 'LexV2BotAliasId’ Parameter in the CloudFormation stack.

CloudFormation

CloudFormation allows you to create chat-bots using templates, Through this service, you can view and modify the parameters associated with the chat-bot. Here's how you can access these parameters:

  1. From the list, select the desired stack associated with the chat-bot.

  2. Once selected, navigate to the right-hand side panel where you'll find the 'Parameters' list.

  3. Here, you can view or adjust the parameters as per your requirements, ensuring the chat-bot operates according to the needed configurations.

Testing the Chat-bot

changes and testing for the chat-bot are done in the Draft version of the chat-bot, in order to access the testing section you should select the version you with to test then on the left hierarchy panel select intents under the language that need, then on the intents page select ‘Test’ in the top right to bring up the testing window.