Skip to content

GuardrailAutomatedReasoningPolicyAssessment dataclass

Contains the results of automated reasoning policy evaluation, including logical findings about the validity of claims made in the input content.

Source code in src/aws_sdk_bedrock_runtime/models.py
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
@dataclass(kw_only=True)
class GuardrailAutomatedReasoningPolicyAssessment:
    """Contains the results of automated reasoning policy evaluation, including
    logical findings about the validity of claims made in the input content.
    """

    findings: list[GuardrailAutomatedReasoningFinding] | None = None
    """List of logical validation results produced by evaluating the input
    content against automated reasoning policies.
    """

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

    def serialize_members(self, serializer: ShapeSerializer):
        if self.findings is not None:
            _serialize_guardrail_automated_reasoning_finding_list(
                serializer,
                _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT.members[
                    "findings"
                ],
                self.findings,
            )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(**cls.deserialize_kwargs(deserializer))

    @classmethod
    def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]:
        kwargs: dict[str, Any] = {}

        def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
            match schema.expect_member_index():
                case 0:
                    kwargs["findings"] = (
                        _deserialize_guardrail_automated_reasoning_finding_list(
                            de,
                            _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT.members[
                                "findings"
                            ],
                        )
                    )

                case _:
                    logger.debug("Unexpected member schema: %s", schema)

        deserializer.read_struct(
            _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT, consumer=_consumer
        )
        return kwargs

Attributes

findings class-attribute instance-attribute

findings: list[GuardrailAutomatedReasoningFinding] | None = None

List of logical validation results produced by evaluating the input content against automated reasoning policies.