Skip to content

Type definitions#

Index > LexRuntimeV2 > Type definitions

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

BlobTypeDef#

# BlobTypeDef definition

BlobTypeDef = Union[
    str,
    bytes,
    IO[Any],
    StreamingBody,
]

ActiveContextTimeToLiveTypeDef#

# ActiveContextTimeToLiveTypeDef definition

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

ButtonTypeDef#

# ButtonTypeDef definition

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

ConfidenceScoreTypeDef#

# ConfidenceScoreTypeDef definition

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

DeleteSessionRequestRequestTypeDef#

# DeleteSessionRequestRequestTypeDef definition

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

ResponseMetadataTypeDef#

# ResponseMetadataTypeDef definition

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

DialogActionTypeDef#

# 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 definition

class ElicitSubSlotTypeDef(TypedDict):
    name: str,
    subSlotToElicit: NotRequired[Dict[str, Any]],

GetSessionRequestRequestTypeDef#

# GetSessionRequestRequestTypeDef definition

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

IntentTypeDef#

# 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

RecognizedBotMemberTypeDef#

# RecognizedBotMemberTypeDef definition

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

RuntimeHintValueTypeDef#

# RuntimeHintValueTypeDef definition

class RuntimeHintValueTypeDef(TypedDict):
    phrase: str,

RuntimeHintsTypeDef#

# RuntimeHintsTypeDef definition

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

SentimentScoreTypeDef#

# SentimentScoreTypeDef definition

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

ValueTypeDef#

# ValueTypeDef definition

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

ActiveContextTypeDef#

# ActiveContextTypeDef definition

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

RecognizeUtteranceRequestRequestTypeDef#

# 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]],

ImageResponseCardTypeDef#

# ImageResponseCardTypeDef definition

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

DeleteSessionResponseTypeDef#

# DeleteSessionResponseTypeDef definition

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

PutSessionResponseTypeDef#

# PutSessionResponseTypeDef definition

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

RecognizeUtteranceResponseTypeDef#

# 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

RuntimeHintDetailsTypeDef#

# RuntimeHintDetailsTypeDef definition

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

SentimentResponseTypeDef#

# SentimentResponseTypeDef definition

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

SlotTypeDef#

# SlotTypeDef definition

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

SessionStateTypeDef#

# 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 definition

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

InterpretationTypeDef#

# InterpretationTypeDef definition

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

RecognizeTextRequestRequestTypeDef#

# 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 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 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 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