Skip to content

Typed dictionaries#

Index > LexRuntimeV2 > Typed dictionaries

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

ActiveContextTimeToLiveTypeDef#

# ActiveContextTimeToLiveTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ActiveContextTimeToLiveTypeDef

def get_value() -> ActiveContextTimeToLiveTypeDef:
    return {
        "timeToLiveInSeconds": ...,
        "turnsToLive": ...,
    }
# ActiveContextTimeToLiveTypeDef definition

class ActiveContextTimeToLiveTypeDef(TypedDict):
    timeToLiveInSeconds: int,
    turnsToLive: int,

ButtonTypeDef#

# ButtonTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ButtonTypeDef

def get_value() -> ButtonTypeDef:
    return {
        "text": ...,
        "value": ...,
    }
# ButtonTypeDef definition

class ButtonTypeDef(TypedDict):
    text: str,
    value: str,

ConfidenceScoreTypeDef#

# ConfidenceScoreTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ConfidenceScoreTypeDef

def get_value() -> ConfidenceScoreTypeDef:
    return {
        "score": ...,
    }
# ConfidenceScoreTypeDef definition

class ConfidenceScoreTypeDef(TypedDict):
    score: NotRequired[float],

DeleteSessionRequestRequestTypeDef#

# DeleteSessionRequestRequestTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import DeleteSessionRequestRequestTypeDef

def get_value() -> DeleteSessionRequestRequestTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
    }
# DeleteSessionRequestRequestTypeDef definition

class DeleteSessionRequestRequestTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,

DeleteSessionResponseTypeDef#

# DeleteSessionResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import DeleteSessionResponseTypeDef

def get_value() -> DeleteSessionResponseTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
        "ResponseMetadata": ...,
    }
# DeleteSessionResponseTypeDef definition

class DeleteSessionResponseTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

DialogActionTypeDef#

# DialogActionTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import DialogActionTypeDef

def get_value() -> DialogActionTypeDef:
    return {
        "type": ...,
    }
# DialogActionTypeDef definition

class DialogActionTypeDef(TypedDict):
    type: DialogActionTypeType,  # (1)
    slotToElicit: NotRequired[str],
    slotElicitationStyle: NotRequired[StyleTypeType],  # (2)
    subSlotToElicit: NotRequired[ElicitSubSlotTypeDef],  # (3)
  1. See DialogActionTypeType
  2. See StyleTypeType
  3. See ElicitSubSlotTypeDef

ElicitSubSlotTypeDef#

# ElicitSubSlotTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ElicitSubSlotTypeDef

def get_value() -> ElicitSubSlotTypeDef:
    return {
        "name": ...,
    }
# ElicitSubSlotTypeDef definition

class ElicitSubSlotTypeDef(TypedDict):
    name: str,
    subSlotToElicit: NotRequired[ElicitSubSlotTypeDef],  # (1)
  1. See ElicitSubSlotTypeDef

GetSessionRequestRequestTypeDef#

# GetSessionRequestRequestTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import GetSessionRequestRequestTypeDef

def get_value() -> GetSessionRequestRequestTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
    }
# GetSessionRequestRequestTypeDef definition

class GetSessionRequestRequestTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,

IntentTypeDef#

# IntentTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import IntentTypeDef

def get_value() -> IntentTypeDef:
    return {
        "name": ...,
    }
# IntentTypeDef definition

class IntentTypeDef(TypedDict):
    name: str,
    slots: NotRequired[Dict[str, SlotTypeDef]],  # (1)
    state: NotRequired[IntentStateType],  # (2)
    confirmationState: NotRequired[ConfirmationStateType],  # (3)
  1. See SlotTypeDef
  2. See IntentStateType
  3. See ConfirmationStateType

PutSessionResponseTypeDef#

# PutSessionResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import PutSessionResponseTypeDef

def get_value() -> PutSessionResponseTypeDef:
    return {
        "contentType": ...,
        "messages": ...,
        "sessionState": ...,
        "requestAttributes": ...,
        "sessionId": ...,
        "audioStream": ...,
        "ResponseMetadata": ...,
    }
# PutSessionResponseTypeDef definition

class PutSessionResponseTypeDef(TypedDict):
    contentType: str,
    messages: str,
    sessionState: str,
    requestAttributes: str,
    sessionId: str,
    audioStream: StreamingBody,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

RecognizedBotMemberTypeDef#

# RecognizedBotMemberTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RecognizedBotMemberTypeDef

def get_value() -> RecognizedBotMemberTypeDef:
    return {
        "botId": ...,
    }
# RecognizedBotMemberTypeDef definition

class RecognizedBotMemberTypeDef(TypedDict):
    botId: str,
    botName: NotRequired[str],

RecognizeUtteranceRequestRequestTypeDef#

# RecognizeUtteranceRequestRequestTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RecognizeUtteranceRequestRequestTypeDef

def get_value() -> RecognizeUtteranceRequestRequestTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
        "requestContentType": ...,
    }
# RecognizeUtteranceRequestRequestTypeDef definition

class RecognizeUtteranceRequestRequestTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    requestContentType: str,
    sessionState: NotRequired[str],
    requestAttributes: NotRequired[str],
    responseContentType: NotRequired[str],
    inputStream: NotRequired[Union[str, bytes, IO[Any], StreamingBody]],

RecognizeUtteranceResponseTypeDef#

# RecognizeUtteranceResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RecognizeUtteranceResponseTypeDef

def get_value() -> RecognizeUtteranceResponseTypeDef:
    return {
        "inputMode": ...,
        "contentType": ...,
        "messages": ...,
        "interpretations": ...,
        "sessionState": ...,
        "requestAttributes": ...,
        "sessionId": ...,
        "inputTranscript": ...,
        "audioStream": ...,
        "recognizedBotMember": ...,
        "ResponseMetadata": ...,
    }
# RecognizeUtteranceResponseTypeDef definition

class RecognizeUtteranceResponseTypeDef(TypedDict):
    inputMode: str,
    contentType: str,
    messages: str,
    interpretations: str,
    sessionState: str,
    requestAttributes: str,
    sessionId: str,
    inputTranscript: str,
    audioStream: StreamingBody,
    recognizedBotMember: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

ResponseMetadataTypeDef#

# ResponseMetadataTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ResponseMetadataTypeDef

def get_value() -> ResponseMetadataTypeDef:
    return {
        "RequestId": ...,
        "HostId": ...,
        "HTTPStatusCode": ...,
        "HTTPHeaders": ...,
        "RetryAttempts": ...,
    }
# ResponseMetadataTypeDef definition

class ResponseMetadataTypeDef(TypedDict):
    RequestId: str,
    HostId: str,
    HTTPStatusCode: int,
    HTTPHeaders: Dict[str, str],
    RetryAttempts: int,

RuntimeHintValueTypeDef#

# RuntimeHintValueTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RuntimeHintValueTypeDef

def get_value() -> RuntimeHintValueTypeDef:
    return {
        "phrase": ...,
    }
# RuntimeHintValueTypeDef definition

class RuntimeHintValueTypeDef(TypedDict):
    phrase: str,

RuntimeHintsTypeDef#

# RuntimeHintsTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RuntimeHintsTypeDef

def get_value() -> RuntimeHintsTypeDef:
    return {
        "slotHints": ...,
    }
# RuntimeHintsTypeDef definition

class RuntimeHintsTypeDef(TypedDict):
    slotHints: NotRequired[Dict[str, Dict[str, RuntimeHintDetailsTypeDef]]],  # (1)
  1. See RuntimeHintDetailsTypeDef

SentimentScoreTypeDef#

# SentimentScoreTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import SentimentScoreTypeDef

def get_value() -> SentimentScoreTypeDef:
    return {
        "positive": ...,
    }
# SentimentScoreTypeDef definition

class SentimentScoreTypeDef(TypedDict):
    positive: NotRequired[float],
    negative: NotRequired[float],
    neutral: NotRequired[float],
    mixed: NotRequired[float],

ValueTypeDef#

# ValueTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ValueTypeDef

def get_value() -> ValueTypeDef:
    return {
        "interpretedValue": ...,
    }
# ValueTypeDef definition

class ValueTypeDef(TypedDict):
    interpretedValue: str,
    originalValue: NotRequired[str],
    resolvedValues: NotRequired[List[str]],

ActiveContextTypeDef#

# ActiveContextTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ActiveContextTypeDef

def get_value() -> ActiveContextTypeDef:
    return {
        "name": ...,
        "timeToLive": ...,
        "contextAttributes": ...,
    }
# ActiveContextTypeDef definition

class ActiveContextTypeDef(TypedDict):
    name: str,
    timeToLive: ActiveContextTimeToLiveTypeDef,  # (1)
    contextAttributes: Dict[str, str],
  1. See ActiveContextTimeToLiveTypeDef

ImageResponseCardTypeDef#

# ImageResponseCardTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import ImageResponseCardTypeDef

def get_value() -> ImageResponseCardTypeDef:
    return {
        "title": ...,
    }
# ImageResponseCardTypeDef definition

class ImageResponseCardTypeDef(TypedDict):
    title: str,
    subtitle: NotRequired[str],
    imageUrl: NotRequired[str],
    buttons: NotRequired[List[ButtonTypeDef]],  # (1)
  1. See ButtonTypeDef

RuntimeHintDetailsTypeDef#

# RuntimeHintDetailsTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RuntimeHintDetailsTypeDef

def get_value() -> RuntimeHintDetailsTypeDef:
    return {
        "runtimeHintValues": ...,
    }
# RuntimeHintDetailsTypeDef definition

class RuntimeHintDetailsTypeDef(TypedDict):
    runtimeHintValues: NotRequired[List[RuntimeHintValueTypeDef]],  # (1)
    subSlotHints: NotRequired[Dict[str, RuntimeHintDetailsTypeDef]],  # (2)
  1. See RuntimeHintValueTypeDef
  2. See RuntimeHintDetailsTypeDef

SentimentResponseTypeDef#

# SentimentResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import SentimentResponseTypeDef

def get_value() -> SentimentResponseTypeDef:
    return {
        "sentiment": ...,
    }
# SentimentResponseTypeDef definition

class SentimentResponseTypeDef(TypedDict):
    sentiment: NotRequired[SentimentTypeType],  # (1)
    sentimentScore: NotRequired[SentimentScoreTypeDef],  # (2)
  1. See SentimentTypeType
  2. See SentimentScoreTypeDef

SlotTypeDef#

# SlotTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import SlotTypeDef

def get_value() -> SlotTypeDef:
    return {
        "value": ...,
    }
# SlotTypeDef definition

class SlotTypeDef(TypedDict):
    value: NotRequired[ValueTypeDef],  # (1)
    shape: NotRequired[ShapeType],  # (2)
    values: NotRequired[List[SlotTypeDef]],  # (3)
    subSlots: NotRequired[Dict[str, SlotTypeDef]],  # (4)
  1. See ValueTypeDef
  2. See ShapeType
  3. See SlotTypeDef
  4. See SlotTypeDef

SessionStateTypeDef#

# SessionStateTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import SessionStateTypeDef

def get_value() -> SessionStateTypeDef:
    return {
        "dialogAction": ...,
    }
# SessionStateTypeDef definition

class SessionStateTypeDef(TypedDict):
    dialogAction: NotRequired[DialogActionTypeDef],  # (1)
    intent: NotRequired[IntentTypeDef],  # (2)
    activeContexts: NotRequired[List[ActiveContextTypeDef]],  # (3)
    sessionAttributes: NotRequired[Dict[str, str]],
    originatingRequestId: NotRequired[str],
    runtimeHints: NotRequired[RuntimeHintsTypeDef],  # (4)
  1. See DialogActionTypeDef
  2. See IntentTypeDef
  3. See ActiveContextTypeDef
  4. See RuntimeHintsTypeDef

MessageTypeDef#

# MessageTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import MessageTypeDef

def get_value() -> MessageTypeDef:
    return {
        "contentType": ...,
    }
# MessageTypeDef definition

class MessageTypeDef(TypedDict):
    contentType: MessageContentTypeType,  # (1)
    content: NotRequired[str],
    imageResponseCard: NotRequired[ImageResponseCardTypeDef],  # (2)
  1. See MessageContentTypeType
  2. See ImageResponseCardTypeDef

InterpretationTypeDef#

# InterpretationTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import InterpretationTypeDef

def get_value() -> InterpretationTypeDef:
    return {
        "nluConfidence": ...,
    }
# InterpretationTypeDef definition

class InterpretationTypeDef(TypedDict):
    nluConfidence: NotRequired[ConfidenceScoreTypeDef],  # (1)
    sentimentResponse: NotRequired[SentimentResponseTypeDef],  # (2)
    intent: NotRequired[IntentTypeDef],  # (3)
  1. See ConfidenceScoreTypeDef
  2. See SentimentResponseTypeDef
  3. See IntentTypeDef

RecognizeTextRequestRequestTypeDef#

# RecognizeTextRequestRequestTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RecognizeTextRequestRequestTypeDef

def get_value() -> RecognizeTextRequestRequestTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
        "text": ...,
    }
# RecognizeTextRequestRequestTypeDef definition

class RecognizeTextRequestRequestTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    text: str,
    sessionState: NotRequired[SessionStateTypeDef],  # (1)
    requestAttributes: NotRequired[Mapping[str, str]],
  1. See SessionStateTypeDef

PutSessionRequestRequestTypeDef#

# PutSessionRequestRequestTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import PutSessionRequestRequestTypeDef

def get_value() -> PutSessionRequestRequestTypeDef:
    return {
        "botId": ...,
        "botAliasId": ...,
        "localeId": ...,
        "sessionId": ...,
        "sessionState": ...,
    }
# PutSessionRequestRequestTypeDef definition

class PutSessionRequestRequestTypeDef(TypedDict):
    botId: str,
    botAliasId: str,
    localeId: str,
    sessionId: str,
    sessionState: SessionStateTypeDef,  # (1)
    messages: NotRequired[Sequence[MessageTypeDef]],  # (2)
    requestAttributes: NotRequired[Mapping[str, str]],
    responseContentType: NotRequired[str],
  1. See SessionStateTypeDef
  2. See MessageTypeDef

GetSessionResponseTypeDef#

# GetSessionResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import GetSessionResponseTypeDef

def get_value() -> GetSessionResponseTypeDef:
    return {
        "sessionId": ...,
        "messages": ...,
        "interpretations": ...,
        "sessionState": ...,
        "ResponseMetadata": ...,
    }
# GetSessionResponseTypeDef definition

class GetSessionResponseTypeDef(TypedDict):
    sessionId: str,
    messages: List[MessageTypeDef],  # (1)
    interpretations: List[InterpretationTypeDef],  # (2)
    sessionState: SessionStateTypeDef,  # (3)
    ResponseMetadata: ResponseMetadataTypeDef,  # (4)
  1. See MessageTypeDef
  2. See InterpretationTypeDef
  3. See SessionStateTypeDef
  4. See ResponseMetadataTypeDef

RecognizeTextResponseTypeDef#

# RecognizeTextResponseTypeDef usage example

from mypy_boto3_lexv2_runtime.type_defs import RecognizeTextResponseTypeDef

def get_value() -> RecognizeTextResponseTypeDef:
    return {
        "messages": ...,
        "sessionState": ...,
        "interpretations": ...,
        "requestAttributes": ...,
        "sessionId": ...,
        "recognizedBotMember": ...,
        "ResponseMetadata": ...,
    }
# RecognizeTextResponseTypeDef definition

class RecognizeTextResponseTypeDef(TypedDict):
    messages: List[MessageTypeDef],  # (1)
    sessionState: SessionStateTypeDef,  # (2)
    interpretations: List[InterpretationTypeDef],  # (3)
    requestAttributes: Dict[str, str],
    sessionId: str,
    recognizedBotMember: RecognizedBotMemberTypeDef,  # (4)
    ResponseMetadata: ResponseMetadataTypeDef,  # (5)
  1. See MessageTypeDef
  2. See SessionStateTypeDef
  3. See InterpretationTypeDef
  4. See RecognizedBotMemberTypeDef
  5. See ResponseMetadataTypeDef