Skip to content

ReasoningContentBlock 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

ReasoningContentBlockReasoningText dataclass

The reasoning that the model used to return the output.

Source code in src/aws_sdk_bedrock_runtime/models.py
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
@dataclass
class ReasoningContentBlockReasoningText:
    """The reasoning that the model used to return the output."""

    value: ReasoningTextBlock

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

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

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

ReasoningContentBlockRedactedContent 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
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
@dataclass
class ReasoningContentBlockRedactedContent:
    """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, self)

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

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

ReasoningContentBlockUnknown 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
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
@dataclass
class ReasoningContentBlockUnknown:
    """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()