LexModelsV2 / Client / list_slots

list_slots#

LexModelsV2.Client.list_slots(**kwargs)#

Gets a list of slots that match the specified criteria.

See also: AWS API Documentation

Request Syntax

response = client.list_slots(
    botId='string',
    botVersion='string',
    localeId='string',
    intentId='string',
    sortBy={
        'attribute': 'SlotName'|'LastUpdatedDateTime',
        'order': 'Ascending'|'Descending'
    },
    filters=[
        {
            'name': 'SlotName',
            'values': [
                'string',
            ],
            'operator': 'CO'|'EQ'
        },
    ],
    maxResults=123,
    nextToken='string'
)
Parameters:
  • botId (string) –

    [REQUIRED]

    The identifier of the bot that contains the slot.

  • botVersion (string) –

    [REQUIRED]

    The version of the bot that contains the slot.

  • localeId (string) –

    [REQUIRED]

    The identifier of the language and locale of the slots to list. The string must match one of the supported locales. For more information, see Supported languages.

  • intentId (string) –

    [REQUIRED]

    The unique identifier of the intent that contains the slot.

  • sortBy (dict) –

    Determines the sort order for the response from the ListSlots operation. You can choose to sort by the slot name or last updated date in either ascending or descending order.

    • attribute (string) – [REQUIRED]

      The attribute to use to sort the list.

    • order (string) – [REQUIRED]

      The order to sort the list. You can choose ascending or descending.

  • filters (list) –

    Provides the specification of a filter used to limit the slots in the response to only those that match the filter specification. You can only specify one filter and only one string to filter on.

    • (dict) –

      Filters the response from the ListSlots operation.

      • name (string) – [REQUIRED]

        The name of the field to use for filtering.

      • values (list) – [REQUIRED]

        The value to use to filter the response.

        • (string) –

      • operator (string) – [REQUIRED]

        The operator to use for the filter. Specify EQ when the ListSlots operation should return only aliases that equal the specified value. Specify CO when the ListSlots operation should return aliases that contain the specified value.

  • maxResults (integer) – The maximum number of slots to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned.

  • nextToken (string) – If the response from the ListSlots operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

Return type:

dict

Returns:

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'intentId': 'string',
    'slotSummaries': [
        {
            'slotId': 'string',
            'slotName': 'string',
            'description': 'string',
            'slotConstraint': 'Required'|'Optional',
            'slotTypeId': 'string',
            'valueElicitationPromptSpecification': {
                'messageGroups': [
                    {
                        'message': {
                            'plainTextMessage': {
                                'value': 'string'
                            },
                            'customPayload': {
                                'value': 'string'
                            },
                            'ssmlMessage': {
                                'value': 'string'
                            },
                            'imageResponseCard': {
                                'title': 'string',
                                'subtitle': 'string',
                                'imageUrl': 'string',
                                'buttons': [
                                    {
                                        'text': 'string',
                                        'value': 'string'
                                    },
                                ]
                            }
                        },
                        'variations': [
                            {
                                'plainTextMessage': {
                                    'value': 'string'
                                },
                                'customPayload': {
                                    'value': 'string'
                                },
                                'ssmlMessage': {
                                    'value': 'string'
                                },
                                'imageResponseCard': {
                                    'title': 'string',
                                    'subtitle': 'string',
                                    'imageUrl': 'string',
                                    'buttons': [
                                        {
                                            'text': 'string',
                                            'value': 'string'
                                        },
                                    ]
                                }
                            },
                        ]
                    },
                ],
                'maxRetries': 123,
                'allowInterrupt': True|False,
                'messageSelectionStrategy': 'Random'|'Ordered',
                'promptAttemptsSpecification': {
                    'string': {
                        'allowInterrupt': True|False,
                        'allowedInputTypes': {
                            'allowAudioInput': True|False,
                            'allowDTMFInput': True|False
                        },
                        'audioAndDTMFInputSpecification': {
                            'startTimeoutMs': 123,
                            'audioSpecification': {
                                'maxLengthMs': 123,
                                'endTimeoutMs': 123
                            },
                            'dtmfSpecification': {
                                'maxLength': 123,
                                'endTimeoutMs': 123,
                                'deletionCharacter': 'string',
                                'endCharacter': 'string'
                            }
                        },
                        'textInputSpecification': {
                            'startTimeoutMs': 123
                        }
                    }
                }
            },
            'lastUpdatedDateTime': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • botId (string) –

      The identifier of the bot that contains the slots.

    • botVersion (string) –

      The version of the bot that contains the slots.

    • localeId (string) –

      The language and locale of the slots in the list.

    • intentId (string) –

      The identifier of the intent that contains the slots.

    • slotSummaries (list) –

      Summary information for the slots that meet the filter criteria specified in the request. The length of the list is specified in the maxResults parameter of the request. If there are more slots available, the nextToken field contains a token to get the next page of results.

      • (dict) –

        Summary information about a slot, a value that the bot elicits from the user.

        • slotId (string) –

          The unique identifier of the slot.

        • slotName (string) –

          The name given to the slot.

        • description (string) –

          The description of the slot.

        • slotConstraint (string) –

          Whether the slot is required or optional. An intent is complete when all required slots are filled.

        • slotTypeId (string) –

          The unique identifier for the slot type that defines the values for the slot.

        • valueElicitationPromptSpecification (dict) –

          Prompts that are sent to the user to elicit a value for the slot.

          • messageGroups (list) –

            A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.

            • (dict) –

              Provides one or more messages that Amazon Lex should send to the user.

              • message (dict) –

                The primary message that Amazon Lex should send to the user.

                • plainTextMessage (dict) –

                  A message in plain text format.

                  • value (string) –

                    The message to send to the user.

                • customPayload (dict) –

                  A message in a custom format defined by the client application.

                  • value (string) –

                    The string that is sent to your application.

                • ssmlMessage (dict) –

                  A message in Speech Synthesis Markup Language (SSML).

                  • value (string) –

                    The SSML text that defines the prompt.

                • imageResponseCard (dict) –

                  A message that defines a response card that the client application can show to the user.

                  • title (string) –

                    The title to display on the response card. The format of the title is determined by the platform displaying the response card.

                  • subtitle (string) –

                    The subtitle to display on the response card. The format of the subtitle is determined by the platform displaying the response card.

                  • imageUrl (string) –

                    The URL of an image to display on the response card. The image URL must be publicly available so that the platform displaying the response card has access to the image.

                  • buttons (list) –

                    A list of buttons that should be displayed on the response card. The arrangement of the buttons is determined by the platform that displays the button.

                    • (dict) –

                      Describes a button to use on a response card used to gather slot values from a user.

                      • text (string) –

                        The text that appears on the button. Use this to tell the user what value is returned when they choose this button.

                      • value (string) –

                        The value returned to Amazon Lex when the user chooses this button. This must be one of the slot values configured for the slot.

              • variations (list) –

                Message variations to send to the user. When variations are defined, Amazon Lex chooses the primary message or one of the variations to send to the user.

                • (dict) –

                  The object that provides message text and it’s type.

                  • plainTextMessage (dict) –

                    A message in plain text format.

                    • value (string) –

                      The message to send to the user.

                  • customPayload (dict) –

                    A message in a custom format defined by the client application.

                    • value (string) –

                      The string that is sent to your application.

                  • ssmlMessage (dict) –

                    A message in Speech Synthesis Markup Language (SSML).

                    • value (string) –

                      The SSML text that defines the prompt.

                  • imageResponseCard (dict) –

                    A message that defines a response card that the client application can show to the user.

                    • title (string) –

                      The title to display on the response card. The format of the title is determined by the platform displaying the response card.

                    • subtitle (string) –

                      The subtitle to display on the response card. The format of the subtitle is determined by the platform displaying the response card.

                    • imageUrl (string) –

                      The URL of an image to display on the response card. The image URL must be publicly available so that the platform displaying the response card has access to the image.

                    • buttons (list) –

                      A list of buttons that should be displayed on the response card. The arrangement of the buttons is determined by the platform that displays the button.

                      • (dict) –

                        Describes a button to use on a response card used to gather slot values from a user.

                        • text (string) –

                          The text that appears on the button. Use this to tell the user what value is returned when they choose this button.

                        • value (string) –

                          The value returned to Amazon Lex when the user chooses this button. This must be one of the slot values configured for the slot.

          • maxRetries (integer) –

            The maximum number of times the bot tries to elicit a response from the user using this prompt.

          • allowInterrupt (boolean) –

            Indicates whether the user can interrupt a speech prompt from the bot.

          • messageSelectionStrategy (string) –

            Indicates how a message is selected from a message group among retries.

          • promptAttemptsSpecification (dict) –

            Specifies the advanced settings on each attempt of the prompt.

            • (string) –

              The attempt name of attempts of a prompt.

              • (dict) –

                Specifies the settings on a prompt attempt.

                • allowInterrupt (boolean) –

                  Indicates whether the user can interrupt a speech prompt attempt from the bot.

                • allowedInputTypes (dict) –

                  Indicates the allowed input types of the prompt attempt.

                  • allowAudioInput (boolean) –

                    Indicates whether audio input is allowed.

                  • allowDTMFInput (boolean) –

                    Indicates whether DTMF input is allowed.

                • audioAndDTMFInputSpecification (dict) –

                  Specifies the settings on audio and DTMF input.

                  • startTimeoutMs (integer) –

                    Time for which a bot waits before assuming that the customer isn’t going to speak or press a key. This timeout is shared between Audio and DTMF inputs.

                  • audioSpecification (dict) –

                    Specifies the settings on audio input.

                    • maxLengthMs (integer) –

                      Time for how long Amazon Lex waits before speech input is truncated and the speech is returned to application.

                    • endTimeoutMs (integer) –

                      Time for which a bot waits after the customer stops speaking to assume the utterance is finished.

                  • dtmfSpecification (dict) –

                    Specifies the settings on DTMF input.

                    • maxLength (integer) –

                      The maximum number of DTMF digits allowed in an utterance.

                    • endTimeoutMs (integer) –

                      How long the bot should wait after the last DTMF character input before assuming that the input has concluded.

                    • deletionCharacter (string) –

                      The DTMF character that clears the accumulated DTMF digits and immediately ends the input.

                    • endCharacter (string) –

                      The DTMF character that immediately ends input. If the user does not press this character, the input ends after the end timeout.

                • textInputSpecification (dict) –

                  Specifies the settings on text input.

                  • startTimeoutMs (integer) –

                    Time for which a bot waits before re-prompting a customer for text input.

        • lastUpdatedDateTime (datetime) –

          The timestamp of the last date and time that the slot was updated.

    • nextToken (string) –

      A token that indicates whether there are more results to return in a response to the ListSlots operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListSlots operation request to get the next page of results.

Exceptions

  • LexModelsV2.Client.exceptions.ThrottlingException

  • LexModelsV2.Client.exceptions.ServiceQuotaExceededException

  • LexModelsV2.Client.exceptions.ValidationException

  • LexModelsV2.Client.exceptions.InternalServerException