Lex

Lex is a service that allows users to chat with bots that app builders have configured to respond to user input—primarily through voice commands. The commands trigger the bots to complete specified tasks. You can incorporate this functionality into Skuid pages to create a user experience based on more than mouse clicks and text entry, making your app more accessible and intuitive.

The Lex DST allows you to access existing bots within your AWS instance, but you cannot create these bots within Skuid. Because of this, you must first configure any bots within AWS. This topic assumes you have done so and that you possess a basic familiarity with Lex as a service, particularly bots, intents, and slots.

If you need to learn more about Lex or how to configure bots within it, see AWS documentation.

Configuration

First, configure an authentication provider using your AWS security credentials. After doing so, configure a data source—choosing Amazon LEX as the data source type.

AWS Access Permissions

When using AWS APIs, it is best practice to utilize strict and well-defined IAM policies so users can only perform actions they have explicit access to.

Listed below are the permissions this data source type requires to properly function. Use this list to better define your IAM roles.

Skuid utilizes both the LexRuntime and LexModelBuildingService SDKs.

  • postContent
  • getBot
  • getIntent

Using the AWS Lex Data Source

Note

You must publish at least one chatbot version—with an alias—within the AWS UI before using this data source.

Lex is intended to be an interactive service that responds to user input, and as such, the Lex data source is used exclusively through voice-triggered action sequences.

  1. Enable voice features in the Voice tab of a Skuid page’s properties.
  2. Select the Lex data source as the controlling data.
  3. Enter the chatbot name and chatbot alias configured with the appropriate intents for your usage.
  4. Configure voice-triggered action sequences for any intents you wish to use within your page.

For the end user to begin conversing with the Lex chatbot, the Listen for a Voice Command action must occur. Consider using a Button Set button or an event-triggered action sequence to initiate this action—perhaps configuring an action sequence that occurs at page load.

After a conversation begins, it will follow this loop:

  • If the input matches an intent configured for the bot, Lex will return an audio response to the user.
  • This cycle will repeats until the bot determines that the conversation has ended.

For a fully vocal interface, consider using a Polly data source to speak back to end users in addition to Lex chatbot interactions.

Troubleshooting

I only see object Object when selecting an intent. [[]]

This typically indicates Skuid was unable to properly query for chatbot intents. Ensure both the chatbot name and alias are correct.