Skip to content

start_test_set_generation

start_test_set_generation(
    test_set_name: Name,
    storage_location: TestSetStorageLocation,
    generation_data_source: TestSetGenerationDataSource,
    role_arn: RoleArn,
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    description: Optional[Description] = None,
    test_set_tags: Optional[TagMap] = None,
) -> StartTestSetGenerationResponse

The action to start the generation of test set.

Parameters:

  • test_set_name (Name) –

    The test set name for the test set generation request.

  • description (Optional[Description], default: None ) –

    The test set description for the test set generation request.

  • storage_location (TestSetStorageLocation) –

    The Amazon S3 storage location for the test set generation.

  • generation_data_source (TestSetGenerationDataSource) –

    The data source for the test set generation.

  • role_arn (RoleArn) –

    The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.

  • test_set_tags (Optional[TagMap], default: None ) –

    A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the UpdateTestSet operation to update tags. To update tags, use the TagResource operation.

Raises:

  • ConflictException –

    The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • ResourceNotFoundException –

    You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.

  • ServiceQuotaExceededException –

    You have reached a quota for your bot.

  • ThrottlingException –

    Your request rate is too high. Reduce the frequency of requests.

  • ValidationException –

    One of the input parameters in your request isn't valid. Check the parameters and try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lex_models_v2/_services/lex_models_v2.py
def start_test_set_generation(
    self,
    test_set_name: "capo_lex_models_v2.types.name.Name",
    storage_location: "capo_lex_models_v2.types.test_set_storage_location.TestSetStorageLocation",
    generation_data_source: "capo_lex_models_v2.types.test_set_generation_data_source.TestSetGenerationDataSource",
    role_arn: "capo_lex_models_v2.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    description: Optional[
        "capo_lex_models_v2.types.description.Description"
    ] = None,
    test_set_tags: Optional["capo_lex_models_v2.types.tag_map.TagMap"] = None,
) -> "capo_lex_models_v2.types.start_test_set_generation_response.StartTestSetGenerationResponse":
    """<p>The action to start the generation of test set.</p>

    Args:
        test_set_name: <p>The test set name for the test set generation request.</p>
        description: <p>The test set description for the test set generation request.</p>
        storage_location: <p>The Amazon S3 storage location for the test set generation.</p>
        generation_data_source: <p>The data source for the test set generation.</p>
        role_arn: <p>The roleARN used for any operation in the test set to access resources in the Amazon Web Services account.</p>
        test_set_tags: <p>A list of tags to add to the test set. You can only add tags when you import/generate a new test set. You can't use the <code>UpdateTestSet</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>

    Raises:
        capo_lex_models_v2.errors.conflict_exception.ConflictException: <p>The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again. </p>
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lex_models_v2.types.start_test_set_generation_request.StartTestSetGenerationRequest]",
    ) -> OperationResponse[
        "capo_lex_models_v2.types.start_test_set_generation_response.StartTestSetGenerationResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.start_test_set_generation

        output, http_response = (
            capo_lex_models_v2._operations.lex_model_building_service_v2.start_test_set_generation.start_test_set_generation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartTestSetGeneration")
    )
    input_: capo_lex_models_v2.types.start_test_set_generation_request.StartTestSetGenerationRequest = {
        "test_set_name": test_set_name,
        "storage_location": storage_location,
        "generation_data_source": generation_data_source,
        "role_arn": role_arn,
    }
    if description is not None:
        input_["description"] = description
    if test_set_tags is not None:
        input_["test_set_tags"] = test_set_tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output