Lex Workers

Type: NLP Worker

A Lex worker takes user input and sends it to a lex bot for natural language processing. A lex worker can be created through the CLI or through the Add Resource button on a bot’s detail page.

Secrets

An AWS cross-account role is required in order to access Lex. Please see cross-account roles for more information.

Other Lex fields

  • botName Bot name in lex that will be used for processing input.
  • botAlias Alias of the bot in lex.
  • region Region where the lex bot is configured.
  • lexConfig Cross-account role secret.

Creating Lex worker through cli

Save this json to a file and create a worker using the cli command sb-cli worker create file.json


{
  "Data": {
    "lexConfig": "srn:vault::organization:aws-cross-account-role:secretalias",
    "region": "eu-west-1",
    "botAlias": "exampleLexWorker",
    "botName": "exampleLexWorker"
  },
  "Organization": "Organization",
  "Config": {
    "Avatar": "default-bot"
  },
  "Enabled": true,
  "Description": "An amazing Lex Worker",
  "Type": "r2-lex-worker",
  "Name": "exampleLexWorker",
  "Status": "published",
}


Once you have created the worker using the CLI, it will return an ID for you. You need to then update/create a bot and place the filter worker at the top with the id and the type of r2-lex-worker