CfnAutomatedReasoningPolicyPropsMixin
- class aws_cdk.mixins_preview.aws_bedrock.mixins.CfnAutomatedReasoningPolicyPropsMixin(props, *, strategy=None)
Bases:
MixinCreates an Automated Reasoning policy for Amazon Bedrock Guardrails.
Automated Reasoning policies use mathematical techniques to detect hallucinations, suggest corrections, and highlight unstated assumptions in the responses of your GenAI application.
To create a policy, you upload a source document that describes the rules that you’re encoding. Automated Reasoning extracts important concepts from the source document that will become variables in the policy and infers policy rules.
To learn more about creating Automated Reasoning policies, see Minimize AI hallucinations and deliver up to 99% verification accuracy with Automated Reasoning checks: Now available in the AWS News Blog .
- See:
- CloudformationResource:
AWS::Bedrock::AutomatedReasoningPolicy
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins cfn_automated_reasoning_policy_props_mixin = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin(bedrock_mixins.CfnAutomatedReasoningPolicyMixinProps( description="description", force_delete=False, kms_key_id="kmsKeyId", name="name", policy_definition=bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionProperty( rules=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionRuleProperty( alternate_expression="alternateExpression", expression="expression", id="id" )], types=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeProperty( description="description", name="name", values=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeValueProperty( description="description", value="value" )] )], variables=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionVariableProperty( description="description", name="name", type="type" )], version="version" ), tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Bedrock::AutomatedReasoningPolicy.- Parameters:
props (
Union[CfnAutomatedReasoningPolicyMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['description', 'forceDelete', 'kmsKeyId', 'name', 'policyDefinition', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
PolicyDefinitionProperty
- class CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionProperty(*, rules=None, types=None, variables=None, version=None)
Bases:
objectThe complete policy definition containing rules, variables, and types.
- Parameters:
rules (
Union[IResolvable,Sequence[Union[IResolvable,PolicyDefinitionRuleProperty,Dict[str,Any]]],None]) – The collection of rules that define the policy logic.types (
Union[IResolvable,Sequence[Union[IResolvable,PolicyDefinitionTypeProperty,Dict[str,Any]]],None]) – The custom types defined within the policy definition.variables (
Union[IResolvable,Sequence[Union[IResolvable,PolicyDefinitionVariableProperty,Dict[str,Any]]],None]) – The variables used within the policy definition.version (
Optional[str]) – The version of the policy definition.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins policy_definition_property = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionProperty( rules=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionRuleProperty( alternate_expression="alternateExpression", expression="expression", id="id" )], types=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeProperty( description="description", name="name", values=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeValueProperty( description="description", value="value" )] )], variables=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionVariableProperty( description="description", name="name", type="type" )], version="version" )
Attributes
- rules
The collection of rules that define the policy logic.
- types
The custom types defined within the policy definition.
- variables
The variables used within the policy definition.
- version
The version of the policy definition.
PolicyDefinitionRuleProperty
- class CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionRuleProperty(*, alternate_expression=None, expression=None, id=None)
Bases:
objectA rule within the policy definition that defines logical constraints.
- Parameters:
alternate_expression (
Optional[str]) – An alternative expression for the policy rule.expression (
Optional[str]) – The logical expression that defines the rule.id (
Optional[str]) – The unique identifier for the policy definition rule.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins policy_definition_rule_property = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionRuleProperty( alternate_expression="alternateExpression", expression="expression", id="id" )
Attributes
- alternate_expression
An alternative expression for the policy rule.
- expression
The logical expression that defines the rule.
- id
The unique identifier for the policy definition rule.
PolicyDefinitionTypeProperty
- class CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeProperty(*, description=None, name=None, values=None)
Bases:
objectA custom type definition within the policy.
- Parameters:
description (
Optional[str]) – A description of the custom type defined in the policy.name (
Optional[str]) – The name of a custom type defined in the policy.values (
Union[IResolvable,Sequence[Union[IResolvable,PolicyDefinitionTypeValueProperty,Dict[str,Any]]],None]) – The possible values for a custom type defined in the policy.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins policy_definition_type_property = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeProperty( description="description", name="name", values=[bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeValueProperty( description="description", value="value" )] )
Attributes
- description
A description of the custom type defined in the policy.
- name
The name of a custom type defined in the policy.
- values
The possible values for a custom type defined in the policy.
PolicyDefinitionTypeValueProperty
- class CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeValueProperty(*, description=None, value=None)
Bases:
objectA value associated with a custom type in the policy definition.
- Parameters:
description (
Optional[str]) – A description of the policy definition type value.value (
Optional[str]) – The value associated with a policy definition type.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins policy_definition_type_value_property = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionTypeValueProperty( description="description", value="value" )
Attributes
- description
A description of the policy definition type value.
- value
The value associated with a policy definition type.
PolicyDefinitionVariableProperty
- class CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionVariableProperty(*, description=None, name=None, type=None)
Bases:
objectA variable defined within the policy that can be used in rules.
- Parameters:
description (
Optional[str]) – A description of a variable defined in the policy.name (
Optional[str]) – The name of a variable defined in the policy.type (
Optional[str]) – The data type of a variable defined in the policy.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins policy_definition_variable_property = bedrock_mixins.CfnAutomatedReasoningPolicyPropsMixin.PolicyDefinitionVariableProperty( description="description", name="name", type="type" )
Attributes
- description
A description of a variable defined in the policy.
- name
The name of a variable defined in the policy.
- type
The data type of a variable defined in the policy.