Skip to content

ReasoningContentBlockDelta module-attribute

Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.

Union Members

ReasoningContentBlockDeltaText dataclass

The reasoning that the model used to return the output.

Source code in src/aws_sdk_bedrock_runtime/models.py
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
@dataclass
class ReasoningContentBlockDeltaText:
    """The reasoning that the model used to return the output."""

    value: str

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

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

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

ReasoningContentBlockDeltaRedactedContent dataclass

The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses.

Source code in src/aws_sdk_bedrock_runtime/models.py
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
@dataclass
class ReasoningContentBlockDeltaRedactedContent:
    """The content in the reasoning that was encrypted by the model provider
    for safety reasons. The encryption doesn't affect the quality of
    responses.
    """

    value: bytes

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

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

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

ReasoningContentBlockDeltaSignature dataclass

A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.

Source code in src/aws_sdk_bedrock_runtime/models.py
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
@dataclass
class ReasoningContentBlockDeltaSignature:
    """A token that verifies that the reasoning text was generated by the
    model. If you pass a reasoning block back to the API in a multi-turn
    conversation, include the text and its signature unmodified.
    """

    value: str

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

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

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

ReasoningContentBlockDeltaUnknown 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
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
@dataclass
class ReasoningContentBlockDeltaUnknown:
    """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()