Skip to content

LexRuntimeServiceClient#

Index > LexRuntimeService > LexRuntimeServiceClient

Auto-generated documentation for LexRuntimeService type annotations stubs module types-aiobotocore-lex-runtime.

LexRuntimeServiceClient#

Type annotations and code completion for session.create_client("lex-runtime") boto3 documentation

LexRuntimeServiceClient usage example

from aiobotocore.session import get_session
from types_aiobotocore_lex_runtime.client import LexRuntimeServiceClient

session = get_session()
async with session.create_client("lex-runtime") as client:
    client: LexRuntimeServiceClient

Exceptions#

aiobotocore client exceptions are generated in runtime. This class provides code completion for session.create_client("lex-runtime").exceptions structure.

LexRuntimeServiceClient.exceptions usage example

async with session.create_client("lex-runtime") as client:
    try:
        do_something(client)
    except (
            client.BadGatewayException,
        client.BadRequestException,
        client.ClientError,
        client.ConflictException,
        client.DependencyFailedException,
        client.InternalFailureException,
        client.LimitExceededException,
        client.LoopDetectedException,
        client.NotAcceptableException,
        client.NotFoundException,
        client.RequestTimeoutException,
        client.UnsupportedMediaTypeException,
    ) as e:
        print(e)
LexRuntimeServiceClient usage type checking example

from types_aiobotocore_lex_runtime.client import Exceptions

def handle_error(exc: Exceptions.BadGatewayException) -> None:
    ...

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for session.create_client("lex-runtime").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for session.create_client("lex-runtime").close method. boto3 documentation

# close method definition

await def close(
    self,
) -> None:
    ...

delete_session#

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

Type annotations and code completion for session.create_client("lex-runtime").delete_session method. boto3 documentation

# delete_session method definition

await def delete_session(
    self,
    *,
    botName: str,
    botAlias: str,
    userId: str,
) -> DeleteSessionResponseTypeDef:  # (1)
    ...
  1. See DeleteSessionResponseTypeDef
# delete_session method usage example with argument unpacking

kwargs: DeleteSessionRequestRequestTypeDef = {  # (1)
    "botName": ...,
    "botAlias": ...,
    "userId": ...,
}

parent.delete_session(**kwargs)
  1. See DeleteSessionRequestRequestTypeDef

generate_presigned_url#

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for session.create_client("lex-runtime").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_session#

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

Type annotations and code completion for session.create_client("lex-runtime").get_session method. boto3 documentation

# get_session method definition

await def get_session(
    self,
    *,
    botName: str,
    botAlias: str,
    userId: str,
    checkpointLabelFilter: str = ...,
) -> GetSessionResponseTypeDef:  # (1)
    ...
  1. See GetSessionResponseTypeDef
# get_session method usage example with argument unpacking

kwargs: GetSessionRequestRequestTypeDef = {  # (1)
    "botName": ...,
    "botAlias": ...,
    "userId": ...,
}

parent.get_session(**kwargs)
  1. See GetSessionRequestRequestTypeDef

post_content#

Sends user input (text or speech) to Amazon Lex.

Type annotations and code completion for session.create_client("lex-runtime").post_content method. boto3 documentation

# post_content method definition

await def post_content(
    self,
    *,
    botName: str,
    botAlias: str,
    userId: str,
    contentType: str,
    inputStream: Union[str, bytes, IO[Any], StreamingBody],
    sessionAttributes: str = ...,
    requestAttributes: str = ...,
    accept: str = ...,
    activeContexts: str = ...,
) -> PostContentResponseTypeDef:  # (1)
    ...
  1. See PostContentResponseTypeDef
# post_content method usage example with argument unpacking

kwargs: PostContentRequestRequestTypeDef = {  # (1)
    "botName": ...,
    "botAlias": ...,
    "userId": ...,
    "contentType": ...,
    "inputStream": ...,
}

parent.post_content(**kwargs)
  1. See PostContentRequestRequestTypeDef

post_text#

Sends user input to Amazon Lex.

Type annotations and code completion for session.create_client("lex-runtime").post_text method. boto3 documentation

# post_text method definition

await def post_text(
    self,
    *,
    botName: str,
    botAlias: str,
    userId: str,
    inputText: str,
    sessionAttributes: Mapping[str, str] = ...,
    requestAttributes: Mapping[str, str] = ...,
    activeContexts: Sequence[ActiveContextTypeDef] = ...,  # (1)
) -> PostTextResponseTypeDef:  # (2)
    ...
  1. See ActiveContextTypeDef
  2. See PostTextResponseTypeDef
# post_text method usage example with argument unpacking

kwargs: PostTextRequestRequestTypeDef = {  # (1)
    "botName": ...,
    "botAlias": ...,
    "userId": ...,
    "inputText": ...,
}

parent.post_text(**kwargs)
  1. See PostTextRequestRequestTypeDef

put_session#

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

Type annotations and code completion for session.create_client("lex-runtime").put_session method. boto3 documentation

# put_session method definition

await def put_session(
    self,
    *,
    botName: str,
    botAlias: str,
    userId: str,
    sessionAttributes: Mapping[str, str] = ...,
    dialogAction: DialogActionTypeDef = ...,  # (1)
    recentIntentSummaryView: Sequence[IntentSummaryTypeDef] = ...,  # (2)
    accept: str = ...,
    activeContexts: Sequence[ActiveContextTypeDef] = ...,  # (3)
) -> PutSessionResponseTypeDef:  # (4)
    ...
  1. See DialogActionTypeDef
  2. See IntentSummaryTypeDef
  3. See ActiveContextTypeDef
  4. See PutSessionResponseTypeDef
# put_session method usage example with argument unpacking

kwargs: PutSessionRequestRequestTypeDef = {  # (1)
    "botName": ...,
    "botAlias": ...,
    "userId": ...,
}

parent.put_session(**kwargs)
  1. See PutSessionRequestRequestTypeDef

__aenter__#

Type annotations and code completion for session.create_client("lex-runtime").__aenter__ method. boto3 documentation

# __aenter__ method definition

await def __aenter__(
    self,
) -> LexRuntimeServiceClient:
    ...

__aexit__#

Type annotations and code completion for session.create_client("lex-runtime").__aexit__ method. boto3 documentation

# __aexit__ method definition

await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...