2022/09/23 - Amazon Lex Model Building V2 - 7 updated api methods
{'intentConfirmationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Creates an intent.
To define the interaction between the user and your bot, you define one or more intents. For example, for a pizza ordering bot you would create an OrderPizza intent.
When you create an intent, you must provide a name. You can optionally provide the following:
Sample utterances. For example, "I want to order a pizza" and "Can I order a pizza." You can't provide utterances for built-in intents.
Information to be gathered. You specify slots for the information that you bot requests from the user. You can specify standard slot types, such as date and time, or custom slot types for your application.
How the intent is fulfilled. You can provide a Lambda function or configure the intent to return the intent information to your client application. If you use a Lambda function, Amazon Lex invokes the function when all of the intent information is available.
A confirmation prompt to send to the user to confirm an intent. For example, "Shall I order your pizza?"
A conclusion statement to send to the user after the intent is fulfilled. For example, "I ordered your pizza."
A follow-up prompt that asks the user for additional activity. For example, "Do you want a drink with your pizza?"
See also: AWS API Documentation
Request Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.Parameters
# This section is too large to render. # Please see the AWS API Documentation linked below.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.
{'subSlotSetting': {'slotSpecifications': {'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}}, 'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Creates a slot in an intent. A slot is a variable needed to fulfill an intent. For example, an OrderPizza intent might need slots for size, crust, and number of pizzas. For each slot, you define one or more utterances that Amazon Lex uses to elicit a response from the user.
See also: AWS API Documentation
Request Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.Parameters
# This section is too large to render. # Please see the AWS API Documentation linked below.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.
{'intentConfirmationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Returns metadata about an intent.
See also: AWS API Documentation
Request Syntax
client.describe_intent( intentId='string', botId='string', botVersion='string', localeId='string' )
string
[REQUIRED]
The identifier of the intent to describe.
string
[REQUIRED]
The identifier of the bot associated with the intent.
string
[REQUIRED]
The version of the bot associated with the intent.
string
[REQUIRED]
The identifier of the language and locale of the intent to describe. The string must match one of the supported locales. For more information, see Supported languages.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.
{'subSlotSetting': {'slotSpecifications': {'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}}, 'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Gets metadata information about a slot.
See also: AWS API Documentation
Request Syntax
client.describe_slot( slotId='string', botId='string', botVersion='string', localeId='string', intentId='string' )
string
[REQUIRED]
The unique identifier for the slot.
string
[REQUIRED]
The identifier of the bot associated with the slot.
string
[REQUIRED]
The version of the bot associated with the slot.
string
[REQUIRED]
The identifier of the language and locale of the slot to describe. The string must match one of the supported locales. For more information, see Supported languages.
string
[REQUIRED]
The identifier of the intent that contains the slot.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.
{'slotSummaries': {'valueElicitationPromptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Gets a list of slots that match the specified criteria.
See also: AWS API Documentation
Request Syntax
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' )
string
[REQUIRED]
The identifier of the bot that contains the slot.
string
[REQUIRED]
The version of the bot that contains the slot.
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.
string
[REQUIRED]
The unique identifier of the intent that contains the slot.
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.
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.
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.
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.
dict
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.
{'intentConfirmationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Updates the settings for an intent.
See also: AWS API Documentation
Request Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.Parameters
# This section is too large to render. # Please see the AWS API Documentation linked below.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.
{'subSlotSetting': {'slotSpecifications': {'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}}, 'valueElicitationSetting': {'promptSpecification': {'promptAttemptsSpecification': {'Initial | Retry1 | Retry2 | Retry3 | Retry4 | Retry5': {'allowInterrupt': 'boolean', 'allowedInputTypes': {'allowAudioInput': 'boolean', 'allowDTMFInput': 'boolean'}, 'audioAndDTMFInputSpecification': {'audioSpecification': {'endTimeoutMs': 'integer', 'maxLengthMs': 'integer'}, 'dtmfSpecification': {'deletionCharacter': 'string', 'endCharacter': 'string', 'endTimeoutMs': 'integer', 'maxLength': 'integer'}, 'startTimeoutMs': 'integer'}, 'textInputSpecification': {'startTimeoutMs': 'integer'}}}}}}
Updates the settings for a slot.
See also: AWS API Documentation
Request Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.Parameters
# This section is too large to render. # Please see the AWS API Documentation linked below.
dict
Response Syntax
# This section is too large to render. # Please see the AWS API Documentation linked below.
Response Structure
# This section is too large to render. # Please see the AWS API Documentation linked below.