Skip to content

get_session

Operation

get_session

get_session(request: GetSessionInput | GetSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetSessionInputDict]) -> 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
request GetSessionInput | GetSessionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[GetSessionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetSessionOutput

An instance of GetSessionOutput.

get_session async

get_session(request: GetSessionInput | GetSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetSessionInputDict]) -> 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
request GetSessionInput | GetSessionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[GetSessionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetSessionOutput

An instance of GetSessionOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

GetSessionInputDict

Bases: TypedDict

Dictionary form of GetSessionInput.

Attributes

bot_alias_id instance-attribute
bot_alias_id: Required[str]

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

bot_id instance-attribute
bot_id: Required[str]

The identifier of the bot that contains the session data.

locale_id instance-attribute
locale_id: Required[str]

The locale where the session is in use.

session_id instance-attribute
session_id: Required[str]

The identifier of the session to return.

GetSessionInput dataclass

Bases: _SerdeShape

Dataclass for GetSessionInput structure.

Attributes

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

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

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

The identifier of the bot that contains the session data.

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

The locale where the session is in use.

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

The identifier of the session to return.

Output

GetSessionOutput dataclass

Bases: _SerdeShape

Dataclass for GetSessionOutput structure.

Attributes

interpretations class-attribute instance-attribute
interpretations: list[Interpretation] | 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 = ...

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.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

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

The identifier of the returned session.

session_state class-attribute instance-attribute
session_state: SessionState | 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.