Skip to content

SystemContentBlock module-attribute

Contains configurations for instructions to provide the model for how to handle input. To learn more, see Using the Converse API.

Union Members

SystemContentBlockText dataclass

A system prompt for the model.

Source code in src/aws_sdk_bedrock_runtime/models.py
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
@dataclass
class SystemContentBlockText:
    """A system prompt for the model."""

    value: str

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

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_string(
            _SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"], self.value
        )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(
            value=deserializer.read_string(_SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"])
        )

SystemContentBlockGuardContent dataclass

A content block to assess with the guardrail. Use with the Converse or ConverseStream API operations.

For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.

Source code in src/aws_sdk_bedrock_runtime/models.py
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
@dataclass
class SystemContentBlockGuardContent:
    """A content block to assess with the guardrail. Use with the
    [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html)
    or
    [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html)
    API operations.

    For more information, see *Use a guardrail with the Converse API* in the
    *Amazon Bedrock User Guide*.
    """

    value: GuardrailConverseContentBlock

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

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

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

SystemContentBlockCachePoint dataclass

CachePoint to include in the system prompt.

Source code in src/aws_sdk_bedrock_runtime/models.py
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
@dataclass
class SystemContentBlockCachePoint:
    """CachePoint to include in the system prompt."""

    value: CachePointBlock

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

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

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

SystemContentBlockUnknown 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
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
@dataclass
class SystemContentBlockUnknown:
    """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()