LexModelsV2 / Client / batch_create_custom_vocabulary_item
batch_create_custom_vocabulary_item#
- LexModelsV2.Client.batch_create_custom_vocabulary_item(**kwargs)#
Create a batch of custom vocabulary items for a given bot locale’s custom vocabulary.
See also: AWS API Documentation
Request Syntax
response = client.batch_create_custom_vocabulary_item( botId='string', botVersion='string', localeId='string', customVocabularyItemList=[ { 'phrase': 'string', 'weight': 123, 'displayAs': 'string' }, ] )
- Parameters:
botId (string) –
[REQUIRED]
The identifier of the bot associated with this custom vocabulary.
botVersion (string) –
[REQUIRED]
The identifier of the version of the bot associated with this custom vocabulary.
localeId (string) –
[REQUIRED]
The identifier of the language and locale where this custom vocabulary is used. The string must match one of the supported locales. For more information, see Supported Languages.
customVocabularyItemList (list) –
[REQUIRED]
A list of new custom vocabulary items. Each entry must contain a phrase and can optionally contain a displayAs and/or a weight.
(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.
- Return type:
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 identifier of the bot associated with this custom vocabulary.
botVersion (string) –
The identifier of the version of the bot associated with this custom vocabulary.
localeId (string) –
The identifier of the language and locale where this custom vocabulary is used. The string must match one of the supported locales. For more information, see Supported Languages.
errors (list) –
A list of custom vocabulary items that failed to create during the operation. The reason for the error is contained within each error object.
(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) –
A list of custom vocabulary items that were successfully created during the operation.
(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 DisplayAs value for the custom vocabulary item from the custom vocabulary list.
Exceptions
LexModelsV2.Client.exceptions.ThrottlingException
LexModelsV2.Client.exceptions.ServiceQuotaExceededException
LexModelsV2.Client.exceptions.ValidationException
LexModelsV2.Client.exceptions.ResourceNotFoundException
LexModelsV2.Client.exceptions.InternalServerException