Bedrock / Client / get_automated_reasoning_policy_annotations

get_automated_reasoning_policy_annotations

Bedrock.Client.get_automated_reasoning_policy_annotations(**kwargs)

Retrieves the current annotations for an Automated Reasoning policy build workflow. Annotations contain corrections to the rules, variables and types to be applied to the policy.

See also: AWS API Documentation

Request Syntax

response = client.get_automated_reasoning_policy_annotations(
    policyArn='string',
    buildWorkflowId='string'
)
Parameters:
  • policyArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the Automated Reasoning policy whose annotations you want to retrieve.

  • buildWorkflowId (string) –

    [REQUIRED]

    The unique identifier of the build workflow whose annotations you want to retrieve.

Return type:

dict

Returns:

Response Syntax

{
    'policyArn': 'string',
    'name': 'string',
    'buildWorkflowId': 'string',
    'annotations': [
        {
            'addType': {
                'name': 'string',
                'description': 'string',
                'values': [
                    {
                        'value': 'string',
                        'description': 'string'
                    },
                ]
            },
            'updateType': {
                'name': 'string',
                'newName': 'string',
                'description': 'string',
                'values': [
                    {
                        'addTypeValue': {
                            'value': 'string',
                            'description': 'string'
                        },
                        'updateTypeValue': {
                            'value': 'string',
                            'newValue': 'string',
                            'description': 'string'
                        },
                        'deleteTypeValue': {
                            'value': 'string'
                        }
                    },
                ]
            },
            'deleteType': {
                'name': 'string'
            },
            'addVariable': {
                'name': 'string',
                'type': 'string',
                'description': 'string'
            },
            'updateVariable': {
                'name': 'string',
                'newName': 'string',
                'description': 'string'
            },
            'deleteVariable': {
                'name': 'string'
            },
            'addRule': {
                'expression': 'string'
            },
            'updateRule': {
                'ruleId': 'string',
                'expression': 'string'
            },
            'deleteRule': {
                'ruleId': 'string'
            },
            'addRuleFromNaturalLanguage': {
                'naturalLanguage': 'string'
            },
            'updateFromRulesFeedback': {
                'ruleIds': [
                    'string',
                ],
                'feedback': 'string'
            },
            'updateFromScenarioFeedback': {
                'ruleIds': [
                    'string',
                ],
                'scenarioExpression': 'string',
                'feedback': 'string'
            },
            'ingestContent': {
                'content': 'string'
            }
        },
    ],
    'annotationSetHash': 'string',
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • policyArn (string) –

      The Amazon Resource Name (ARN) of the Automated Reasoning policy.

    • name (string) –

      The name of the Automated Reasoning policy.

    • buildWorkflowId (string) –

      The unique identifier of the build workflow.

    • annotations (list) –

      The current set of annotations containing rules, variables, and types extracted from the source documents. These can be modified before finalizing the policy.

      • (dict) –

        Contains the various operations that can be performed on an Automated Reasoning policy, including adding, updating, and deleting rules, variables, and types.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: addType, updateType, deleteType, addVariable, updateVariable, deleteVariable, addRule, updateRule, deleteRule, addRuleFromNaturalLanguage, updateFromRulesFeedback, updateFromScenarioFeedback, ingestContent. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • addType (dict) –

          An operation to add a new custom type to the policy, defining a set of possible values for policy variables.

          • name (string) –

            The name of the new custom type. This name will be used to reference the type in variable definitions and rules.

          • description (string) –

            A description of what the custom type represents and how it should be used in the policy.

          • values (list) –

            The list of possible values that variables of this type can take, each with its own description and identifier.

            • (dict) –

              Represents a single value within a custom type definition, including its identifier and description.

              • value (string) –

                The actual value or identifier for this type value.

              • description (string) –

                A human-readable description explaining what this type value represents and when it should be used.

        • updateType (dict) –

          An operation to modify an existing custom type in the policy, such as changing its name, description, or allowed values.

          • name (string) –

            The current name of the custom type to update.

          • newName (string) –

            The new name for the custom type, if you want to rename it. If not provided, the name remains unchanged.

          • description (string) –

            The new description for the custom type, replacing the previous description.

          • values (list) –

            The updated list of values for the custom type, which can include additions, modifications, or removals.

            • (dict) –

              An annotation for managing values within custom types, including adding, updating, or removing specific type values.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: addTypeValue, updateTypeValue, deleteTypeValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • addTypeValue (dict) –

                An operation to add a new value to an existing custom type.

                • value (string) –

                  The identifier or name of the new value to add to the type.

                • description (string) –

                  A description of what this new type value represents and when it should be used.

              • updateTypeValue (dict) –

                An operation to modify an existing value within a custom type.

                • value (string) –

                  The current identifier or name of the type value to update.

                • newValue (string) –

                  The new identifier or name for the type value, if you want to rename it.

                • description (string) –

                  The new description for the type value, replacing the previous description.

              • deleteTypeValue (dict) –

                An operation to remove a value from an existing custom type.

                • value (string) –

                  The identifier or name of the value to remove from the type.

        • deleteType (dict) –

          An operation to remove a custom type from the policy. The type must not be referenced by any variables or rules.

          • name (string) –

            The name of the custom type to delete from the policy. The type must not be referenced by any variables or rules.

        • addVariable (dict) –

          An operation to add a new variable to the policy, which can be used in rule expressions to represent dynamic values.

          • name (string) –

            The name of the new variable. This name will be used to reference the variable in rule expressions.

          • type (string) –

            The type of the variable, which can be a built-in type (like string or number) or a custom type defined in the policy.

          • description (string) –

            A description of what the variable represents and how it should be used in rules.

        • updateVariable (dict) –

          An operation to modify an existing variable in the policy, such as changing its name, type, or description.

          • name (string) –

            The current name of the variable to update.

          • newName (string) –

            The new name for the variable, if you want to rename it. If not provided, the name remains unchanged.

          • description (string) –

            The new description for the variable, replacing the previous description.

        • deleteVariable (dict) –

          An operation to remove a variable from the policy. The variable must not be referenced by any rules.

          • name (string) –

            The name of the variable to delete from the policy. The variable must not be referenced by any rules.

        • addRule (dict) –

          An operation to add a new logical rule to the policy using formal mathematical expressions.

          • expression (string) –

            The formal logical expression that defines the rule, using mathematical notation and referencing policy variables and types.

        • updateRule (dict) –

          An operation to modify an existing rule in the policy, such as changing its logical expression or conditions.

          • ruleId (string) –

            The unique identifier of the rule to update.

          • expression (string) –

            The new formal logical expression for the rule, replacing the previous expression.

        • deleteRule (dict) –

          An operation to remove a rule from the policy.

          • ruleId (string) –

            The unique identifier of the rule to delete from the policy.

        • addRuleFromNaturalLanguage (dict) –

          An operation to add a new rule by converting natural language descriptions into formal logical expressions.

          • naturalLanguage (string) –

            The natural language description of the rule that should be converted into a formal logical expression.

        • updateFromRulesFeedback (dict) –

          An operation to update the policy based on feedback about how specific rules performed during testing or validation.

          • ruleIds (list) –

            The list of rule identifiers that the feedback applies to.

            • (string) –

          • feedback (string) –

            The feedback information about rule performance, including suggestions for improvements or corrections.

        • updateFromScenarioFeedback (dict) –

          An operation to update the policy based on feedback about how it performed on specific test scenarios.

          • ruleIds (list) –

            The list of rule identifiers that were involved in the scenario being evaluated.

            • (string) –

          • scenarioExpression (string) –

            The logical expression that defines the test scenario that generated this feedback.

          • feedback (string) –

            The feedback information about scenario performance, including any issues or improvements identified.

        • ingestContent (dict) –

          An operation to process and incorporate new content into the policy, extracting additional rules and concepts.

          • content (string) –

            The new content to be analyzed and incorporated into the policy, such as additional documents or rule descriptions.

    • annotationSetHash (string) –

      A hash value representing the current state of the annotations. This is used for optimistic concurrency control when updating annotations.

    • updatedAt (datetime) –

      The timestamp when the annotations were last updated.

Exceptions