BedrockAgentCore / Client / get_ab_test

get_ab_test

BedrockAgentCore.Client.get_ab_test(**kwargs)

Retrieves detailed information about an A/B test, including its configuration, status, and statistical results.

See also: AWS API Documentation

Request Syntax

response = client.get_ab_test(
    abTestId='string'
)
Parameters:

abTestId (string) –

[REQUIRED]

The unique identifier of the A/B test to retrieve.

Return type:

dict

Returns:

Response Syntax

{
    'abTestId': 'string',
    'abTestArn': 'string',
    'name': 'string',
    'description': 'string',
    'status': 'CREATING'|'ACTIVE'|'CREATE_FAILED'|'UPDATING'|'UPDATE_FAILED'|'DELETING'|'DELETE_FAILED'|'FAILED',
    'executionStatus': 'PAUSED'|'RUNNING'|'STOPPED'|'NOT_STARTED',
    'gatewayArn': 'string',
    'variants': [
        {
            'name': 'string',
            'weight': 123,
            'variantConfiguration': {
                'configurationBundle': {
                    'bundleArn': 'string',
                    'bundleVersion': 'string'
                },
                'target': {
                    'name': 'string'
                }
            }
        },
    ],
    'gatewayFilter': {
        'targetPaths': [
            'string',
        ]
    },
    'evaluationConfig': {
        'onlineEvaluationConfigArn': 'string',
        'perVariantOnlineEvaluationConfig': [
            {
                'name': 'string',
                'onlineEvaluationConfigArn': 'string'
            },
        ]
    },
    'roleArn': 'string',
    'currentRunId': 'string',
    'errorDetails': [
        'string',
    ],
    'startedAt': datetime(2015, 1, 1),
    'stoppedAt': datetime(2015, 1, 1),
    'maxDurationExpiresAt': datetime(2015, 1, 1),
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'results': {
        'analysisTimestamp': datetime(2015, 1, 1),
        'evaluatorMetrics': [
            {
                'evaluatorArn': 'string',
                'controlStats': {
                    'variantName': 'string',
                    'sampleSize': 123,
                    'mean': 123.0
                },
                'variantResults': [
                    {
                        'variantName': 'string',
                        'sampleSize': 123,
                        'mean': 123.0,
                        'absoluteChange': 123.0,
                        'percentChange': 123.0,
                        'pValue': 123.0,
                        'confidenceInterval': {
                            'lower': 123.0,
                            'upper': 123.0
                        },
                        'isSignificant': True|False
                    },
                ]
            },
        ]
    }
}

Response Structure

  • (dict) –

    • abTestId (string) –

      The unique identifier of the A/B test.

    • abTestArn (string) –

      The Amazon Resource Name (ARN) of the A/B test.

    • name (string) –

      The name of the A/B test.

    • description (string) –

      The description of the A/B test.

    • status (string) –

      The current status of the A/B test.

    • executionStatus (string) –

      The execution status indicating whether the A/B test is currently running.

    • gatewayArn (string) –

      The Amazon Resource Name (ARN) of the gateway used for traffic splitting.

    • variants (list) –

      The list of variants in the A/B test.

      • (dict) –

        A variant in an A/B test, representing either the control (C) or treatment (T1) configuration.

        • name (string) –

          The name of the variant. Must be C for control or T1 for treatment.

        • weight (integer) –

          The percentage of traffic to route to this variant. Weights across all variants must sum to 100.

        • variantConfiguration (dict) –

          The configuration for this variant, including the configuration bundle or target reference.

          • configurationBundle (dict) –

            A reference to a configuration bundle version to use for this variant.

            • bundleArn (string) –

              The Amazon Resource Name (ARN) of the configuration bundle.

            • bundleVersion (string) –

              The version of the configuration bundle.

          • target (dict) –

            A reference to a gateway target to route traffic to for this variant.

            • name (string) –

              The name of the gateway target.

    • gatewayFilter (dict) –

      The gateway filter restricting which target paths are included.

      • targetPaths (list) –

        A list of target path patterns to include in the A/B test.

        • (string) –

    • evaluationConfig (dict) –

      The evaluation configuration for measuring variant performance.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: onlineEvaluationConfigArn, perVariantOnlineEvaluationConfig. 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'}
      
      • onlineEvaluationConfigArn (string) –

        The Amazon Resource Name (ARN) of a single online evaluation configuration to use for both variants.

      • perVariantOnlineEvaluationConfig (list) –

        Per-variant online evaluation configurations, allowing different evaluation settings for each variant.

        • (dict) –

          An online evaluation configuration associated with a specific A/B test variant.

          • name (string) –

            The name of the variant this evaluation configuration applies to.

          • onlineEvaluationConfigArn (string) –

            The Amazon Resource Name (ARN) of the online evaluation configuration for this variant.

    • roleArn (string) –

      The IAM role ARN used by the A/B test.

    • currentRunId (string) –

      The identifier of the current run of the A/B test.

    • errorDetails (list) –

      The error details if the A/B test encountered failures.

      • (string) –

    • startedAt (datetime) –

      The timestamp when the A/B test was started.

    • stoppedAt (datetime) –

      The timestamp when the A/B test was stopped.

    • maxDurationExpiresAt (datetime) –

      The timestamp when the A/B test will automatically expire.

    • createdAt (datetime) –

      The timestamp when the A/B test was created.

    • updatedAt (datetime) –

      The timestamp when the A/B test was last updated.

    • results (dict) –

      The statistical results of the A/B test, including per-evaluator metrics and significance analysis.

      • analysisTimestamp (datetime) –

        The timestamp when the analysis was performed.

      • evaluatorMetrics (list) –

        The per-evaluator metrics comparing control and treatment variants.

        • (dict) –

          Statistical metrics for a single evaluator comparing control and treatment variants.

          • evaluatorArn (string) –

            The Amazon Resource Name (ARN) of the evaluator.

          • controlStats (dict) –

            The statistics for the control variant.

            • variantName (string) –

              The name of the control variant.

            • sampleSize (integer) –

              The number of sessions evaluated for the control variant.

            • mean (float) –

              The mean evaluation score for the control variant.

          • variantResults (list) –

            The results for each treatment variant compared against the control.

            • (dict) –

              Statistical results for a treatment variant compared against the control.

              • variantName (string) –

                The name of the treatment variant.

              • sampleSize (integer) –

                The number of sessions evaluated for this variant.

              • mean (float) –

                The mean evaluation score for this variant.

              • absoluteChange (float) –

                The absolute change in mean score compared to the control variant.

              • percentChange (float) –

                The percentage change in mean score compared to the control variant.

              • pValue (float) –

                The p-value indicating the statistical significance of the observed difference.

              • confidenceInterval (dict) –

                The confidence interval for the observed difference.

                • lower (float) –

                  The lower bound of the confidence interval.

                • upper (float) –

                  The upper bound of the confidence interval.

              • isSignificant (boolean) –

                Whether the observed difference is statistically significant.

Exceptions

  • BedrockAgentCore.Client.exceptions.UnauthorizedException

  • BedrockAgentCore.Client.exceptions.ValidationException

  • BedrockAgentCore.Client.exceptions.AccessDeniedException

  • BedrockAgentCore.Client.exceptions.ThrottlingException

  • BedrockAgentCore.Client.exceptions.ResourceNotFoundException

  • BedrockAgentCore.Client.exceptions.InternalServerException