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.
  • Secret Cross-account role secret.
  • NluConfidenceThresholdOverride [Optional] You can use this as an override of the returned detected intent confidence. If this value is higher than that returned from the nlu provider it will change the response to be a fallback, this value defaults to 0.

NluConfidenceThresholdOverride

You can use this as an override of the returned detected intent confidence. If this value is higher than that returned from the nlu provider it will change the response to be a fallback, this value defaults to 0.

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": {
    "NluConfiguration": {
        "BotName": "apples",
        "BotAlias": "apples",
        "Region": "eu-west-1",
        "Secret": "srn:vault::acme:aws-cross-account-role:lexcrossaccount",
        "NluConfidenceThresholdOverride": 0.8
    },
    "NluType": "Lex"
  },
  "Organization": "ORGANIZATION",
  "Config": {
    "Avatar": "default-bot"
  },
  "Enabled": true,
  "Updated": 1608652074324,
  "Description": "A Lex worker",
  "Id": "4685b16c-a305-4b0c-b33d-8ae12b81ff9a",
  "Type": "nlp-worker",
  "Name": "LexWorker",
  "Created": 1608652074324,
  "Status": "published",
  "Srn": "srn:botnet:REGION:ORGANIZATION:worker:4685b16c-a305-4b0c-b33d-8ae12b81ff9a"
}

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 worker at the top with the id and the type of nlp-worker

    {
      "Data": {
        "NluConfiguration": {
            "BotName": "apples",
            "BotAlias": "apples",
            "Region": "eu-west-1",
            "Secret": "SRN:::HERE",
            "NluConfidenceThresholdOverride": 0.8
        },
        "NluType": "Lex"
      },
      "Organization": "ORGANIZATION",
      "Config": {
        "Avatar": "default-bot"
      },
      "Enabled": true,
      "Updated": 1608652074324,
      "Description": "A Lex worker",
      "Id": "4685b16c-a305-4b0c-b33d-8ae12b81ff9a",
      "Type": "nlp-worker",
      "Name": "LexWorker",
      "Created": 1608652074324,
      "Status": "published",
      "Srn": "srn:botnet:REGION:ORGANIZATION:worker:4685b16c-a305-4b0c-b33d-8ae12b81ff9a"
    }