Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Creates a new session or modifies an existing session with an Amazon Lex bot. Use this operation to enable your application to set the state of the bot.
For more information, see Managing Sessions.
Synopsis
- data PutSession = PutSession' {}
- newPutSession :: Text -> Text -> Text -> PutSession
- putSession_accept :: Lens' PutSession (Maybe Text)
- putSession_activeContexts :: Lens' PutSession (Maybe [ActiveContext])
- putSession_recentIntentSummaryView :: Lens' PutSession (Maybe [IntentSummary])
- putSession_dialogAction :: Lens' PutSession (Maybe DialogAction)
- putSession_sessionAttributes :: Lens' PutSession (Maybe (HashMap Text Text))
- putSession_botName :: Lens' PutSession Text
- putSession_botAlias :: Lens' PutSession Text
- putSession_userId :: Lens' PutSession Text
- data PutSessionResponse = PutSessionResponse' {
- slots :: Maybe Text
- intentName :: Maybe Text
- encodedMessage :: Maybe (Sensitive Text)
- dialogState :: Maybe DialogState
- activeContexts :: Maybe (Sensitive Text)
- messageFormat :: Maybe MessageFormatType
- message :: Maybe (Sensitive Text)
- sessionId :: Maybe Text
- slotToElicit :: Maybe Text
- contentType :: Maybe Text
- sessionAttributes :: Maybe Text
- httpStatus :: Int
- audioStream :: ResponseBody
- newPutSessionResponse :: Int -> ResponseBody -> PutSessionResponse
- putSessionResponse_slots :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_intentName :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_encodedMessage :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_dialogState :: Lens' PutSessionResponse (Maybe DialogState)
- putSessionResponse_activeContexts :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_messageFormat :: Lens' PutSessionResponse (Maybe MessageFormatType)
- putSessionResponse_message :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_sessionId :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_slotToElicit :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_contentType :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_sessionAttributes :: Lens' PutSessionResponse (Maybe Text)
- putSessionResponse_httpStatus :: Lens' PutSessionResponse Int
- putSessionResponse_audioStream :: Lens' PutSessionResponse ResponseBody
Creating a Request
data PutSession Source #
See: newPutSession
smart constructor.
PutSession' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> PutSession |
Create a value of PutSession
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:accept:PutSession'
, putSession_accept
- The message that Amazon Lex returns in the response can be either text
or speech based depending on the value of this field.
- If the value is
text/plain; charset=utf-8
, Amazon Lex returns text in the response. - If the value begins with
audio/
, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech in the configuration that you specify. For example, if you specifyaudio/mpeg
as the value, Amazon Lex returns speech in the MPEG format. - If the value is
audio/pcm
, the speech is returned asaudio/pcm
in 16-bit, little endian format. The following are the accepted values:
audio/mpeg
audio/ogg
audio/pcm
audio/*
(defaults to mpeg)text/plain; charset=utf-8
$sel:activeContexts:PutSession'
, putSession_activeContexts
- 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 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
$sel:recentIntentSummaryView:PutSession'
, putSession_recentIntentSummaryView
- A summary of the recent intents for the bot. You can use the intent
summary view to set a checkpoint label on an intent and modify
attributes of intents. You can also use it to remove or add intent
summary objects to the list.
An intent that you modify or add to the list must make sense for the bot. For example, the intent name must be valid for the bot. You must provide valid values for:
intentName
- slot names
slotToElict
If you send the recentIntentSummaryView
parameter in a PutSession
request, the contents of the new summary view replaces the old summary
view. For example, if a GetSession
request returns three intents in
the summary view and you call PutSession
with one intent in the
summary view, the next call to GetSession
will only return one intent.
$sel:dialogAction:PutSession'
, putSession_dialogAction
- Sets the next action that the bot should take to fulfill the
conversation.
$sel:sessionAttributes:PutSession'
, putSession_sessionAttributes
- Map of key/value pairs representing the session-specific context
information. It contains application information passed between Amazon
Lex and a client application.
$sel:botName:PutSession'
, putSession_botName
- The name of the bot that contains the session data.
$sel:botAlias:PutSession'
, putSession_botAlias
- The alias in use for the bot that contains the session data.
$sel:userId:PutSession'
, putSession_userId
- The ID of the client application user. Amazon Lex uses this to identify
a user's conversation with your bot.
Request Lenses
putSession_accept :: Lens' PutSession (Maybe Text) Source #
The message that Amazon Lex returns in the response can be either text or speech based depending on the value of this field.
- If the value is
text/plain; charset=utf-8
, Amazon Lex returns text in the response. - If the value begins with
audio/
, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech in the configuration that you specify. For example, if you specifyaudio/mpeg
as the value, Amazon Lex returns speech in the MPEG format. - If the value is
audio/pcm
, the speech is returned asaudio/pcm
in 16-bit, little endian format. The following are the accepted values:
audio/mpeg
audio/ogg
audio/pcm
audio/*
(defaults to mpeg)text/plain; charset=utf-8
putSession_activeContexts :: Lens' PutSession (Maybe [ActiveContext]) Source #
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 will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
putSession_recentIntentSummaryView :: Lens' PutSession (Maybe [IntentSummary]) Source #
A summary of the recent intents for the bot. You can use the intent summary view to set a checkpoint label on an intent and modify attributes of intents. You can also use it to remove or add intent summary objects to the list.
An intent that you modify or add to the list must make sense for the bot. For example, the intent name must be valid for the bot. You must provide valid values for:
intentName
- slot names
slotToElict
If you send the recentIntentSummaryView
parameter in a PutSession
request, the contents of the new summary view replaces the old summary
view. For example, if a GetSession
request returns three intents in
the summary view and you call PutSession
with one intent in the
summary view, the next call to GetSession
will only return one intent.
putSession_dialogAction :: Lens' PutSession (Maybe DialogAction) Source #
Sets the next action that the bot should take to fulfill the conversation.
putSession_sessionAttributes :: Lens' PutSession (Maybe (HashMap Text Text)) Source #
Map of key/value pairs representing the session-specific context information. It contains application information passed between Amazon Lex and a client application.
putSession_botName :: Lens' PutSession Text Source #
The name of the bot that contains the session data.
putSession_botAlias :: Lens' PutSession Text Source #
The alias in use for the bot that contains the session data.
putSession_userId :: Lens' PutSession Text Source #
The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot.
Destructuring the Response
data PutSessionResponse Source #
See: newPutSessionResponse
smart constructor.
PutSessionResponse' | |
|
Instances
newPutSessionResponse Source #
:: Int | |
-> ResponseBody | |
-> PutSessionResponse |
Create a value of PutSessionResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:slots:PutSessionResponse'
, putSessionResponse_slots
- Map of zero or more intent slots Amazon Lex detected from the user input
during the conversation.
Amazon Lex creates a resolution list containing likely values for a
slot. The value that it returns is determined by the
valueSelectionStrategy
selected when the slot type was created or
updated. If valueSelectionStrategy
is set to ORIGINAL_VALUE
, the
value provided by the user is returned, if the user value is similar to
the slot values. If valueSelectionStrategy
is set to TOP_RESOLUTION
Amazon Lex returns the first value in the resolution list or, if there
is no resolution list, null. If you don't specify a
valueSelectionStrategy
the default is ORIGINAL_VALUE
.
$sel:intentName:PutSessionResponse'
, putSessionResponse_intentName
- The name of the current intent.
$sel:encodedMessage:PutSessionResponse'
, putSessionResponse_encodedMessage
- The next message that should be presented to the user.
The encodedMessage
field is base-64 encoded. You must decode the field
before you can use the value.
$sel:dialogState:PutSessionResponse'
, putSessionResponse_dialogState
- - ConfirmIntent
- Amazon Lex is expecting a "yes" or "no"
response to confirm the intent before fulfilling an intent.
ElicitIntent
- Amazon Lex wants to elicit the user's intent.ElicitSlot
- Amazon Lex is expecting the value of a slot for the current intent.Failed
- Conveys that the conversation with the user has failed. This can happen for various reasons, including the user does not provide an appropriate response to prompts from the service, or if the Lambda function fails to fulfill the intent.Fulfilled
- Conveys that the Lambda function has sucessfully fulfilled the intent.ReadyForFulfillment
- Conveys that the client has to fulfill the intent.
$sel:activeContexts:PutSession'
, putSessionResponse_activeContexts
- A list of active contexts for the session.
$sel:messageFormat:PutSessionResponse'
, putSessionResponse_messageFormat
- The format of the response message. One of the following values:
PlainText
- The message contains plain UTF-8 text.CustomPayload
- The message is a custom format for the client.SSML
- The message contains text formatted for voice output.Composite
- The message contains an escaped JSON object containing one or more messages from the groups that messages were assigned to when the intent was created.
$sel:message:PutSessionResponse'
, putSessionResponse_message
- The next message that should be presented to the user.
You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419,
es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the
message
field is null. You should use the encodedMessage
field
instead.
$sel:sessionId:PutSessionResponse'
, putSessionResponse_sessionId
- A unique identifier for the session.
$sel:slotToElicit:PutSessionResponse'
, putSessionResponse_slotToElicit
- If the dialogState
is ElicitSlot
, returns the name of the slot for
which Amazon Lex is eliciting a value.
$sel:contentType:PutSessionResponse'
, putSessionResponse_contentType
- Content type as specified in the Accept
HTTP header in the request.
$sel:sessionAttributes:PutSession'
, putSessionResponse_sessionAttributes
- Map of key/value pairs representing session-specific context
information.
$sel:httpStatus:PutSessionResponse'
, putSessionResponse_httpStatus
- The response's http status code.
$sel:audioStream:PutSessionResponse'
, putSessionResponse_audioStream
- The audio version of the message to convey to the user.
Response Lenses
putSessionResponse_slots :: Lens' PutSessionResponse (Maybe Text) Source #
Map of zero or more intent slots Amazon Lex detected from the user input during the conversation.
Amazon Lex creates a resolution list containing likely values for a
slot. The value that it returns is determined by the
valueSelectionStrategy
selected when the slot type was created or
updated. If valueSelectionStrategy
is set to ORIGINAL_VALUE
, the
value provided by the user is returned, if the user value is similar to
the slot values. If valueSelectionStrategy
is set to TOP_RESOLUTION
Amazon Lex returns the first value in the resolution list or, if there
is no resolution list, null. If you don't specify a
valueSelectionStrategy
the default is ORIGINAL_VALUE
.
putSessionResponse_intentName :: Lens' PutSessionResponse (Maybe Text) Source #
The name of the current intent.
putSessionResponse_encodedMessage :: Lens' PutSessionResponse (Maybe Text) Source #
The next message that should be presented to the user.
The encodedMessage
field is base-64 encoded. You must decode the field
before you can use the value.
putSessionResponse_dialogState :: Lens' PutSessionResponse (Maybe DialogState) Source #
ConfirmIntent
- Amazon Lex is expecting a "yes" or "no" response to confirm the intent before fulfilling an intent.ElicitIntent
- Amazon Lex wants to elicit the user's intent.ElicitSlot
- Amazon Lex is expecting the value of a slot for the current intent.Failed
- Conveys that the conversation with the user has failed. This can happen for various reasons, including the user does not provide an appropriate response to prompts from the service, or if the Lambda function fails to fulfill the intent.Fulfilled
- Conveys that the Lambda function has sucessfully fulfilled the intent.ReadyForFulfillment
- Conveys that the client has to fulfill the intent.
putSessionResponse_activeContexts :: Lens' PutSessionResponse (Maybe Text) Source #
A list of active contexts for the session.
putSessionResponse_messageFormat :: Lens' PutSessionResponse (Maybe MessageFormatType) Source #
The format of the response message. One of the following values:
PlainText
- The message contains plain UTF-8 text.CustomPayload
- The message is a custom format for the client.SSML
- The message contains text formatted for voice output.Composite
- The message contains an escaped JSON object containing one or more messages from the groups that messages were assigned to when the intent was created.
putSessionResponse_message :: Lens' PutSessionResponse (Maybe Text) Source #
The next message that should be presented to the user.
You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419,
es-ES, es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the
message
field is null. You should use the encodedMessage
field
instead.
putSessionResponse_sessionId :: Lens' PutSessionResponse (Maybe Text) Source #
A unique identifier for the session.
putSessionResponse_slotToElicit :: Lens' PutSessionResponse (Maybe Text) Source #
If the dialogState
is ElicitSlot
, returns the name of the slot for
which Amazon Lex is eliciting a value.
putSessionResponse_contentType :: Lens' PutSessionResponse (Maybe Text) Source #
Content type as specified in the Accept
HTTP header in the request.
putSessionResponse_sessionAttributes :: Lens' PutSessionResponse (Maybe Text) Source #
Map of key/value pairs representing session-specific context information.
putSessionResponse_httpStatus :: Lens' PutSessionResponse Int Source #
The response's http status code.
putSessionResponse_audioStream :: Lens' PutSessionResponse ResponseBody Source #
The audio version of the message to convey to the user.