libZSservicesZSamazonka-lex-runtimeZSamazonka-lex-runtime
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.LexRuntime.PutSession

Description

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

Creating a Request

data PutSession Source #

See: newPutSession smart constructor.

Constructors

PutSession' 

Fields

  • accept :: Maybe Text

    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 specify audio/mpeg as the value, Amazon Lex returns speech in the MPEG format.
    • If the value is audio/pcm, the speech is returned as audio/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
  • activeContexts :: Maybe (Sensitive [ActiveContext])

    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.

  • recentIntentSummaryView :: Maybe [IntentSummary]

    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.

  • dialogAction :: Maybe DialogAction

    Sets the next action that the bot should take to fulfill the conversation.

  • sessionAttributes :: Maybe (Sensitive (HashMap Text Text))

    Map of key/value pairs representing the session-specific context information. It contains application information passed between Amazon Lex and a client application.

  • botName :: Text

    The name of the bot that contains the session data.

  • botAlias :: Text

    The alias in use for the bot that contains the session data.

  • userId :: Text

    The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot.

Instances

Instances details
Eq PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Show PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Generic PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Associated Types

type Rep PutSession :: Type -> Type #

NFData PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Methods

rnf :: PutSession -> () #

Hashable PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

ToJSON PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

AWSRequest PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Associated Types

type AWSResponse PutSession #

ToHeaders PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Methods

toHeaders :: PutSession -> [Header] #

ToPath PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

ToQuery PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

type Rep PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

type AWSResponse PutSession Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

newPutSession Source #

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 specify audio/mpeg as the value, Amazon Lex returns speech in the MPEG format.
  • If the value is audio/pcm, the speech is returned as audio/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 specify audio/mpeg as the value, Amazon Lex returns speech in the MPEG format.
  • If the value is audio/pcm, the speech is returned as audio/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.

Constructors

PutSessionResponse' 

Fields

  • slots :: Maybe Text

    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.

  • intentName :: Maybe Text

    The name of the current intent.

  • encodedMessage :: Maybe (Sensitive Text)

    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.

  • dialogState :: Maybe 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.
  • activeContexts :: Maybe (Sensitive Text)

    A list of active contexts for the session.

  • messageFormat :: Maybe MessageFormatType

    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.
  • message :: Maybe (Sensitive Text)

    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.

  • sessionId :: Maybe Text

    A unique identifier for the session.

  • slotToElicit :: Maybe Text

    If the dialogState is ElicitSlot, returns the name of the slot for which Amazon Lex is eliciting a value.

  • contentType :: Maybe Text

    Content type as specified in the Accept HTTP header in the request.

  • sessionAttributes :: Maybe Text

    Map of key/value pairs representing session-specific context information.

  • httpStatus :: Int

    The response's http status code.

  • audioStream :: ResponseBody

    The audio version of the message to convey to the user.

Instances

Instances details
Show PutSessionResponse Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Generic PutSessionResponse Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

Associated Types

type Rep PutSessionResponse :: Type -> Type #

type Rep PutSessionResponse Source # 
Instance details

Defined in Amazonka.LexRuntime.PutSession

type Rep PutSessionResponse = D1 ('MetaData "PutSessionResponse" "Amazonka.LexRuntime.PutSession" "libZSservicesZSamazonka-lex-runtimeZSamazonka-lex-runtime" 'False) (C1 ('MetaCons "PutSessionResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "slots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "intentName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "encodedMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Text))))) :*: (S1 ('MetaSel ('Just "dialogState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DialogState)) :*: (S1 ('MetaSel ('Just "activeContexts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Text))) :*: S1 ('MetaSel ('Just "messageFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe MessageFormatType))))) :*: ((S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Text))) :*: (S1 ('MetaSel ('Just "sessionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "slotToElicit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "contentType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "sessionAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "audioStream") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ResponseBody))))))

newPutSessionResponse Source #

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_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_audioStream :: Lens' PutSessionResponse ResponseBody Source #

The audio version of the message to convey to the user.