Skip to content

Lex Runtime V2  >  Operations  >  get_session

get_session

Operation

get_session async

get_session(input: GetSessionInput, plugins: list[Plugin] | None = None) -> GetSessionOutput

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.

Parameters:

Name Type Description Default
input GetSessionInput

An instance of GetSessionInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
GetSessionOutput

An instance of GetSessionOutput.

Input

GetSessionInput dataclass

Dataclass for GetSessionInput structure.

Attributes

bot_alias_id class-attribute instance-attribute
bot_alias_id: str | None = None

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

bot_id class-attribute instance-attribute
bot_id: str | None = None

The identifier of the bot that contains the session data.

locale_id class-attribute instance-attribute
locale_id: str | None = None

The locale where the session is in use.

session_id class-attribute instance-attribute
session_id: str | None = None

The identifier of the session to return.

Output

GetSessionOutput dataclass

Dataclass for GetSessionOutput structure.

Attributes

interpretations class-attribute instance-attribute
interpretations: list[Interpretation] | None = None

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.

messages class-attribute instance-attribute
messages: list[Message] | None = None

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.

session_id class-attribute instance-attribute
session_id: str | None = None

The identifier of the returned session.

session_state class-attribute instance-attribute
session_state: SessionState | None = None

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.