Step 2: Create a Custom Slot Type (AWS CLI) - Amazon Lex V1

If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.

 

If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.

Step 2: Create a Custom Slot Type (AWS CLI)

Create a custom slot type with enumeration values for the flowers that can be ordered. You use this type in the next step when you create the OrderFlowers intent. A slot type defines the possible values for a slot, or parameter, of the intent.

To run the commands in this exercise, you need to know the region where the commands will be run. For a list of regions, see Model Building Quotas .

To create a custom slot type (AWS CLI)
  1. Create a text file named FlowerTypes.json. Copy the JSON code from FlowerTypes.json into the text file.

  2. Call the PutSlotType operation using the AWS CLI to create the slot type. The example is formatted for Unix, Linux, and macOS. For Windows, replace the backslash (\) Unix continuation character at the end of each line with a caret (^).

    aws lex-models put-slot-type \ --region region \ --name FlowerTypes \ --cli-input-json file://FlowerTypes.json

    The response from the server is:

    {
        "enumerationValues": [
            {
                "value": "tulips"
            }, 
            {
                "value": "lilies"
            }, 
            {
                "value": "roses"
            }
        ], 
        "name": "FlowerTypes", 
        "checksum": "checksum", 
        "version": "$LATEST", 
        "lastUpdatedDate": timestamp, 
        "createdDate": timestamp, 
        "description": "Types of flowers to pick up"
    }

Next Step

Step 3: Create an Intent (AWS CLI)