Skip to content

GuardrailAutomatedReasoningValidFinding dataclass

Indicates that the claims are definitively true and logically implied by the premises, with no possible alternative interpretations.

Source code in src/aws_sdk_bedrock_runtime/models.py
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
@dataclass(kw_only=True)
class GuardrailAutomatedReasoningValidFinding:
    """Indicates that the claims are definitively true and logically implied by
    the premises, with no possible alternative interpretations.
    """

    translation: GuardrailAutomatedReasoningTranslation | None = None
    """The logical translation of the input that this finding validates."""

    claims_true_scenario: GuardrailAutomatedReasoningScenario | None = None
    """An example scenario demonstrating how the claims are logically true."""

    supporting_rules: list[GuardrailAutomatedReasoningRule] | None = None
    """The automated reasoning policy rules that support why this result is
    considered valid.
    """

    logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None
    """Indication of a logic issue with the translation without needing to
    consider the automated reasoning policy rules.
    """

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

    def serialize_members(self, serializer: ShapeSerializer):
        if self.translation is not None:
            serializer.write_struct(
                _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[
                    "translation"
                ],
                self.translation,
            )

        if self.claims_true_scenario is not None:
            serializer.write_struct(
                _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[
                    "claimsTrueScenario"
                ],
                self.claims_true_scenario,
            )

        if self.supporting_rules is not None:
            _serialize_guardrail_automated_reasoning_rule_list(
                serializer,
                _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[
                    "supportingRules"
                ],
                self.supporting_rules,
            )

        if self.logic_warning is not None:
            serializer.write_struct(
                _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[
                    "logicWarning"
                ],
                self.logic_warning,
            )

    @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["translation"] = (
                        GuardrailAutomatedReasoningTranslation.deserialize(de)
                    )

                case 1:
                    kwargs["claims_true_scenario"] = (
                        GuardrailAutomatedReasoningScenario.deserialize(de)
                    )

                case 2:
                    kwargs["supporting_rules"] = (
                        _deserialize_guardrail_automated_reasoning_rule_list(
                            de,
                            _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[
                                "supportingRules"
                            ],
                        )
                    )

                case 3:
                    kwargs["logic_warning"] = (
                        GuardrailAutomatedReasoningLogicWarning.deserialize(de)
                    )

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

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

Attributes

claims_true_scenario class-attribute instance-attribute

claims_true_scenario: GuardrailAutomatedReasoningScenario | None = None

An example scenario demonstrating how the claims are logically true.

logic_warning class-attribute instance-attribute

logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None

Indication of a logic issue with the translation without needing to consider the automated reasoning policy rules.

supporting_rules class-attribute instance-attribute

supporting_rules: list[GuardrailAutomatedReasoningRule] | None = None

The automated reasoning policy rules that support why this result is considered valid.

translation class-attribute instance-attribute

translation: GuardrailAutomatedReasoningTranslation | None = None

The logical translation of the input that this finding validates.