Skip to content

Type definitions#

Index > BedrockRuntime > Type definitions

Auto-generated documentation for BedrockRuntime type annotations stubs module mypy-boto3-bedrock-runtime.

BlobTypeDef#

# BlobTypeDef definition

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

InternalServerExceptionTypeDef#

# InternalServerExceptionTypeDef definition

class InternalServerExceptionTypeDef(TypedDict):
    message: NotRequired[str],

ResponseMetadataTypeDef#

# ResponseMetadataTypeDef definition

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

ModelStreamErrorExceptionTypeDef#

# ModelStreamErrorExceptionTypeDef definition

class ModelStreamErrorExceptionTypeDef(TypedDict):
    message: NotRequired[str],
    originalStatusCode: NotRequired[int],
    originalMessage: NotRequired[str],

ModelTimeoutExceptionTypeDef#

# ModelTimeoutExceptionTypeDef definition

class ModelTimeoutExceptionTypeDef(TypedDict):
    message: NotRequired[str],

PayloadPartTypeDef#

# PayloadPartTypeDef definition

class PayloadPartTypeDef(TypedDict):
    bytes: NotRequired[bytes],

ThrottlingExceptionTypeDef#

# ThrottlingExceptionTypeDef definition

class ThrottlingExceptionTypeDef(TypedDict):
    message: NotRequired[str],

ValidationExceptionTypeDef#

# ValidationExceptionTypeDef definition

class ValidationExceptionTypeDef(TypedDict):
    message: NotRequired[str],

InvokeModelRequestRequestTypeDef#

# InvokeModelRequestRequestTypeDef definition

class InvokeModelRequestRequestTypeDef(TypedDict):
    body: Union[str, bytes, IO[Any], StreamingBody],
    modelId: str,
    contentType: NotRequired[str],
    accept: NotRequired[str],

InvokeModelWithResponseStreamRequestRequestTypeDef#

# InvokeModelWithResponseStreamRequestRequestTypeDef definition

class InvokeModelWithResponseStreamRequestRequestTypeDef(TypedDict):
    body: Union[str, bytes, IO[Any], StreamingBody],
    modelId: str,
    contentType: NotRequired[str],
    accept: NotRequired[str],

InvokeModelResponseTypeDef#

# InvokeModelResponseTypeDef definition

class InvokeModelResponseTypeDef(TypedDict):
    body: StreamingBody,
    contentType: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

ResponseStreamTypeDef#

# ResponseStreamTypeDef definition

class ResponseStreamTypeDef(TypedDict):
    chunk: NotRequired[PayloadPartTypeDef],  # (1)
    internalServerException: NotRequired[InternalServerExceptionTypeDef],  # (2)
    modelStreamErrorException: NotRequired[ModelStreamErrorExceptionTypeDef],  # (3)
    validationException: NotRequired[ValidationExceptionTypeDef],  # (4)
    throttlingException: NotRequired[ThrottlingExceptionTypeDef],  # (5)
    modelTimeoutException: NotRequired[ModelTimeoutExceptionTypeDef],  # (6)
  1. See PayloadPartTypeDef
  2. See InternalServerExceptionTypeDef
  3. See ModelStreamErrorExceptionTypeDef
  4. See ValidationExceptionTypeDef
  5. See ThrottlingExceptionTypeDef
  6. See ModelTimeoutExceptionTypeDef

InvokeModelWithResponseStreamResponseTypeDef#

# InvokeModelWithResponseStreamResponseTypeDef definition

class InvokeModelWithResponseStreamResponseTypeDef(TypedDict):
    body: EventStream[ResponseStreamTypeDef],  # (1)
    contentType: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (2)
  1. See ResponseStreamTypeDef
  2. See ResponseMetadataTypeDef