Amazon Lex Model Building V2

2022/11/07 - Amazon Lex Model Building V2 - 4 new api methods

Changes  Amazon Lex now supports new APIs for viewing and editing Custom Vocabulary in bots.

ListCustomVocabularyItems (new) Link ¶

List custom vocabulary items for the specified locale in the specified bot.

See also: AWS API Documentation

Request Syntax

client.list_custom_vocabulary_items(
    botId='string',
    botVersion='string',
    localeId='string',
    maxResults=123,
    nextToken='string'
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot to the list custom vocabulary request.

type botVersion

string

param botVersion

[REQUIRED]

The bot version of the bot to the list custom vocabulary request.

type localeId

string

param localeId

[REQUIRED]

The locale identifier of the bot to the list custom vocabulary request.

type maxResults

integer

param maxResults

The maximum results to the list custom vocabulary request.

type nextToken

string

param nextToken

The nextToken identifier to the list custom vocabulary request.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'customVocabularyItems': [
        {
            'itemId': 'string',
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier of the bot to the list custom vocabulary response.

    • botVersion (string) --

      The bot version of the bot to the list custom vocabulary response.

    • localeId (string) --

      The locale identifier of the bot to the list custom vocabulary response.

    • customVocabularyItems (list) --

      The custom vocabulary items from the list custom vocabulary response.

      • (dict) --

        The unique custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the custom vocabulary item from the custom vocabulary list.

        • phrase (string) --

          The unique phrase for the custom vocabulary item from the custom vocabulary list.

        • weight (integer) --

          The weight assigned for the custom vocabulary item from the custom vocabulary list.

        • displayAs (string) --

          The display as value for the custom vocabulary item from the custom vocabulary list.

    • nextToken (string) --

      The nextToken identifier to the list custom vocabulary response.

BatchDeleteCustomVocabularyItem (new) Link ¶

Batch delete custom vocabulary item for the specified locale in the specified bot.

See also: AWS API Documentation

Request Syntax

client.batch_delete_custom_vocabulary_item(
    botId='string',
    botVersion='string',
    localeId='string',
    customVocabularyItemList=[
        {
            'itemId': 'string'
        },
    ]
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot to batch delete request for the custom vocabulary item.

type botVersion

string

param botVersion

[REQUIRED]

The version of the bot to batch delete request for the custom vocabulary item.

type localeId

string

param localeId

[REQUIRED]

The locale identifier of the bot to batch delete request for the custom vocabulary item.

type customVocabularyItemList

list

param customVocabularyItemList

[REQUIRED]

The custom vocabulary list to batch delete request for the custom vocabulary item.

  • (dict) --

    The unique entry identifier for the custom vocabulary items.

    • itemId (string) -- [REQUIRED]

      The unique item identifier for the custom vocabulary items.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'errors': [
        {
            'itemId': 'string',
            'errorMessage': 'string',
            'errorCode': 'DUPLICATE_INPUT'|'RESOURCE_DOES_NOT_EXIST'|'RESOURCE_ALREADY_EXISTS'|'INTERNAL_SERVER_FAILURE'
        },
    ],
    'resources': [
        {
            'itemId': 'string',
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier of the bot to batch delete response for the custom vocabulary item.

    • botVersion (string) --

      The version of the bot to batch delete response for the custom vocabulary item.

    • localeId (string) --

      The locale identifier of the bot to batch delete response for the custom vocabulary item.

    • errors (list) --

      The errors of the action to batch delete response for the custom vocabulary item.

      • (dict) --

        The unique failed custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the failed custom vocabulary item from the custom vocabulary list.

        • errorMessage (string) --

          The error message for the failed custom vocabulary item from the custom vocabulary list.

        • errorCode (string) --

          The unique error code for the failed custom vocabulary item from the custom vocabulary list.

    • resources (list) --

      The resources of the action to batch delete response for the custom vocabulary item.

      • (dict) --

        The unique custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the custom vocabulary item from the custom vocabulary list.

        • phrase (string) --

          The unique phrase for the custom vocabulary item from the custom vocabulary list.

        • weight (integer) --

          The weight assigned for the custom vocabulary item from the custom vocabulary list.

        • displayAs (string) --

          The display as value for the custom vocabulary item from the custom vocabulary list.

BatchCreateCustomVocabularyItem (new) Link ¶

Batch create custom vocabulary item for the specified locale in the specified bot.

See also: AWS API Documentation

Request Syntax

client.batch_create_custom_vocabulary_item(
    botId='string',
    botVersion='string',
    localeId='string',
    customVocabularyItemList=[
        {
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ]
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot to batch create the custom vocabulary item for.

type botVersion

string

param botVersion

[REQUIRED]

The bot version of the bot to batch create the custom vocabulary item for.

type localeId

string

param localeId

[REQUIRED]

The unique locale identifier of the bot to batch create the custom vocabulary item for.

type customVocabularyItemList

list

param customVocabularyItemList

[REQUIRED]

The custom vocabulary item list of the bot to batch create the custom vocabulary item for.

  • (dict) --

    The new custom vocabulary item from the custom vocabulary list.

    • phrase (string) -- [REQUIRED]

      The unique phrase for the new custom vocabulary item from the custom vocabulary list.

    • weight (integer) --

      The weight assigned to the new custom vocabulary item from the custom vocabulary list.

    • displayAs (string) --

      The display as value assigned to the new custom vocabulary item from the custom vocabulary list.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'errors': [
        {
            'itemId': 'string',
            'errorMessage': 'string',
            'errorCode': 'DUPLICATE_INPUT'|'RESOURCE_DOES_NOT_EXIST'|'RESOURCE_ALREADY_EXISTS'|'INTERNAL_SERVER_FAILURE'
        },
    ],
    'resources': [
        {
            'itemId': 'string',
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier of the bot to batch create response for the custom vocabulary item.

    • botVersion (string) --

      The bot version of the bot to batch create the custom vocabulary item response for.

    • localeId (string) --

      The unique locale identifier of the bot to batch create the custom vocabulary item response for.

    • errors (list) --

      The errors of the action to batch create the custom vocabulary item response for a bot.

      • (dict) --

        The unique failed custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the failed custom vocabulary item from the custom vocabulary list.

        • errorMessage (string) --

          The error message for the failed custom vocabulary item from the custom vocabulary list.

        • errorCode (string) --

          The unique error code for the failed custom vocabulary item from the custom vocabulary list.

    • resources (list) --

      The resources of the action to batch create the custom vocabulary item response for a bot.

      • (dict) --

        The unique custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the custom vocabulary item from the custom vocabulary list.

        • phrase (string) --

          The unique phrase for the custom vocabulary item from the custom vocabulary list.

        • weight (integer) --

          The weight assigned for the custom vocabulary item from the custom vocabulary list.

        • displayAs (string) --

          The display as value for the custom vocabulary item from the custom vocabulary list.

BatchUpdateCustomVocabularyItem (new) Link ¶

Batch update custom vocabulary item for the specified locale in the specified bot.

See also: AWS API Documentation

Request Syntax

client.batch_update_custom_vocabulary_item(
    botId='string',
    botVersion='string',
    localeId='string',
    customVocabularyItemList=[
        {
            'itemId': 'string',
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ]
)
type botId

string

param botId

[REQUIRED]

The unique identifier of the bot to the batch update request for the custom vocabulary item.

type botVersion

string

param botVersion

[REQUIRED]

The bot version of the bot to the batch update request for the custom vocabulary item.

type localeId

string

param localeId

[REQUIRED]

The locale identifier of the bot to the batch update request for the custom vocabulary item.

type customVocabularyItemList

list

param customVocabularyItemList

[REQUIRED]

The custom vocabulary item list of the bot to the batch update request for the custom vocabulary item.

  • (dict) --

    The unique custom vocabulary item from the custom vocabulary list.

    • itemId (string) -- [REQUIRED]

      The unique item identifer for the custom vocabulary item from the custom vocabulary list.

    • phrase (string) -- [REQUIRED]

      The unique phrase for the custom vocabulary item from the custom vocabulary list.

    • weight (integer) --

      The weight assigned for the custom vocabulary item from the custom vocabulary list.

    • displayAs (string) --

      The display as value for the custom vocabulary item from the custom vocabulary list.

rtype

dict

returns

Response Syntax

{
    'botId': 'string',
    'botVersion': 'string',
    'localeId': 'string',
    'errors': [
        {
            'itemId': 'string',
            'errorMessage': 'string',
            'errorCode': 'DUPLICATE_INPUT'|'RESOURCE_DOES_NOT_EXIST'|'RESOURCE_ALREADY_EXISTS'|'INTERNAL_SERVER_FAILURE'
        },
    ],
    'resources': [
        {
            'itemId': 'string',
            'phrase': 'string',
            'weight': 123,
            'displayAs': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • botId (string) --

      The unique identifier of the bot to the batch update response for the custom vocabulary item.

    • botVersion (string) --

      The bot version of the bot to the batch update response for the custom vocabulary item.

    • localeId (string) --

      The locale identifier of the bot to the batch update response for the custom vocabulary item.

    • errors (list) --

      The errors of the action to batch update response for the custom vocabulary item.

      • (dict) --

        The unique failed custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the failed custom vocabulary item from the custom vocabulary list.

        • errorMessage (string) --

          The error message for the failed custom vocabulary item from the custom vocabulary list.

        • errorCode (string) --

          The unique error code for the failed custom vocabulary item from the custom vocabulary list.

    • resources (list) --

      The resources of the action to batch update response for the custom vocabulary item.

      • (dict) --

        The unique custom vocabulary item from the custom vocabulary list.

        • itemId (string) --

          The unique item identifer for the custom vocabulary item from the custom vocabulary list.

        • phrase (string) --

          The unique phrase for the custom vocabulary item from the custom vocabulary list.

        • weight (integer) --

          The weight assigned for the custom vocabulary item from the custom vocabulary list.

        • displayAs (string) --

          The display as value for the custom vocabulary item from the custom vocabulary list.