Skip to content

ImageSource module-attribute

The source for an image.

Union Members

ImageSourceBytes dataclass

The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.

Source code in src/aws_sdk_bedrock_runtime/models.py
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
@dataclass
class ImageSourceBytes:
    """The raw image bytes for the image. If you use an AWS SDK, you don't
    need to encode the image bytes in base64.
    """

    value: bytes

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"], self.value)

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(value=deserializer.read_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"]))

ImageSourceS3Location dataclass

The location of an image object in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse.

Source code in src/aws_sdk_bedrock_runtime/models.py
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
@dataclass
class ImageSourceS3Location:
    """The location of an image object in an Amazon S3 bucket. To see which
    models support S3 uploads, see [Supported models and features for
    Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html).
    """

    value: S3Location

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_IMAGE_SOURCE.members["s3Location"], self.value)

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(value=S3Location.deserialize(deserializer))

ImageSourceUnknown dataclass

Represents an unknown variant.

If you receive this value, you will need to update your library to receive the parsed value.

This value may not be deliberately sent.

Source code in src/aws_sdk_bedrock_runtime/models.py
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
@dataclass
class ImageSourceUnknown:
    """Represents an unknown variant.

    If you receive this value, you will need to update your library to receive the
    parsed value.

    This value may not be deliberately sent.
    """

    tag: str

    def serialize(self, serializer: ShapeSerializer):
        raise SerializationError("Unknown union variants may not be serialized.")

    def serialize_members(self, serializer: ShapeSerializer):
        raise SerializationError("Unknown union variants may not be serialized.")

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        raise NotImplementedError()