Skip to content

aws.lex_runtime.get_session

Example SQL Queries

SELECT * FROM
aws.lex_runtime.get_session
WHERE
"bot_name" = 'VALUE'
AND "bot_alias" = 'VALUE'
AND "user_id" = 'VALUE';

Description

Returns session information for a specified bot, alias, and user ID.

Table Definition

Column NameColumn Data Type
bot_alias Required Input Column

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

VARCHAR
bot_name Required Input Column

The name of the bot that contains the session data.

VARCHAR
user_id Required Input Column

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

VARCHAR
checkpoint_label_filter Input Column

A string used to filter the intents returned in the recentIntentSummaryView structure.

When you specify a filter, only intents with their checkpointLabel field set to that string are returned.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

active_contexts

A list of active contexts for the session. A context can be set when an intent is fulfilled or by calling the PostContent, PostText, or PutSession operation.

You can use a context to control the intents that can follow up an intent, or to modify the operation of your application.

STRUCT(
"name" VARCHAR,
"time_to_live" STRUCT(
"time_to_live_in_seconds" BIGINT,
"turns_to_live" BIGINT
),
"parameters" MAP(VARCHAR, VARCHAR)
)[]
Show child fields
active_contexts[]
Show child fields
active_contexts[].name

The name of the context.

active_contexts[].parameters

State variables for the current context. You can use these values as default values for slots in subsequent events.

active_contexts[].time_to_live

The length of time or number of turns that a context remains active.

Show child fields
active_contexts[].time_to_live.time_to_live_in_seconds

The number of seconds that the context should be active after it is first sent in a PostContent or PostText response. You can set the value between 5 and 86,400 seconds (24 hours).

active_contexts[].time_to_live.turns_to_live

The number of conversation turns that the context should be active. A conversation turn is one PostContent or PostText request and the corresponding response from Amazon Lex.

dialog_action

Describes the current state of the bot.

STRUCT(
"type" VARCHAR,
"intent_name" VARCHAR,
"slots" MAP(VARCHAR, VARCHAR),
"slot_to_elicit" VARCHAR,
"fulfillment_state" VARCHAR,
"message" VARCHAR,
"message_format" VARCHAR
)
Show child fields
dialog_action.fulfillment_state

The fulfillment state of the intent. The possible values are:

  • Failed - The Lambda function associated with the intent failed to fulfill the intent.

  • Fulfilled - The intent has fulfilled by the Lambda function associated with the intent.

  • ReadyForFulfillment - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.

dialog_action.intent_name

The name of the intent.

dialog_action.message

The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message configured for the intent.

dialog_action.message_format
  • 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. For more information, see Message Groups.

dialog_action.slot_to_elicit

The name of the slot that should be elicited from the user.

dialog_action.slots

Map of the slots that have been gathered and their values.

dialog_action.type

The next action that the bot should take in its interaction with the user. The possible values are:

  • 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?"

  • Close - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.

  • Delegate - The next action is determined by Amazon Lex.

  • ElicitIntent - The next action is to determine the intent that the user wants to fulfill.

  • ElicitSlot - The next action is to elicit a slot value from the user.

recent_intent_summary_view

An array of information about the intents used in the session. The array can contain a maximum of three summaries. If more than three intents are used in the session, the recentIntentSummaryView operation contains information about the last three intents used.

If you set the checkpointLabelFilter parameter in the request, the array contains only the intents with the specified label.

STRUCT(
"intent_name" VARCHAR,
"checkpoint_label" VARCHAR,
"slots" MAP(VARCHAR, VARCHAR),
"confirmation_status" VARCHAR,
"dialog_action_type" VARCHAR,
"fulfillment_state" VARCHAR,
"slot_to_elicit" VARCHAR
)[]
Show child fields
recent_intent_summary_view[]
Show child fields
recent_intent_summary_view[].checkpoint_label

A user-defined label that identifies a particular intent. You can use this label to return to a previous intent.

Use the checkpointLabelFilter parameter of the GetSessionRequest operation to filter the intents returned by the operation to those with only the specified label.

recent_intent_summary_view[].confirmation_status

The status of the intent after the user responds to the confirmation prompt. If the user confirms the intent, Amazon Lex sets this field to Confirmed. If the user denies the intent, Amazon Lex sets this value to Denied. The possible values are:

  • Confirmed - The user has responded "Yes" to the confirmation prompt, confirming that the intent is complete and that it is ready to be fulfilled.

  • Denied - The user has responded "No" to the confirmation prompt.

  • None - The user has never been prompted for confirmation; or, the user was prompted but did not confirm or deny the prompt.

recent_intent_summary_view[].dialog_action_type

The next action that the bot should take in its interaction with the user. The possible values are:

  • 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?"

  • Close - Indicates that the there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.

  • ElicitIntent - The next action is to determine the intent that the user wants to fulfill.

  • ElicitSlot - The next action is to elicit a slot value from the user.

recent_intent_summary_view[].fulfillment_state

The fulfillment state of the intent. The possible values are:

  • Failed - The Lambda function associated with the intent failed to fulfill the intent.

  • Fulfilled - The intent has fulfilled by the Lambda function associated with the intent.

  • ReadyForFulfillment - All of the information necessary for the intent is present and the intent ready to be fulfilled by the client application.

recent_intent_summary_view[].intent_name

The name of the intent.

recent_intent_summary_view[].slot_to_elicit

The next slot to elicit from the user. If there is not slot to elicit, the field is blank.

recent_intent_summary_view[].slots

Map of the slots that have been gathered and their values.

session_attributes

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

MAP(VARCHAR, VARCHAR)
session_id

A unique identifier for the session.

VARCHAR