2022/01/13 - Amazon Lex Runtime V2 - 4 updated api methods
{'sessionState': {'runtimeHints': {'slotHints': {'string': {'string': {'runtimeHintValues': [{'phrase': 'string'}]}}}}}}
Returns session information for a specified bot, alias, and user.
For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.
If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns a BadRequestException. If the locale doesn't exist or is not enabled for the alias, you receive a BadRequestException.
See also: AWS API Documentation
Request Syntax
client.get_session( botId='string', botAliasId='string', localeId='string', sessionId='string' )
string
[REQUIRED]
The identifier of the bot that contains the session data.
string
[REQUIRED]
The alias identifier in use for the bot that contains the session data.
string
[REQUIRED]
The locale where the session is in use.
string
[REQUIRED]
The identifier of the session to return.
dict
Response Syntax
{ 'sessionId': 'string', 'messages': [ { 'content': 'string', 'contentType': 'CustomPayload'|'ImageResponseCard'|'PlainText'|'SSML', 'imageResponseCard': { 'title': 'string', 'subtitle': 'string', 'imageUrl': 'string', 'buttons': [ { 'text': 'string', 'value': 'string' }, ] } }, ], 'interpretations': [ { 'nluConfidence': { 'score': 123.0 }, 'sentimentResponse': { 'sentiment': 'MIXED'|'NEGATIVE'|'NEUTRAL'|'POSITIVE', 'sentimentScore': { 'positive': 123.0, 'negative': 123.0, 'neutral': 123.0, 'mixed': 123.0 } }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' } }, ], 'sessionState': { 'dialogAction': { 'type': 'Close'|'ConfirmIntent'|'Delegate'|'ElicitIntent'|'ElicitSlot'|'None', 'slotToElicit': 'string', 'slotElicitationStyle': 'Default'|'SpellByLetter'|'SpellByWord' }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' }, 'activeContexts': [ { 'name': 'string', 'timeToLive': { 'timeToLiveInSeconds': 123, 'turnsToLive': 123 }, 'contextAttributes': { 'string': 'string' } }, ], 'sessionAttributes': { 'string': 'string' }, 'originatingRequestId': 'string', 'runtimeHints': { 'slotHints': { 'string': { 'string': { 'runtimeHintValues': [ { 'phrase': 'string' }, ] } } } } } }
Response Structure
(dict) --
sessionId (string) --
The identifier of the returned session.
messages (list) --
A list of messages that were last sent to the user. The messages are ordered based on the order that your returned the messages from your Lambda function or the order that messages are defined in the bot.
(dict) --
Container for text that is returned to the customer..
content (string) --
The text of the message.
contentType (string) --
Indicates the type of response.
imageResponseCard (dict) --
A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
When you use a response card, the response from the user is constrained to the text associated with a button on the card.
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) --
A button that appears on a response card show to the user.
text (string) --
The text that is displayed on the button.
value (string) --
The value returned to Amazon Lex V2 when a user chooses the button.
interpretations (list) --
A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.
Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.
(dict) --
An intent that Amazon Lex V2 determined might satisfy the user's utterance. The intents are ordered by the confidence score.
nluConfidence (dict) --
Determines the threshold where Amazon Lex V2 will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.
score (float) --
A score that indicates how confident Amazon Lex V2 is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.
sentimentResponse (dict) --
The sentiment expressed in an utterance.
When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.
sentiment (string) --
The overall sentiment expressed in the user's response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend.
sentimentScore (dict) --
The individual sentiment responses for the utterance.
positive (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE sentiment.
negative (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE sentiment.
neutral (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL sentiment.
mixed (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED sentiment.
intent (dict) --
A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
sessionState (dict) --
Represents the current state of the dialog between the user and the bot.
You can use this to determine the progress of the conversation and what the next action might be.
dialogAction (dict) --
The next step that Amazon Lex V2 should take in the conversation with a user.
type (string) --
The next action that the bot should take in its interaction with the user. The possible values are:
Close - Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate - The next action is determined by Amazon Lex V2.
ElicitSlot - The next action is to elicit a slot value from the user.
slotToElicit (string) --
The name of the slot that should be elicited from the user.
slotElicitationStyle (string) --
Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.
Spell by letter - "b" "o" "b"
Spell by word - "b as in boy" "o as in oscar" "b as in boy"
For more information, see Using spelling to enter slot values.
intent (dict) --
The active intent that Amazon Lex V2 is processing.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
activeContexts (list) --
One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.
(dict) --
Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.
name (string) --
The name of the context.
timeToLive (dict) --
Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.
timeToLiveInSeconds (integer) --
The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
turnsToLive (integer) --
The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
contextAttributes (dict) --
A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
(string) --
(string) --
sessionAttributes (dict) --
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.
(string) --
(string) --
originatingRequestId (string) --
A unique identifier for a specific request.
runtimeHints (dict) --
Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.
slotHints (dict) --
A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.
The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.
The intent name and slot name must exist.
(string) --
(dict) --
(string) --
(dict) --
Provides an array of phrases that should be given preference when resolving values for a slot.
runtimeHintValues (list) --
One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.
(dict) --
Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.
phrase (string) --
The phrase that Amazon Lex V2 should look for in the user's input to the bot.
{'sessionState': {'runtimeHints': {'slotHints': {'string': {'string': {'runtimeHintValues': [{'phrase': 'string'}]}}}}}}
Creates a new session or modifies an existing session with an Amazon Lex V2 bot. Use this operation to enable your application to set the state of the bot.
See also: AWS API Documentation
Request Syntax
client.put_session( botId='string', botAliasId='string', localeId='string', sessionId='string', messages=[ { 'content': 'string', 'contentType': 'CustomPayload'|'ImageResponseCard'|'PlainText'|'SSML', 'imageResponseCard': { 'title': 'string', 'subtitle': 'string', 'imageUrl': 'string', 'buttons': [ { 'text': 'string', 'value': 'string' }, ] } }, ], sessionState={ 'dialogAction': { 'type': 'Close'|'ConfirmIntent'|'Delegate'|'ElicitIntent'|'ElicitSlot'|'None', 'slotToElicit': 'string', 'slotElicitationStyle': 'Default'|'SpellByLetter'|'SpellByWord' }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' }, 'activeContexts': [ { 'name': 'string', 'timeToLive': { 'timeToLiveInSeconds': 123, 'turnsToLive': 123 }, 'contextAttributes': { 'string': 'string' } }, ], 'sessionAttributes': { 'string': 'string' }, 'originatingRequestId': 'string', 'runtimeHints': { 'slotHints': { 'string': { 'string': { 'runtimeHintValues': [ { 'phrase': 'string' }, ] } } } } }, requestAttributes={ 'string': 'string' }, responseContentType='string' )
string
[REQUIRED]
The identifier of the bot that receives the session data.
string
[REQUIRED]
The alias identifier of the bot that receives the session data.
string
[REQUIRED]
The locale where the session is in use.
string
[REQUIRED]
The identifier of the session that receives the session data.
list
A list of messages to send to the user. Messages are sent in the order that they are defined in the list.
(dict) --
Container for text that is returned to the customer..
content (string) --
The text of the message.
contentType (string) -- [REQUIRED]
Indicates the type of response.
imageResponseCard (dict) --
A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
When you use a response card, the response from the user is constrained to the text associated with a button on the card.
title (string) -- [REQUIRED]
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) --
A button that appears on a response card show to the user.
text (string) -- [REQUIRED]
The text that is displayed on the button.
value (string) -- [REQUIRED]
The value returned to Amazon Lex V2 when a user chooses the button.
dict
[REQUIRED]
Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.
dialogAction (dict) --
The next step that Amazon Lex V2 should take in the conversation with a user.
type (string) -- [REQUIRED]
The next action that the bot should take in its interaction with the user. The possible values are:
Close - Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate - The next action is determined by Amazon Lex V2.
ElicitSlot - The next action is to elicit a slot value from the user.
slotToElicit (string) --
The name of the slot that should be elicited from the user.
slotElicitationStyle (string) --
Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.
Spell by letter - "b" "o" "b"
Spell by word - "b as in boy" "o as in oscar" "b as in boy"
For more information, see Using spelling to enter slot values.
intent (dict) --
The active intent that Amazon Lex V2 is processing.
name (string) -- [REQUIRED]
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) -- [REQUIRED]
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
activeContexts (list) --
One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.
(dict) --
Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.
name (string) -- [REQUIRED]
The name of the context.
timeToLive (dict) -- [REQUIRED]
Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.
timeToLiveInSeconds (integer) -- [REQUIRED]
The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
turnsToLive (integer) -- [REQUIRED]
The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
contextAttributes (dict) -- [REQUIRED]
A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
(string) --
(string) --
sessionAttributes (dict) --
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.
(string) --
(string) --
originatingRequestId (string) --
A unique identifier for a specific request.
runtimeHints (dict) --
Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.
slotHints (dict) --
A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.
The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.
The intent name and slot name must exist.
(string) --
(dict) --
(string) --
(dict) --
Provides an array of phrases that should be given preference when resolving values for a slot.
runtimeHintValues (list) -- [REQUIRED]
One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.
(dict) --
Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.
phrase (string) -- [REQUIRED]
The phrase that Amazon Lex V2 should look for in the user's input to the bot.
dict
Request-specific information passed between Amazon Lex V2 and the client application.
The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes with the prefix x-amz-lex:.
(string) --
(string) --
string
The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter.
If the value is text/plain; charset=utf-8, Amazon Lex V2 returns text in the response.
dict
Response Syntax
{ 'contentType': 'string', 'messages': 'string', 'sessionState': 'string', 'requestAttributes': 'string', 'sessionId': 'string', 'audioStream': StreamingBody() }
Response Structure
(dict) --
contentType (string) --
The type of response. Same as the type specified in the responseContentType field in the request.
messages (string) --
A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.
sessionState (string) --
Represents the current state of the dialog between the user and the bot.
Use this to determine the progress of the conversation and what the next action may be.
requestAttributes (string) --
Request-specific information passed between the client application and Amazon Lex V2. These are the same as the requestAttribute parameter in the call to the PutSession operation.
sessionId (string) --
The identifier of the session that received the data.
audioStream (:class:`.StreamingBody`) --
If the requested content type was audio, the audio version of the message to convey to the user.
{'sessionState': {'runtimeHints': {'slotHints': {'string': {'string': {'runtimeHintValues': [{'phrase': 'string'}]}}}}}}
Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.
In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
See also: AWS API Documentation
Request Syntax
client.recognize_text( botId='string', botAliasId='string', localeId='string', sessionId='string', text='string', sessionState={ 'dialogAction': { 'type': 'Close'|'ConfirmIntent'|'Delegate'|'ElicitIntent'|'ElicitSlot'|'None', 'slotToElicit': 'string', 'slotElicitationStyle': 'Default'|'SpellByLetter'|'SpellByWord' }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' }, 'activeContexts': [ { 'name': 'string', 'timeToLive': { 'timeToLiveInSeconds': 123, 'turnsToLive': 123 }, 'contextAttributes': { 'string': 'string' } }, ], 'sessionAttributes': { 'string': 'string' }, 'originatingRequestId': 'string', 'runtimeHints': { 'slotHints': { 'string': { 'string': { 'runtimeHintValues': [ { 'phrase': 'string' }, ] } } } } }, requestAttributes={ 'string': 'string' } )
string
[REQUIRED]
The identifier of the bot that processes the request.
string
[REQUIRED]
The alias identifier in use for the bot that processes the request.
string
[REQUIRED]
The locale where the session is in use.
string
[REQUIRED]
The identifier of the user session that is having the conversation.
string
[REQUIRED]
The text that the user entered. Amazon Lex V2 interprets this text.
dict
The current state of the dialog between the user and the bot.
dialogAction (dict) --
The next step that Amazon Lex V2 should take in the conversation with a user.
type (string) -- [REQUIRED]
The next action that the bot should take in its interaction with the user. The possible values are:
Close - Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate - The next action is determined by Amazon Lex V2.
ElicitSlot - The next action is to elicit a slot value from the user.
slotToElicit (string) --
The name of the slot that should be elicited from the user.
slotElicitationStyle (string) --
Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.
Spell by letter - "b" "o" "b"
Spell by word - "b as in boy" "o as in oscar" "b as in boy"
For more information, see Using spelling to enter slot values.
intent (dict) --
The active intent that Amazon Lex V2 is processing.
name (string) -- [REQUIRED]
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) -- [REQUIRED]
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
activeContexts (list) --
One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.
(dict) --
Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.
name (string) -- [REQUIRED]
The name of the context.
timeToLive (dict) -- [REQUIRED]
Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.
timeToLiveInSeconds (integer) -- [REQUIRED]
The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
turnsToLive (integer) -- [REQUIRED]
The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
contextAttributes (dict) -- [REQUIRED]
A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
(string) --
(string) --
sessionAttributes (dict) --
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.
(string) --
(string) --
originatingRequestId (string) --
A unique identifier for a specific request.
runtimeHints (dict) --
Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.
slotHints (dict) --
A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.
The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.
The intent name and slot name must exist.
(string) --
(dict) --
(string) --
(dict) --
Provides an array of phrases that should be given preference when resolving values for a slot.
runtimeHintValues (list) -- [REQUIRED]
One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.
(dict) --
Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.
phrase (string) -- [REQUIRED]
The phrase that Amazon Lex V2 should look for in the user's input to the bot.
dict
Request-specific information passed between the client application and Amazon Lex V2
The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes with the prefix x-amz-lex:.
(string) --
(string) --
dict
Response Syntax
{ 'messages': [ { 'content': 'string', 'contentType': 'CustomPayload'|'ImageResponseCard'|'PlainText'|'SSML', 'imageResponseCard': { 'title': 'string', 'subtitle': 'string', 'imageUrl': 'string', 'buttons': [ { 'text': 'string', 'value': 'string' }, ] } }, ], 'sessionState': { 'dialogAction': { 'type': 'Close'|'ConfirmIntent'|'Delegate'|'ElicitIntent'|'ElicitSlot'|'None', 'slotToElicit': 'string', 'slotElicitationStyle': 'Default'|'SpellByLetter'|'SpellByWord' }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' }, 'activeContexts': [ { 'name': 'string', 'timeToLive': { 'timeToLiveInSeconds': 123, 'turnsToLive': 123 }, 'contextAttributes': { 'string': 'string' } }, ], 'sessionAttributes': { 'string': 'string' }, 'originatingRequestId': 'string', 'runtimeHints': { 'slotHints': { 'string': { 'string': { 'runtimeHintValues': [ { 'phrase': 'string' }, ] } } } } }, 'interpretations': [ { 'nluConfidence': { 'score': 123.0 }, 'sentimentResponse': { 'sentiment': 'MIXED'|'NEGATIVE'|'NEUTRAL'|'POSITIVE', 'sentimentScore': { 'positive': 123.0, 'negative': 123.0, 'neutral': 123.0, 'mixed': 123.0 } }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' } }, ], 'requestAttributes': { 'string': 'string' }, 'sessionId': 'string' }
Response Structure
(dict) --
messages (list) --
A list of messages last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.
(dict) --
Container for text that is returned to the customer..
content (string) --
The text of the message.
contentType (string) --
Indicates the type of response.
imageResponseCard (dict) --
A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
When you use a response card, the response from the user is constrained to the text associated with a button on the card.
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) --
A button that appears on a response card show to the user.
text (string) --
The text that is displayed on the button.
value (string) --
The value returned to Amazon Lex V2 when a user chooses the button.
sessionState (dict) --
Represents the current state of the dialog between the user and the bot.
Use this to determine the progress of the conversation and what the next action may be.
dialogAction (dict) --
The next step that Amazon Lex V2 should take in the conversation with a user.
type (string) --
The next action that the bot should take in its interaction with the user. The possible values are:
Close - Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate - The next action is determined by Amazon Lex V2.
ElicitSlot - The next action is to elicit a slot value from the user.
slotToElicit (string) --
The name of the slot that should be elicited from the user.
slotElicitationStyle (string) --
Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.
Spell by letter - "b" "o" "b"
Spell by word - "b as in boy" "o as in oscar" "b as in boy"
For more information, see Using spelling to enter slot values.
intent (dict) --
The active intent that Amazon Lex V2 is processing.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
activeContexts (list) --
One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.
(dict) --
Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.
name (string) --
The name of the context.
timeToLive (dict) --
Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.
timeToLiveInSeconds (integer) --
The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
turnsToLive (integer) --
The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
contextAttributes (dict) --
A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
(string) --
(string) --
sessionAttributes (dict) --
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.
(string) --
(string) --
originatingRequestId (string) --
A unique identifier for a specific request.
runtimeHints (dict) --
Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.
slotHints (dict) --
A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.
The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.
The intent name and slot name must exist.
(string) --
(dict) --
(string) --
(dict) --
Provides an array of phrases that should be given preference when resolving values for a slot.
runtimeHintValues (list) --
One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.
(dict) --
Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.
phrase (string) --
The phrase that Amazon Lex V2 should look for in the user's input to the bot.
interpretations (list) --
A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.
Each interpretation includes the intent, a score that indicates now confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.
(dict) --
An intent that Amazon Lex V2 determined might satisfy the user's utterance. The intents are ordered by the confidence score.
nluConfidence (dict) --
Determines the threshold where Amazon Lex V2 will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.
score (float) --
A score that indicates how confident Amazon Lex V2 is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.
sentimentResponse (dict) --
The sentiment expressed in an utterance.
When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.
sentiment (string) --
The overall sentiment expressed in the user's response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend.
sentimentScore (dict) --
The individual sentiment responses for the utterance.
positive (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE sentiment.
negative (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE sentiment.
neutral (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL sentiment.
mixed (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED sentiment.
intent (dict) --
A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
requestAttributes (dict) --
The attributes sent in the request.
(string) --
(string) --
sessionId (string) --
The identifier of the session in use.
{'requestEventStream': {'ConfigurationEvent': {'sessionState': {'runtimeHints': {'slotHints': {'string': {'string': {'runtimeHintValues': [{'phrase': 'string'}]}}}}}}}}Response
{'responseEventStream': {'IntentResultEvent': {'sessionState': {'runtimeHints': {'slotHints': {'string': {'string': {'runtimeHintValues': [{'phrase': 'string'}]}}}}}}}}
Starts an HTTP/2 bidirectional event stream that enables you to send audio, text, or DTMF input in real time. After your application starts a conversation, users send input to Amazon Lex V2 as a stream of events. Amazon Lex V2 processes the incoming events and responds with streaming text or audio events.
Audio input must be in the following format: audio/lpcm sample-rate=8000 sample-size-bits=16 channel-count=1; is-big-endian=false.
If the optional post-fulfillment response is specified, the messages are returned as follows. For more information, see PostFulfillmentStatusSpecification.
Success message - Returned if the Lambda function completes successfully and the intent state is fulfilled or ready fulfillment if the message is present.
Failed message - The failed message is returned if the Lambda function throws an exception or if the Lambda function returns a failed intent state without a message.
Timeout message - If you don't configure a timeout message and a timeout, and the Lambda function doesn't return within 30 seconds, the timeout message is returned. If you configure a timeout, the timeout message is returned when the period times out.
For more information, see Completion message.
If the optional update message is configured, it is played at the specified frequency while the Lambda function is running and the update message state is active. If the fulfillment update message is not active, the Lambda function runs with a 30 second timeout.
For more information, see Update message
The StartConversation operation is supported only in the following SDKs:
See also: AWS API Documentation
Request Syntax
client.start_conversation( botId='string', botAliasId='string', localeId='string', sessionId='string', conversationMode='AUDIO'|'TEXT', requestEventStream={...} )
string
[REQUIRED]
The identifier of the bot to process the request.
string
[REQUIRED]
The alias identifier in use for the bot that processes the request.
string
[REQUIRED]
The locale where the session is in use.
string
[REQUIRED]
The identifier of the user session that is having the conversation.
string
The conversation type that you are using the Amazon Lex V2. If the conversation mode is AUDIO you can send both audio and DTMF information. If the mode is TEXT you can only send text.
dict
[REQUIRED]
Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames.
dict
The response of this operation contains an :class:`.EventStream` member. When iterated the :class:`.EventStream` will yield events based on the structure below, where only one of the top level keys will be present for any given event.
Response Syntax
{ 'responseEventStream': EventStream({ 'PlaybackInterruptionEvent': { 'eventReason': 'DTMF_START_DETECTED'|'TEXT_DETECTED'|'VOICE_START_DETECTED', 'causedByEventId': 'string', 'eventId': 'string' }, 'TranscriptEvent': { 'transcript': 'string', 'eventId': 'string' }, 'IntentResultEvent': { 'inputMode': 'Text'|'Speech'|'DTMF', 'interpretations': [ { 'nluConfidence': { 'score': 123.0 }, 'sentimentResponse': { 'sentiment': 'MIXED'|'NEGATIVE'|'NEUTRAL'|'POSITIVE', 'sentimentScore': { 'positive': 123.0, 'negative': 123.0, 'neutral': 123.0, 'mixed': 123.0 } }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' } }, ], 'sessionState': { 'dialogAction': { 'type': 'Close'|'ConfirmIntent'|'Delegate'|'ElicitIntent'|'ElicitSlot'|'None', 'slotToElicit': 'string', 'slotElicitationStyle': 'Default'|'SpellByLetter'|'SpellByWord' }, 'intent': { 'name': 'string', 'slots': { 'string': { 'value': { 'originalValue': 'string', 'interpretedValue': 'string', 'resolvedValues': [ 'string', ] }, 'shape': 'Scalar'|'List', 'values': [ {'... recursive ...'}, ] } }, 'state': 'Failed'|'Fulfilled'|'InProgress'|'ReadyForFulfillment'|'Waiting'|'FulfillmentInProgress', 'confirmationState': 'Confirmed'|'Denied'|'None' }, 'activeContexts': [ { 'name': 'string', 'timeToLive': { 'timeToLiveInSeconds': 123, 'turnsToLive': 123 }, 'contextAttributes': { 'string': 'string' } }, ], 'sessionAttributes': { 'string': 'string' }, 'originatingRequestId': 'string', 'runtimeHints': { 'slotHints': { 'string': { 'string': { 'runtimeHintValues': [ { 'phrase': 'string' }, ] } } } } }, 'requestAttributes': { 'string': 'string' }, 'sessionId': 'string', 'eventId': 'string' }, 'TextResponseEvent': { 'messages': [ { 'content': 'string', 'contentType': 'CustomPayload'|'ImageResponseCard'|'PlainText'|'SSML', 'imageResponseCard': { 'title': 'string', 'subtitle': 'string', 'imageUrl': 'string', 'buttons': [ { 'text': 'string', 'value': 'string' }, ] } }, ], 'eventId': 'string' }, 'AudioResponseEvent': { 'audioChunk': b'bytes', 'contentType': 'string', 'eventId': 'string' }, 'HeartbeatEvent': { 'eventId': 'string' }, 'AccessDeniedException': { 'message': 'string' }, 'ResourceNotFoundException': { 'message': 'string' }, 'ValidationException': { 'message': 'string' }, 'ThrottlingException': { 'message': 'string' }, 'InternalServerException': { 'message': 'string' }, 'ConflictException': { 'message': 'string' }, 'DependencyFailedException': { 'message': 'string' }, 'BadGatewayException': { 'message': 'string' } }) }
Response Structure
(dict) --
responseEventStream (:class:`.EventStream`) --
Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.
PlaybackInterruptionEvent (dict) --
Event sent from Amazon Lex V2 to indicate to the client application should stop playback of audio. For example, if the client is playing a prompt that asks for the user's telephone number, the user might start to say the phone number before the prompt is complete. Amazon Lex V2 sends this event to the client application to indicate that the user is responding and that Amazon Lex V2 is processing their input.
eventReason (string) --
Indicates the type of user input that Amazon Lex V2 detected.
causedByEventId (string) --
The identifier of the event that contained the audio, DTMF, or text that caused the interruption.
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
TranscriptEvent (dict) --
Event sent from Amazon Lex V2 to your client application that contains a transcript of voice audio.
transcript (string) --
The transcript of the voice audio from the user.
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
IntentResultEvent (dict) --
Event sent from Amazon Lex V2 to the client application containing the current state of the conversation between the user and Amazon Lex V2.
inputMode (string) --
Indicates whether the input to the operation was text or speech.
interpretations (list) --
A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.
Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.
(dict) --
An intent that Amazon Lex V2 determined might satisfy the user's utterance. The intents are ordered by the confidence score.
nluConfidence (dict) --
Determines the threshold where Amazon Lex V2 will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.
score (float) --
A score that indicates how confident Amazon Lex V2 is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.
sentimentResponse (dict) --
The sentiment expressed in an utterance.
When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.
sentiment (string) --
The overall sentiment expressed in the user's response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend.
sentimentScore (dict) --
The individual sentiment responses for the utterance.
positive (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE sentiment.
negative (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE sentiment.
neutral (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL sentiment.
mixed (float) --
The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED sentiment.
intent (dict) --
A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
sessionState (dict) --
The state of the user's session with Amazon Lex V2.
dialogAction (dict) --
The next step that Amazon Lex V2 should take in the conversation with a user.
type (string) --
The next action that the bot should take in its interaction with the user. The possible values are:
Close - Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent - The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate - The next action is determined by Amazon Lex V2.
ElicitSlot - The next action is to elicit a slot value from the user.
slotToElicit (string) --
The name of the slot that should be elicited from the user.
slotElicitationStyle (string) --
Configures the slot to use spell-by-letter or spell-by-word style. When you use a style on a slot, users can spell out their input to make it clear to your bot.
Spell by letter - "b" "o" "b"
Spell by word - "b as in boy" "o as in oscar" "b as in boy"
For more information, see Using spelling to enter slot values.
intent (dict) --
The active intent that Amazon Lex V2 is processing.
name (string) --
The name of the intent.
slots (dict) --
A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.
(string) --
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
value (dict) --
The current value of the slot.
originalValue (string) --
The text of the utterance from the user that was entered for the slot.
interpretedValue (string) --
The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues list.
resolvedValues (list) --
A list of additional values that have been recognized for the slot.
(string) --
shape (string) --
When the shape value is List, it indicates that the values field contains a list of slot values. When the value is Scalar, it indicates that the value field contains a single value.
values (list) --
A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple."
(dict) --
A value that Amazon Lex V2 uses to fulfill an intent.
state (string) --
Contains fulfillment information for the intent.
confirmationState (string) --
Contains information about whether fulfillment of the intent has been confirmed.
activeContexts (list) --
One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.
(dict) --
Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled, only intents that have order-fulfilled configured as a trigger are considered for follow up.
name (string) --
The name of the context.
timeToLive (dict) --
Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.
timeToLiveInSeconds (integer) --
The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
turnsToLive (integer) --
The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
contextAttributes (dict) --
A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don't specify a list of contexts, Amazon Lex V2 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
(string) --
(string) --
sessionAttributes (dict) --
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application.
(string) --
(string) --
originatingRequestId (string) --
A unique identifier for a specific request.
runtimeHints (dict) --
Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the correct value of a slot.
slotHints (dict) --
A list of the slots in the intent that should have runtime hints added, and the phrases that should be added for each slot.
The first level of the slotHints map is the name of the intent. The second level is the name of the slot within the intent. For more information, see Using hints to improve accuracy.
The intent name and slot name must exist.
(string) --
(dict) --
(string) --
(dict) --
Provides an array of phrases that should be given preference when resolving values for a slot.
runtimeHintValues (list) --
One or more strings that Amazon Lex V2 should look for in the input to the bot. Each phrase is given preference when deciding on slot values.
(dict) --
Provides the phrase that Amazon Lex V2 should look for in the user's input to the bot.
phrase (string) --
The phrase that Amazon Lex V2 should look for in the user's input to the bot.
requestAttributes (dict) --
The attributes sent in the request.
(string) --
(string) --
sessionId (string) --
The identifier of the session in use.
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
TextResponseEvent (dict) --
The event sent from Amazon Lex V2 to your application with text to present to the user.
messages (list) --
A list of messages to send to the user. Messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.
(dict) --
Container for text that is returned to the customer..
content (string) --
The text of the message.
contentType (string) --
Indicates the type of response.
imageResponseCard (dict) --
A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
When you use a response card, the response from the user is constrained to the text associated with a button on the card.
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) --
A button that appears on a response card show to the user.
text (string) --
The text that is displayed on the button.
value (string) --
The value returned to Amazon Lex V2 when a user chooses the button.
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
AudioResponseEvent (dict) --
An event sent from Amazon Lex V2 to your client application containing audio to play to the user.
audioChunk (bytes) --
A chunk of the audio to play.
contentType (string) --
The encoding of the audio chunk. This is the same as the encoding configure in the contentType field of the ConfigurationEvent.
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
HeartbeatEvent (dict) --
Event that Amazon Lex V2 sends to indicate that the stream is still open between the client application and Amazon Lex V2
eventId (string) --
A unique identifier of the event sent by Amazon Lex V2. The identifier is in the form RESPONSE-N, where N is a number starting with one and incremented for each event sent by Amazon Lex V2 in the current session.
AccessDeniedException (dict) --
Exception thrown when the credentials passed with the request are invalid or expired. Also thrown when the credentials in the request do not have permission to access the StartConversation operation.
message (string) --
ResourceNotFoundException (dict) --
Exception thrown if one of the input parameters points to a resource that does not exist. For example, if the bot ID specified does not exist.
message (string) --
ValidationException (dict) --
Exception thrown when one or more parameters could not be validated. The message contains the name of the field that isn't valid.
message (string) --
ThrottlingException (dict) --
Exception thrown when your application exceeds the maximum number of concurrent requests.
message (string) --
InternalServerException (dict) --
An error occurred with Amazon Lex V2.
message (string) --
ConflictException (dict) --
Exception thrown when two clients are using the same AWS account, Amazon Lex V2 bot, and session ID.
message (string) --
DependencyFailedException (dict) --
message (string) --
BadGatewayException (dict) --
message (string) --