Skip to content

LexRuntimeV2Client#

Index > LexRuntimeV2 > LexRuntimeV2Client

Auto-generated documentation for LexRuntimeV2 type annotations stubs module types-boto3-lexv2-runtime.

LexRuntimeV2Client#

Type annotations and code completion for boto3.client("lexv2-runtime"). boto3 documentation

# LexRuntimeV2Client usage example

from boto3.session import Session
from types_boto3_lexv2_runtime.client import LexRuntimeV2Client

def get_lexv2-runtime_client() -> LexRuntimeV2Client:
    return Session().client("lexv2-runtime")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("lexv2-runtime").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("lexv2-runtime")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.BadGatewayException,
    client.exceptions.ClientError,
    client.exceptions.ConflictException,
    client.exceptions.DependencyFailedException,
    client.exceptions.InternalServerException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ThrottlingException,
    client.exceptions.ValidationException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from types_boto3_lexv2_runtime.client import Exceptions

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

Methods#

can_paginate#

Type annotations and code completion for boto3.client("lexv2-runtime").can_paginate method. boto3 documentation

# can_paginate method definition

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

generate_presigned_url#

Type annotations and code completion for boto3.client("lexv2-runtime").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

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

delete_session#

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

Type annotations and code completion for boto3.client("lexv2-runtime").delete_session method. boto3 documentation

# delete_session method definition

def delete_session(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
) -> DeleteSessionResponseTypeDef:  # (1)
    ...
  1. See DeleteSessionResponseTypeDef
# delete_session method usage example with argument unpacking

kwargs: DeleteSessionRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
}

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

get_session#

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

Type annotations and code completion for boto3.client("lexv2-runtime").get_session method. boto3 documentation

# get_session method definition

def get_session(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
) -> GetSessionResponseTypeDef:  # (1)
    ...
  1. See GetSessionResponseTypeDef
# get_session method usage example with argument unpacking

kwargs: GetSessionRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
}

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

put_session#

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

Type annotations and code completion for boto3.client("lexv2-runtime").put_session method. boto3 documentation

# put_session method definition

def put_session(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    sessionState: SessionStateTypeDef,  # (1)
    messages: Sequence[MessageUnionTypeDef] = ...,  # (2)
    requestAttributes: Mapping[str, str] = ...,
    responseContentType: str = ...,
) -> PutSessionResponseTypeDef:  # (3)
    ...
  1. See SessionStateTypeDef
  2. See MessageTypeDef MessageOutputTypeDef
  3. See PutSessionResponseTypeDef
# put_session method usage example with argument unpacking

kwargs: PutSessionRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
    "sessionState": ...,
}

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

recognize_text#

Sends user input to Amazon Lex V2.

Type annotations and code completion for boto3.client("lexv2-runtime").recognize_text method. boto3 documentation

# recognize_text method definition

def recognize_text(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    text: str,
    sessionState: SessionStateTypeDef = ...,  # (1)
    requestAttributes: Mapping[str, str] = ...,
) -> RecognizeTextResponseTypeDef:  # (2)
    ...
  1. See SessionStateTypeDef
  2. See RecognizeTextResponseTypeDef
# recognize_text method usage example with argument unpacking

kwargs: RecognizeTextRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
    "text": ...,
}

parent.recognize_text(**kwargs)
  1. See RecognizeTextRequestRequestTypeDef

recognize_utterance#

Sends user input to Amazon Lex V2.

Type annotations and code completion for boto3.client("lexv2-runtime").recognize_utterance method. boto3 documentation

# recognize_utterance method definition

def recognize_utterance(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    requestContentType: str,
    sessionState: str = ...,
    requestAttributes: str = ...,
    responseContentType: str = ...,
    inputStream: BlobTypeDef = ...,
) -> RecognizeUtteranceResponseTypeDef:  # (1)
    ...
  1. See RecognizeUtteranceResponseTypeDef
# recognize_utterance method usage example with argument unpacking

kwargs: RecognizeUtteranceRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
    "requestContentType": ...,
}

parent.recognize_utterance(**kwargs)
  1. See RecognizeUtteranceRequestRequestTypeDef

start_conversation#

Starts an HTTP/2 bidirectional event stream that enables you to send audio, text, or DTMF input in real time.

Type annotations and code completion for boto3.client("lexv2-runtime").start_conversation method. boto3 documentation

# start_conversation method definition

def start_conversation(
    self,
    *,
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    requestEventStream: EventStream[StartConversationRequestEventStreamTypeDef],  # (1)
    conversationMode: ConversationModeType = ...,  # (2)
) -> StartConversationResponseTypeDef:  # (3)
    ...
  1. See StartConversationRequestEventStreamTypeDef
  2. See ConversationModeType
  3. See StartConversationResponseTypeDef
# start_conversation method usage example with argument unpacking

kwargs: StartConversationRequestRequestTypeDef = {  # (1)
    "botId": ...,
    "botAliasId": ...,
    "localeId": ...,
    "sessionId": ...,
    "requestEventStream": ...,
}

parent.start_conversation(**kwargs)
  1. See StartConversationRequestRequestTypeDef