delete_session¶
Operation¶
delete_session
¶
delete_session(request: DeleteSessionInput | DeleteSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[DeleteSessionInputDict]) -> DeleteSessionOutput
Removes session information for a specified bot, alias, and user ID.
You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.
You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.
If you specify a bot or alias ID that doesn't exist, you receive a
BadRequestException.
If the locale doesn't exist in the bot, or if the locale hasn't been
enables for the alias, you receive a BadRequestException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
DeleteSessionInput | DeleteSessionInputDict | 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[DeleteSessionInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
DeleteSessionOutput
|
An instance of |
delete_session
async
¶
delete_session(request: DeleteSessionInput | DeleteSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[DeleteSessionInputDict]) -> DeleteSessionOutput
Removes session information for a specified bot, alias, and user ID.
You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.
You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.
If you specify a bot or alias ID that doesn't exist, you receive a
BadRequestException.
If the locale doesn't exist in the bot, or if the locale hasn't been
enables for the alias, you receive a BadRequestException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
DeleteSessionInput | DeleteSessionInputDict | 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[DeleteSessionInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
DeleteSessionOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
DeleteSessionInput
dataclass
¶
Bases: _SerdeShape
Dataclass for DeleteSessionInput 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.
Output¶
DeleteSessionOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for DeleteSessionOutput structure.
Attributes¶
bot_alias_id
class-attribute
instance-attribute
¶
bot_alias_id: str | None = ...
The alias identifier in use for the bot that contained the session data.
bot_id
class-attribute
instance-attribute
¶
bot_id: str | None = ...
The identifier of the bot that contained the session data.
locale_id
class-attribute
instance-attribute
¶
locale_id: str | None = ...
The locale where the session was used.
response_metadata
class-attribute
instance-attribute
¶
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.