Skip to content

start_human_loop async

start_human_loop(
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
    human_loop_name: Optional[HumanLoopName] = None,
    flow_definition_arn: Optional[FlowDefinitionArn] = None,
    human_loop_input: Optional[HumanLoopInput] = None,
    data_attributes: Optional[HumanLoopDataAttributes] = None,
) -> StartHumanLoopResponse

Starts a human loop, provided that at least one activation condition is met.

Parameters:

  • human_loop_name (Optional[HumanLoopName], default: None ) –

    The name of the human loop.

  • flow_definition_arn (Optional[FlowDefinitionArn], default: None ) –

    The Amazon Resource Name (ARN) of the flow definition associated with this human loop.

  • human_loop_input (Optional[HumanLoopInput], default: None ) –

    An object that contains information about the human loop.

  • data_attributes (Optional[HumanLoopDataAttributes], default: None ) –

    Attributes of the specified data. Use DataAttributes to specify if your data is free of personally identifiable information and/or free of adult content.

Raises:

  • ConflictException –

    Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ServiceQuotaExceededException –

    You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see Amazon Augmented AI Service Quotes. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see AWS Service Quotas in the AWS General Reference.

  • ThrottlingException –

    You exceeded the maximum number of requests.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker_a2i_runtime/_services/async_sage_maker_a2_i_runtime.py
async def start_human_loop(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
    human_loop_name: Optional[
        "capo_sagemaker_a2i_runtime.types.human_loop_name.HumanLoopName"
    ] = None,
    flow_definition_arn: Optional[
        "capo_sagemaker_a2i_runtime.types.flow_definition_arn.FlowDefinitionArn"
    ] = None,
    human_loop_input: Optional[
        "capo_sagemaker_a2i_runtime.types.human_loop_input.HumanLoopInput"
    ] = None,
    data_attributes: Optional[
        "capo_sagemaker_a2i_runtime.types.human_loop_data_attributes.HumanLoopDataAttributes"
    ] = None,
) -> "capo_sagemaker_a2i_runtime.types.start_human_loop_response.StartHumanLoopResponse":
    """<p>Starts a human loop, provided that at least one activation condition is met.</p>

    Args:
        human_loop_name: <p>The name of the human loop.</p>
        flow_definition_arn: <p>The Amazon Resource Name (ARN) of the flow definition associated with this human loop.</p>
        human_loop_input: <p>An object that contains information about the human loop.</p>
        data_attributes: <p>Attributes of the specified data. Use <code>DataAttributes</code> to specify if your data is free of personally identifiable information and/or free of adult content.</p>

    Raises:
        capo_sagemaker_a2i_runtime.errors.conflict_exception.ConflictException: <p>Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.</p>
        capo_sagemaker_a2i_runtime.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_sagemaker_a2i_runtime.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see <a href="https://docs.aws.amazon.com/general/latest/gr/a2i.html">Amazon Augmented AI Service Quotes</a>. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">AWS Service Quotas</a> in the <i>AWS General Reference</i>.</p>
        capo_sagemaker_a2i_runtime.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_sagemaker_a2i_runtime.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_sagemaker_a2i_runtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker_a2i_runtime.types.start_human_loop_request.StartHumanLoopRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker_a2i_runtime.types.start_human_loop_response.StartHumanLoopResponse"
    ]:
        import capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.start_human_loop

        (
            output,
            http_response,
        ) = await capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.start_human_loop.async_start_human_loop(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartHumanLoop")
    )
    input_: capo_sagemaker_a2i_runtime.types.start_human_loop_request.StartHumanLoopRequest = {}
    if human_loop_name is not None:
        input_["human_loop_name"] = human_loop_name
    if flow_definition_arn is not None:
        input_["flow_definition_arn"] = flow_definition_arn
    if human_loop_input is not None:
        input_["human_loop_input"] = human_loop_input
    if data_attributes is not None:
        input_["data_attributes"] = data_attributes

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output