Amazon Lex Model Building V2

2021/12/09 - Amazon Lex Model Building V2 - 6 updated api methods

Changes  Added support for grammar slot type in Amazon Lex. You can author your own grammar in the XML format per the SRGS specification to collect information in a conversation.

CreateSlotType (updated) Link ¶
Changes (both)
{'externalSourceSetting': {'grammarSlotTypeSetting': {'source': {'kmsKeyArn': 'string',
                                                                 's3BucketName': 'string',
                                                                 's3ObjectKey': 'string'}}}}

Creates a custom slot type

To create a custom slot type, specify a name for the slot type and a set of enumeration values, the values that a slot of this type can assume.

See also: AWS API Documentation

Request Syntax

client.create_slot_type(
    slotTypeName='string',
    description='string',
    slotTypeValues=[
        {
            'sampleValue': {
                'value': 'string'
            },
            'synonyms': [
                {
                    'value': 'string'
                },
            ]
        },
    ],
    valueSelectionSetting={
        'resolutionStrategy': 'OriginalValue'|'TopResolution',
        'regexFilter': {
            'pattern': 'string'
        }
    },
    parentSlotTypeSignature='string',
    botId='string',
    botVersion='string',
    localeId='string',
    externalSourceSetting={
        'grammarSlotTypeSetting': {
            'source': {
                's3BucketName': 'string',
                's3ObjectKey': 'string',
                'kmsKeyArn': 'string'
            }
        }
    }
)
type slotTypeName

string

param slotTypeName

[REQUIRED]

The name for the slot. A slot type name must be unique within the account.

type description

string

param description

A description of the slot type. Use the description to help identify the slot type in lists.

type slotTypeValues

list

param slotTypeValues

A list of SlotTypeValue objects that defines the values that the slot type can take. Each value can have a list of synonyms, additional values that help train the machine learning model about the values that it resolves for a slot.

  • (dict) --

    Each slot type can have a set of values. Each SlotTypeValue represents a value that the slot type can take.

    • sampleValue (dict) --

      The value of the slot type entry.

      • value (string) -- [REQUIRED]

        The value that can be used for a slot type.

    • synonyms (list) --

      Additional values related to the slot type entry.

      • (dict) --

        Defines one of the values for a slot type.

        • value (string) -- [REQUIRED]

          The value that can be used for a slot type.

type valueSelectionSetting

dict

param valueSelectionSetting

Determines the strategy that Amazon Lex uses to select a value from the list of possible values. The field can be set to one of the following values:

  • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

  • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list. If there is no resolution list, return null.

If you don't specify the valueSelectionSetting parameter, the default is OriginalValue .

  • resolutionStrategy (string) -- [REQUIRED]

    Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:

    • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

    • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.

    If you don't specify the valueSelectionStrategy, the default is OriginalValue.

  • regexFilter (dict) --

    A regular expression used to validate the value of a slot.

    • pattern (string) -- [REQUIRED]

      A regular expression used to validate the value of a slot.

      Use a standard regular expression. Amazon Lex supports the following characters in the regular expression:

      • A-Z, a-z

      • 0-9

      • Unicode characters ("u<Unicode>")

      Represent Unicode characters with four digits, for example "u0041" or "u005A".

      The following regular expression operators are not supported:

      • Infinite repeaters: *, +, or {x,} with no upper bound.

      • Wild card (.)

type parentSlotTypeSignature

string

param parentSlotTypeSignature

The built-in slot type used as a parent of this slot type. When you define a parent slot type, the new slot type has the configuration of the parent slot type.

Only AMAZON.AlphaNumeric is supported.

type botId

string

param botId

[REQUIRED]

The identifier of the bot associated with this slot type.

type botVersion

string

param botVersion

[REQUIRED]

The identifier of the bot version associated with this slot type.

type localeId

string

param localeId

[REQUIRED]

The identifier of the language and locale that the slot type will be used in. The string must match one of the supported locales. All of the bots, intents, and slots used by the slot type must have the same locale. For more information, see Supported languages.

type externalSourceSetting

dict

param externalSourceSetting

Sets the type of external information used to create the slot type.

  • grammarSlotTypeSetting (dict) --

    Settings required for a slot type based on a grammar that you provide.

    • source (dict) --

      The source of the grammar used to create the slot type.

      • s3BucketName (string) -- [REQUIRED]

        The name of the S3 bucket that contains the grammar source.

      • s3ObjectKey (string) -- [REQUIRED]

        The path to the grammar in the S3 bucket.

      • kmsKeyArn (string) --

        The Amazon KMS key required to decrypt the contents of the grammar, if any.

rtype

dict

returns

Response Syntax

{
    'slotTypeId': 'string',
    'slotTypeName': 'string',
    'description': 'string',
    'slotTypeValues': [
        {
            'sampleValue': {
                'value': 'string'
            },
            'synonyms': [
                {
                    'value': 'string'
                },
            ]
        },
    ],
    'valueSelectionSetting': {
        'resolutionStrategy': 'OriginalValue'|'TopResolution',
        'regexFilter': {
            'pattern': 'string'
        }
    },
    'parentSlotTypeSignature': 'string',
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'externalSourceSetting': {
        'grammarSlotTypeSetting': {
            'source': {
                's3BucketName': 'string',
                's3ObjectKey': 'string',
                'kmsKeyArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • slotTypeId (string) --

      The unique identifier assigned to the slot type. Use this to identify the slot type in the UpdateSlotType and DeleteSlotType operations.

    • slotTypeName (string) --

      The name specified for the slot type.

    • description (string) --

      The description specified for the slot type.

    • slotTypeValues (list) --

      The list of values that the slot type can assume.

      • (dict) --

        Each slot type can have a set of values. Each SlotTypeValue represents a value that the slot type can take.

        • sampleValue (dict) --

          The value of the slot type entry.

          • value (string) --

            The value that can be used for a slot type.

        • synonyms (list) --

          Additional values related to the slot type entry.

          • (dict) --

            Defines one of the values for a slot type.

            • value (string) --

              The value that can be used for a slot type.

    • valueSelectionSetting (dict) --

      The strategy that Amazon Lex uses to select a value from the list of possible values.

      • resolutionStrategy (string) --

        Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:

        • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

        • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.

        If you don't specify the valueSelectionStrategy, the default is OriginalValue.

      • regexFilter (dict) --

        A regular expression used to validate the value of a slot.

        • pattern (string) --

          A regular expression used to validate the value of a slot.

          Use a standard regular expression. Amazon Lex supports the following characters in the regular expression:

          • A-Z, a-z

          • 0-9

          • Unicode characters ("u<Unicode>")

          Represent Unicode characters with four digits, for example "u0041" or "u005A".

          The following regular expression operators are not supported:

          • Infinite repeaters: *, +, or {x,} with no upper bound.

          • Wild card (.)

    • parentSlotTypeSignature (string) --

      The signature of the base slot type specified for the slot type.

    • botId (string) --

      The identifier for the bot associated with the slot type.

    • botVersion (string) --

      The version of the bot associated with the slot type.

    • localeId (string) --

      The specified language and local specified for the slot type.

    • creationDateTime (datetime) --

      A timestamp of the date and time that the slot type was created.

    • externalSourceSetting (dict) --

      The type of external information used to create the slot type.

      • grammarSlotTypeSetting (dict) --

        Settings required for a slot type based on a grammar that you provide.

        • source (dict) --

          The source of the grammar used to create the slot type.

          • s3BucketName (string) --

            The name of the S3 bucket that contains the grammar source.

          • s3ObjectKey (string) --

            The path to the grammar in the S3 bucket.

          • kmsKeyArn (string) --

            The Amazon KMS key required to decrypt the contents of the grammar, if any.

DescribeBotLocale (updated) Link ¶
Changes (response)
{'recommendedActions': ['string']}

Describes the settings that a bot has for a specific locale.

See also: AWS API Documentation

Request Syntax

client.describe_bot_locale(
    botId='string',
    botVersion='string',
    localeId='string'
)
type botId

string

param botId

[REQUIRED]

The identifier of the bot associated with the locale.

type botVersion

string

param botVersion

[REQUIRED]

The identifier of the version of the bot associated with the locale.

type localeId

string

param localeId

[REQUIRED]

The unique identifier of the locale to describe. The string must match one of the supported locales. For more information, see Supported languages.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'localeName': 'string',
    'description': 'string',
    'nluIntentConfidenceThreshold': 123.0,
    'voiceSettings': {
        'voiceId': 'string',
        'engine': 'standard'|'neural'
    },
    'intentsCount': 123,
    'slotTypesCount': 123,
    'botLocaleStatus': 'Creating'|'Building'|'Built'|'ReadyExpressTesting'|'Failed'|'Deleting'|'NotBuilt'|'Importing'|'Processing',
    'failureReasons': [
        'string',
    ],
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1),
    'lastBuildSubmittedDateTime': datetime(2015, 1, 1),
    'botLocaleHistoryEvents': [
        {
            'event': 'string',
            'eventDate': datetime(2015, 1, 1)
        },
    ],
    'recommendedActions': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • botId (string) --

      The identifier of the bot associated with the locale.

    • botVersion (string) --

      The identifier of the version of the bot associated with the locale.

    • localeId (string) --

      The unique identifier of the described locale.

    • localeName (string) --

      The name of the locale.

    • description (string) --

      The description of the locale.

    • nluIntentConfidenceThreshold (float) --

      The confidence threshold where Amazon Lex inserts the AMAZON.FallbackIntent and AMAZON.KendraSearchIntent intents in the list of possible intents for an utterance.

    • voiceSettings (dict) --

      The Amazon Polly voice Amazon Lex uses for voice interaction with the user.

      • voiceId (string) --

        The identifier of the Amazon Polly voice to use.

      • engine (string) --

        Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

        If you do not specify a value, the default is standard .

    • intentsCount (integer) --

      The number of intents defined for the locale.

    • slotTypesCount (integer) --

      The number of slot types defined for the locale.

    • botLocaleStatus (string) --

      The status of the bot. If the status is Failed , the reasons for the failure are listed in the failureReasons field.

    • failureReasons (list) --

      if botLocaleStatus is Failed , Amazon Lex explains why it failed to build the bot.

      • (string) --

    • creationDateTime (datetime) --

      The date and time that the locale was created.

    • lastUpdatedDateTime (datetime) --

      The date and time that the locale was last updated.

    • lastBuildSubmittedDateTime (datetime) --

      The date and time that the locale was last submitted for building.

    • botLocaleHistoryEvents (list) --

      History of changes, such as when a locale is used in an alias, that have taken place for the locale.

      • (dict) --

        Provides information about an event that occurred affecting the bot locale.

        • event (string) --

          A description of the event that occurred.

        • eventDate (datetime) --

          A timestamp of the date and time that the event occurred.

    • recommendedActions (list) --

      Recommended actions to take to resolve an error in the failureReasons field.

      • (string) --

DescribeSlotType (updated) Link ¶
Changes (response)
{'externalSourceSetting': {'grammarSlotTypeSetting': {'source': {'kmsKeyArn': 'string',
                                                                 's3BucketName': 'string',
                                                                 's3ObjectKey': 'string'}}}}

Gets metadata information about a slot type.

See also: AWS API Documentation

Request Syntax

client.describe_slot_type(
    slotTypeId='string',
    botId='string',
    botVersion='string',
    localeId='string'
)
type slotTypeId

string

param slotTypeId

[REQUIRED]

The identifier of the slot type.

type botId

string

param botId

[REQUIRED]

The identifier of the bot associated with the slot type.

type botVersion

string

param botVersion

[REQUIRED]

The version of the bot associated with the slot type.

type localeId

string

param localeId

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'slotTypeId': 'string',
    'slotTypeName': 'string',
    'description': 'string',
    'slotTypeValues': [
        {
            'sampleValue': {
                'value': 'string'
            },
            'synonyms': [
                {
                    'value': 'string'
                },
            ]
        },
    ],
    'valueSelectionSetting': {
        'resolutionStrategy': 'OriginalValue'|'TopResolution',
        'regexFilter': {
            'pattern': 'string'
        }
    },
    'parentSlotTypeSignature': 'string',
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1),
    'externalSourceSetting': {
        'grammarSlotTypeSetting': {
            'source': {
                's3BucketName': 'string',
                's3ObjectKey': 'string',
                'kmsKeyArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • slotTypeId (string) --

      The unique identifier for the slot type.

    • slotTypeName (string) --

      The name specified for the slot type.

    • description (string) --

      The description specified for the slot type.

    • slotTypeValues (list) --

      The values that the slot type can take. Includes any synonyms for the slot type values.

      • (dict) --

        Each slot type can have a set of values. Each SlotTypeValue represents a value that the slot type can take.

        • sampleValue (dict) --

          The value of the slot type entry.

          • value (string) --

            The value that can be used for a slot type.

        • synonyms (list) --

          Additional values related to the slot type entry.

          • (dict) --

            Defines one of the values for a slot type.

            • value (string) --

              The value that can be used for a slot type.

    • valueSelectionSetting (dict) --

      The strategy that Amazon Lex uses to choose a value from a list of possible values.

      • resolutionStrategy (string) --

        Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:

        • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

        • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.

        If you don't specify the valueSelectionStrategy, the default is OriginalValue.

      • regexFilter (dict) --

        A regular expression used to validate the value of a slot.

        • pattern (string) --

          A regular expression used to validate the value of a slot.

          Use a standard regular expression. Amazon Lex supports the following characters in the regular expression:

          • A-Z, a-z

          • 0-9

          • Unicode characters ("u<Unicode>")

          Represent Unicode characters with four digits, for example "u0041" or "u005A".

          The following regular expression operators are not supported:

          • Infinite repeaters: *, +, or {x,} with no upper bound.

          • Wild card (.)

    • parentSlotTypeSignature (string) --

      The built in slot type used as a parent to this slot type.

    • botId (string) --

      The identifier of the bot associated with the slot type.

    • botVersion (string) --

      The version of the bot associated with the slot type.

    • localeId (string) --

      The language and locale specified for the slot type.

    • creationDateTime (datetime) --

      A timestamp of the date and time that the slot type was created.

    • lastUpdatedDateTime (datetime) --

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

    • externalSourceSetting (dict) --

      Provides information about the external source of the slot type's definition.

      • grammarSlotTypeSetting (dict) --

        Settings required for a slot type based on a grammar that you provide.

        • source (dict) --

          The source of the grammar used to create the slot type.

          • s3BucketName (string) --

            The name of the S3 bucket that contains the grammar source.

          • s3ObjectKey (string) --

            The path to the grammar in the S3 bucket.

          • kmsKeyArn (string) --

            The Amazon KMS key required to decrypt the contents of the grammar, if any.

ListSlotTypes (updated) Link ¶
Changes (request, response)
Request
{'filters': {'name': {'ExternalSourceType'}}}
Response
{'slotTypeSummaries': {'slotTypeCategory': 'Custom | Extended | '
                                           'ExternalGrammar'}}

Gets a list of slot types that match the specified criteria.

See also: AWS API Documentation

Request Syntax

client.list_slot_types(
    botId='string',
    botVersion='string',
    localeId='string',
    sortBy={
        'attribute': 'SlotTypeName'|'LastUpdatedDateTime',
        'order': 'Ascending'|'Descending'
    },
    filters=[
        {
            'name': 'SlotTypeName'|'ExternalSourceType',
            'values': [
                'string',
            ],
            'operator': 'CO'|'EQ'
        },
    ],
    maxResults=123,
    nextToken='string'
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot that contains the slot types.

type botVersion

string

param botVersion

[REQUIRED]

The version of the bot that contains the slot type.

type localeId

string

param localeId

[REQUIRED]

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

type sortBy

dict

param sortBy

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

  • attribute (string) -- [REQUIRED]

    The attribute to use to sort the list of slot types.

  • order (string) -- [REQUIRED]

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

type filters

list

param filters

Provides the specification of a filter used to limit the slot types 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 ListSlotTypes 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 ListSlotTypes operation should return only aliases that equal the specified value. Specify CO when the ListSlotTypes operation should return aliases that contain the specified value.

type maxResults

integer

param maxResults

The maximum number of slot types 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.

type nextToken

string

param nextToken

If the response from the ListSlotTypes 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.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'slotTypeSummaries': [
        {
            'slotTypeId': 'string',
            'slotTypeName': 'string',
            'description': 'string',
            'parentSlotTypeSignature': 'string',
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'slotTypeCategory': 'Custom'|'Extended'|'ExternalGrammar'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • botId (string) --

      The identifier of the bot that contains the slot types.

    • botVersion (string) --

      The version of the bot that contains the slot types.

    • localeId (string) --

      The language and local of the slot types in the list.

    • slotTypeSummaries (list) --

      Summary information for the slot types 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 slot types available, the nextToken field contains a token to get the next page of results.

      • (dict) --

        Provides summary information about a slot type.

        • slotTypeId (string) --

          The unique identifier assigned to the slot type.

        • slotTypeName (string) --

          The name of the slot type.

        • description (string) --

          The description of the slot type.

        • parentSlotTypeSignature (string) --

          If the slot type is derived from a built-on slot type, the name of the parent slot type.

        • lastUpdatedDateTime (datetime) --

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

        • slotTypeCategory (string) --

          Indicates the type of the slot type.

          • Custom - A slot type that you created using custom values. For more information, see Creating custom slot types.

          • Extended - A slot type created by extending the AMAZON.AlphaNumeric built-in slot type. For more information, see AMAZON.AlphaNumeric.

          • ExternalGrammar - A slot type using a custom GRXML grammar to define values. For more information, see Using a custom grammar slot type.

    • nextToken (string) --

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

UpdateBotLocale (updated) Link ¶
Changes (response)
{'recommendedActions': ['string']}

Updates the settings that a bot has for a specific locale.

See also: AWS API Documentation

Request Syntax

client.update_bot_locale(
    botId='string',
    botVersion='string',
    localeId='string',
    description='string',
    nluIntentConfidenceThreshold=123.0,
    voiceSettings={
        'voiceId': 'string',
        'engine': 'standard'|'neural'
    }
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot that contains the locale.

type botVersion

string

param botVersion

[REQUIRED]

The version of the bot that contains the locale to be updated. The version can only be the DRAFT version.

type localeId

string

param localeId

[REQUIRED]

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

type description

string

param description

The new description of the locale.

type nluIntentConfidenceThreshold

float

param nluIntentConfidenceThreshold

[REQUIRED]

The new confidence threshold where Amazon Lex inserts the AMAZON.FallbackIntent and AMAZON.KendraSearchIntent intents in the list of possible intents for an utterance.

type voiceSettings

dict

param voiceSettings

The new Amazon Polly voice Amazon Lex should use for voice interaction with the user.

  • voiceId (string) -- [REQUIRED]

    The identifier of the Amazon Polly voice to use.

  • engine (string) --

    Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

    If you do not specify a value, the default is standard .

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'localeName': 'string',
    'description': 'string',
    'nluIntentConfidenceThreshold': 123.0,
    'voiceSettings': {
        'voiceId': 'string',
        'engine': 'standard'|'neural'
    },
    'botLocaleStatus': 'Creating'|'Building'|'Built'|'ReadyExpressTesting'|'Failed'|'Deleting'|'NotBuilt'|'Importing'|'Processing',
    'failureReasons': [
        'string',
    ],
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1),
    'recommendedActions': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • botId (string) --

      The identifier of the bot that contains the updated locale.

    • botVersion (string) --

      The version of the bot that contains the updated locale.

    • localeId (string) --

      The language and locale of the updated bot locale.

    • localeName (string) --

      The updated locale name for the locale.

    • description (string) --

      The updated description of the locale.

    • nluIntentConfidenceThreshold (float) --

      The updated confidence threshold for inserting the AMAZON.FallbackIntent and AMAZON.KendraSearchIntent intents in the list of possible intents for an utterance.

    • voiceSettings (dict) --

      The updated Amazon Polly voice to use for voice interaction with the user.

      • voiceId (string) --

        The identifier of the Amazon Polly voice to use.

      • engine (string) --

        Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engineparameter of the SynthesizeSpeechoperation in the Amazon Polly developer guide .

        If you do not specify a value, the default is standard .

    • botLocaleStatus (string) --

      The current status of the locale. When the bot status is Built the locale is ready for use.

    • failureReasons (list) --

      If the botLocaleStatus is Failed , the failureReasons field lists the errors that occurred while building the bot.

      • (string) --

    • creationDateTime (datetime) --

      A timestamp of the date and time that the locale was created.

    • lastUpdatedDateTime (datetime) --

      A timestamp of the date and time that the locale was last updated.

    • recommendedActions (list) --

      Recommended actions to take to resolve an error in the failureReasons field.

      • (string) --

UpdateSlotType (updated) Link ¶
Changes (both)
{'externalSourceSetting': {'grammarSlotTypeSetting': {'source': {'kmsKeyArn': 'string',
                                                                 's3BucketName': 'string',
                                                                 's3ObjectKey': 'string'}}}}

Updates the configuration of an existing slot type.

See also: AWS API Documentation

Request Syntax

client.update_slot_type(
    slotTypeId='string',
    slotTypeName='string',
    description='string',
    slotTypeValues=[
        {
            'sampleValue': {
                'value': 'string'
            },
            'synonyms': [
                {
                    'value': 'string'
                },
            ]
        },
    ],
    valueSelectionSetting={
        'resolutionStrategy': 'OriginalValue'|'TopResolution',
        'regexFilter': {
            'pattern': 'string'
        }
    },
    parentSlotTypeSignature='string',
    botId='string',
    botVersion='string',
    localeId='string',
    externalSourceSetting={
        'grammarSlotTypeSetting': {
            'source': {
                's3BucketName': 'string',
                's3ObjectKey': 'string',
                'kmsKeyArn': 'string'
            }
        }
    }
)
type slotTypeId

string

param slotTypeId

[REQUIRED]

The unique identifier of the slot type to update.

type slotTypeName

string

param slotTypeName

[REQUIRED]

The new name of the slot type.

type description

string

param description

The new description of the slot type.

type slotTypeValues

list

param slotTypeValues

A new list of values and their optional synonyms that define the values that the slot type can take.

  • (dict) --

    Each slot type can have a set of values. Each SlotTypeValue represents a value that the slot type can take.

    • sampleValue (dict) --

      The value of the slot type entry.

      • value (string) -- [REQUIRED]

        The value that can be used for a slot type.

    • synonyms (list) --

      Additional values related to the slot type entry.

      • (dict) --

        Defines one of the values for a slot type.

        • value (string) -- [REQUIRED]

          The value that can be used for a slot type.

type valueSelectionSetting

dict

param valueSelectionSetting

The strategy that Amazon Lex should use when deciding on a value from the list of slot type values.

  • resolutionStrategy (string) -- [REQUIRED]

    Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:

    • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

    • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.

    If you don't specify the valueSelectionStrategy, the default is OriginalValue.

  • regexFilter (dict) --

    A regular expression used to validate the value of a slot.

    • pattern (string) -- [REQUIRED]

      A regular expression used to validate the value of a slot.

      Use a standard regular expression. Amazon Lex supports the following characters in the regular expression:

      • A-Z, a-z

      • 0-9

      • Unicode characters ("u<Unicode>")

      Represent Unicode characters with four digits, for example "u0041" or "u005A".

      The following regular expression operators are not supported:

      • Infinite repeaters: *, +, or {x,} with no upper bound.

      • Wild card (.)

type parentSlotTypeSignature

string

param parentSlotTypeSignature

The new built-in slot type that should be used as the parent of this slot type.

type botId

string

param botId

[REQUIRED]

The identifier of the bot that contains the slot type.

type botVersion

string

param botVersion

[REQUIRED]

The version of the bot that contains the slot type. Must be DRAFT .

type localeId

string

param localeId

[REQUIRED]

The identifier of the language and locale that contains the slot type. The string must match one of the supported locales. For more information, see Supported languages.

type externalSourceSetting

dict

param externalSourceSetting

Provides information about the external source of the slot type's definition.

  • grammarSlotTypeSetting (dict) --

    Settings required for a slot type based on a grammar that you provide.

    • source (dict) --

      The source of the grammar used to create the slot type.

      • s3BucketName (string) -- [REQUIRED]

        The name of the S3 bucket that contains the grammar source.

      • s3ObjectKey (string) -- [REQUIRED]

        The path to the grammar in the S3 bucket.

      • kmsKeyArn (string) --

        The Amazon KMS key required to decrypt the contents of the grammar, if any.

rtype

dict

returns

Response Syntax

{
    'slotTypeId': 'string',
    'slotTypeName': 'string',
    'description': 'string',
    'slotTypeValues': [
        {
            'sampleValue': {
                'value': 'string'
            },
            'synonyms': [
                {
                    'value': 'string'
                },
            ]
        },
    ],
    'valueSelectionSetting': {
        'resolutionStrategy': 'OriginalValue'|'TopResolution',
        'regexFilter': {
            'pattern': 'string'
        }
    },
    'parentSlotTypeSignature': 'string',
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'creationDateTime': datetime(2015, 1, 1),
    'lastUpdatedDateTime': datetime(2015, 1, 1),
    'externalSourceSetting': {
        'grammarSlotTypeSetting': {
            'source': {
                's3BucketName': 'string',
                's3ObjectKey': 'string',
                'kmsKeyArn': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • slotTypeId (string) --

      The unique identifier of the updated slot type.

    • slotTypeName (string) --

      The updated name of the slot type.

    • description (string) --

      The updated description of the slot type.

    • slotTypeValues (list) --

      The updated values that the slot type provides.

      • (dict) --

        Each slot type can have a set of values. Each SlotTypeValue represents a value that the slot type can take.

        • sampleValue (dict) --

          The value of the slot type entry.

          • value (string) --

            The value that can be used for a slot type.

        • synonyms (list) --

          Additional values related to the slot type entry.

          • (dict) --

            Defines one of the values for a slot type.

            • value (string) --

              The value that can be used for a slot type.

    • valueSelectionSetting (dict) --

      The updated strategy that Amazon Lex uses to determine which value to select from the slot type.

      • resolutionStrategy (string) --

        Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:

        • OriginalValue - Returns the value entered by the user, if the user value is similar to the slot value.

        • TopResolution - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.

        If you don't specify the valueSelectionStrategy, the default is OriginalValue.

      • regexFilter (dict) --

        A regular expression used to validate the value of a slot.

        • pattern (string) --

          A regular expression used to validate the value of a slot.

          Use a standard regular expression. Amazon Lex supports the following characters in the regular expression:

          • A-Z, a-z

          • 0-9

          • Unicode characters ("u<Unicode>")

          Represent Unicode characters with four digits, for example "u0041" or "u005A".

          The following regular expression operators are not supported:

          • Infinite repeaters: *, +, or {x,} with no upper bound.

          • Wild card (.)

    • parentSlotTypeSignature (string) --

      The updated signature of the built-in slot type that is the parent of this slot type.

    • botId (string) --

      The identifier of the bot that contains the slot type.

    • botVersion (string) --

      The version of the bot that contains the slot type. This is always DRAFT .

    • localeId (string) --

      The language and locale of the updated slot type.

    • creationDateTime (datetime) --

      The timestamp of the date and time that the slot type was created.

    • lastUpdatedDateTime (datetime) --

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

    • externalSourceSetting (dict) --

      Provides information about the external source of the slot type's definition.

      • grammarSlotTypeSetting (dict) --

        Settings required for a slot type based on a grammar that you provide.

        • source (dict) --

          The source of the grammar used to create the slot type.

          • s3BucketName (string) --

            The name of the S3 bucket that contains the grammar source.

          • s3ObjectKey (string) --

            The path to the grammar in the S3 bucket.

          • kmsKeyArn (string) --

            The Amazon KMS key required to decrypt the contents of the grammar, if any.