Interface SageMakerA2IRuntimeClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
Amazon Augmented AI (Amazon A2I) adds the benefit of human judgment to any machine learning application. When an AI application can't evaluate data with a high degree of confidence, human reviewers can take over. This human review is called a human review workflow. To create and start a human review workflow, you need three resources: a worker task template, a flow definition, and a human loop.
For information about these resources and prerequisites for using Amazon A2I, see Get Started with Amazon Augmented AI in the Amazon SageMaker Developer Guide.
This API reference includes information about API actions and data types that you can use to interact with Amazon A2I programmatically. Use this guide to:
-
Start a human loop with the
StartHumanLoop
operation when using Amazon A2I with a custom task type. To learn more about the difference between custom and built-in task types, see Use Task Types . To learn how to start a human loop using this API, see Create and Start a Human Loop for a Custom Task Type in the Amazon SageMaker Developer Guide. -
Manage your human loops. You can list all human loops that you have created, describe individual human loops, and stop and delete human loops. To learn more, see Monitor and Manage Your Human Loop in the Amazon SageMaker Developer Guide.
Amazon A2I integrates APIs from various AWS services to create and start human review workflows for those services. To learn how Amazon A2I uses these APIs, see Use APIs in Amazon A2I in the Amazon SageMaker Developer Guide.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder that can be used to configure and create aSageMakerA2IRuntimeClient
.static SageMakerA2IRuntimeClient
create()
Create aSageMakerA2IRuntimeClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.default DeleteHumanLoopResponse
deleteHumanLoop
(Consumer<DeleteHumanLoopRequest.Builder> deleteHumanLoopRequest) Deletes the specified human loop for a flow definition.default DeleteHumanLoopResponse
deleteHumanLoop
(DeleteHumanLoopRequest deleteHumanLoopRequest) Deletes the specified human loop for a flow definition.default DescribeHumanLoopResponse
describeHumanLoop
(Consumer<DescribeHumanLoopRequest.Builder> describeHumanLoopRequest) Returns information about the specified human loop.default DescribeHumanLoopResponse
describeHumanLoop
(DescribeHumanLoopRequest describeHumanLoopRequest) Returns information about the specified human loop.default ListHumanLoopsResponse
listHumanLoops
(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) Returns information about human loops, given the specified parameters.default ListHumanLoopsResponse
listHumanLoops
(ListHumanLoopsRequest listHumanLoopsRequest) Returns information about human loops, given the specified parameters.default ListHumanLoopsIterable
listHumanLoopsPaginator
(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) This is a variant oflistHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation.default ListHumanLoopsIterable
listHumanLoopsPaginator
(ListHumanLoopsRequest listHumanLoopsRequest) This is a variant oflistHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
default StartHumanLoopResponse
startHumanLoop
(Consumer<StartHumanLoopRequest.Builder> startHumanLoopRequest) Starts a human loop, provided that at least one activation condition is met.default StartHumanLoopResponse
startHumanLoop
(StartHumanLoopRequest startHumanLoopRequest) Starts a human loop, provided that at least one activation condition is met.default StopHumanLoopResponse
stopHumanLoop
(Consumer<StopHumanLoopRequest.Builder> stopHumanLoopRequest) Stops the specified human loop.default StopHumanLoopResponse
stopHumanLoop
(StopHumanLoopRequest stopHumanLoopRequest) Stops the specified human loop.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
deleteHumanLoop
default DeleteHumanLoopResponse deleteHumanLoop(DeleteHumanLoopRequest deleteHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Deletes the specified human loop for a flow definition.
If the human loop was deleted, this operation will return a
ResourceNotFoundException
.- Parameters:
deleteHumanLoopRequest
-- Returns:
- Result of the DeleteHumanLoop operation returned by the service.
- See Also:
-
deleteHumanLoop
default DeleteHumanLoopResponse deleteHumanLoop(Consumer<DeleteHumanLoopRequest.Builder> deleteHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Deletes the specified human loop for a flow definition.
If the human loop was deleted, this operation will return a
ResourceNotFoundException
.
This is a convenience which creates an instance of the
DeleteHumanLoopRequest.Builder
avoiding the need to create one manually viaDeleteHumanLoopRequest.builder()
- Parameters:
deleteHumanLoopRequest
- AConsumer
that will call methods onDeleteHumanLoopRequest.Builder
to create a request.- Returns:
- Result of the DeleteHumanLoop operation returned by the service.
- See Also:
-
describeHumanLoop
default DescribeHumanLoopResponse describeHumanLoop(DescribeHumanLoopRequest describeHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Returns information about the specified human loop. If the human loop was deleted, this operation will return a
ResourceNotFoundException
error.- Parameters:
describeHumanLoopRequest
-- Returns:
- Result of the DescribeHumanLoop operation returned by the service.
- See Also:
-
describeHumanLoop
default DescribeHumanLoopResponse describeHumanLoop(Consumer<DescribeHumanLoopRequest.Builder> describeHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Returns information about the specified human loop. If the human loop was deleted, this operation will return a
ResourceNotFoundException
error.
This is a convenience which creates an instance of the
DescribeHumanLoopRequest.Builder
avoiding the need to create one manually viaDescribeHumanLoopRequest.builder()
- Parameters:
describeHumanLoopRequest
- AConsumer
that will call methods onDescribeHumanLoopRequest.Builder
to create a request.- Returns:
- Result of the DescribeHumanLoop operation returned by the service.
- See Also:
-
listHumanLoops
default ListHumanLoopsResponse listHumanLoops(ListHumanLoopsRequest listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.
- Parameters:
listHumanLoopsRequest
-- Returns:
- Result of the ListHumanLoops operation returned by the service.
- See Also:
-
listHumanLoops
default ListHumanLoopsResponse listHumanLoops(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.
This is a convenience which creates an instance of the
ListHumanLoopsRequest.Builder
avoiding the need to create one manually viaListHumanLoopsRequest.builder()
- Parameters:
listHumanLoopsRequest
- AConsumer
that will call methods onListHumanLoopsRequest.Builder
to create a request.- Returns:
- Result of the ListHumanLoops operation returned by the service.
- See Also:
-
listHumanLoopsPaginator
default ListHumanLoopsIterable listHumanLoopsPaginator(ListHumanLoopsRequest listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException This is a variant of
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client .listHumanLoopsPaginator(request); for (software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation.- Parameters:
listHumanLoopsRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listHumanLoopsPaginator
default ListHumanLoopsIterable listHumanLoopsPaginator(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException This is a variant of
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client .listHumanLoopsPaginator(request); for (software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)
operation.
This is a convenience which creates an instance of the
ListHumanLoopsRequest.Builder
avoiding the need to create one manually viaListHumanLoopsRequest.builder()
- Parameters:
listHumanLoopsRequest
- AConsumer
that will call methods onListHumanLoopsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
startHumanLoop
default StartHumanLoopResponse startHumanLoop(StartHumanLoopRequest startHumanLoopRequest) throws ValidationException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Starts a human loop, provided that at least one activation condition is met.
- Parameters:
startHumanLoopRequest
-- Returns:
- Result of the StartHumanLoop operation returned by the service.
- See Also:
-
startHumanLoop
default StartHumanLoopResponse startHumanLoop(Consumer<StartHumanLoopRequest.Builder> startHumanLoopRequest) throws ValidationException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Starts a human loop, provided that at least one activation condition is met.
This is a convenience which creates an instance of the
StartHumanLoopRequest.Builder
avoiding the need to create one manually viaStartHumanLoopRequest.builder()
- Parameters:
startHumanLoopRequest
- AConsumer
that will call methods onStartHumanLoopRequest.Builder
to create a request.- Returns:
- Result of the StartHumanLoop operation returned by the service.
- See Also:
-
stopHumanLoop
default StopHumanLoopResponse stopHumanLoop(StopHumanLoopRequest stopHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Stops the specified human loop.
- Parameters:
stopHumanLoopRequest
-- Returns:
- Result of the StopHumanLoop operation returned by the service.
- See Also:
-
stopHumanLoop
default StopHumanLoopResponse stopHumanLoop(Consumer<StopHumanLoopRequest.Builder> stopHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException Stops the specified human loop.
This is a convenience which creates an instance of the
StopHumanLoopRequest.Builder
avoiding the need to create one manually viaStopHumanLoopRequest.builder()
- Parameters:
stopHumanLoopRequest
- AConsumer
that will call methods onStopHumanLoopRequest.Builder
to create a request.- Returns:
- Result of the StopHumanLoop operation returned by the service.
- See Also:
-
create
Create aSageMakerA2IRuntimeClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aSageMakerA2IRuntimeClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-