Skip to content

Put Session

lexruntimev2_put_session R Documentation

Creates a new session or modifies an existing session with an Amazon Lex V2 bot

Description

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.

Usage

lexruntimev2_put_session(botId, botAliasId, localeId, sessionId,
  messages, sessionState, requestAttributes, responseContentType)

Arguments

botId

[required] The identifier of the bot that receives the session data.

botAliasId

[required] The alias identifier of the bot that receives the session data.

localeId

[required] The locale where the session is in use.

sessionId

[required] The identifier of the session that receives the session data.

messages

A list of messages to send to the user. Messages are sent in the order that they are defined in the list.

sessionState

[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.

requestAttributes

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:⁠.

responseContentType

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.

Value

A list with the following syntax:

list(
  contentType = "string",
  messages = "string",
  sessionState = "string",
  requestAttributes = "string",
  sessionId = "string",
  audioStream = raw
)

Request syntax

svc$put_session(
  botId = "string",
  botAliasId = "string",
  localeId = "string",
  sessionId = "string",
  messages = list(
    list(
      content = "string",
      contentType = "CustomPayload"|"ImageResponseCard"|"PlainText"|"SSML",
      imageResponseCard = list(
        title = "string",
        subtitle = "string",
        imageUrl = "string",
        buttons = list(
          list(
            text = "string",
            value = "string"
          )
        )
      )
    )
  ),
  sessionState = list(
    dialogAction = list(
      type = "Close"|"ConfirmIntent"|"Delegate"|"ElicitIntent"|"ElicitSlot"|"None",
      slotToElicit = "string",
      slotElicitationStyle = "Default"|"SpellByLetter"|"SpellByWord",
      subSlotToElicit = list(
        name = "string",
        subSlotToElicit = list()
      )
    ),
    intent = list(
      name = "string",
      slots = list(
        list(
          value = list(
            originalValue = "string",
            interpretedValue = "string",
            resolvedValues = list(
              "string"
            )
          ),
          shape = "Scalar"|"List"|"Composite",
          values = list(
            list()
          ),
          subSlots = list()
        )
      ),
      state = "Failed"|"Fulfilled"|"InProgress"|"ReadyForFulfillment"|"Waiting"|"FulfillmentInProgress",
      confirmationState = "Confirmed"|"Denied"|"None"
    ),
    activeContexts = list(
      list(
        name = "string",
        timeToLive = list(
          timeToLiveInSeconds = 123,
          turnsToLive = 123
        ),
        contextAttributes = list(
          "string"
        )
      )
    ),
    sessionAttributes = list(
      "string"
    ),
    originatingRequestId = "string",
    runtimeHints = list(
      slotHints = list(
        list(
          list(
            runtimeHintValues = list(
              list(
                phrase = "string"
              )
            ),
            subSlotHints = list()
          )
        )
      )
    )
  ),
  requestAttributes = list(
    "string"
  ),
  responseContentType = "string"
)