Table of Contents
AugmentedAIRuntime.
Client
¶A low-level client representing Amazon Augmented AI Runtime
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:
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.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.
import boto3
client = boto3.client('sagemaker-a2i-runtime')
These are the available methods:
can_paginate()
close()
delete_human_loop()
describe_human_loop()
get_paginator()
get_waiter()
list_human_loops()
start_human_loop()
stop_human_loop()
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
delete_human_loop
(**kwargs)¶Deletes the specified human loop for a flow definition.
If the human loop was deleted, this operation will return a ResourceNotFoundException
.
See also: AWS API Documentation
Request Syntax
response = client.delete_human_loop(
HumanLoopName='string'
)
[REQUIRED]
The name of the human loop that you want to delete.
{}
Response Structure
Exceptions
AugmentedAIRuntime.Client.exceptions.ValidationException
AugmentedAIRuntime.Client.exceptions.ResourceNotFoundException
AugmentedAIRuntime.Client.exceptions.ThrottlingException
AugmentedAIRuntime.Client.exceptions.InternalServerException
describe_human_loop
(**kwargs)¶Returns information about the specified human loop. If the human loop was deleted, this operation will return a ResourceNotFoundException
error.
See also: AWS API Documentation
Request Syntax
response = client.describe_human_loop(
HumanLoopName='string'
)
[REQUIRED]
The name of the human loop that you want information about.
{
'CreationTime': datetime(2015, 1, 1),
'FailureReason': 'string',
'FailureCode': 'string',
'HumanLoopStatus': 'InProgress'|'Failed'|'Completed'|'Stopped'|'Stopping',
'HumanLoopName': 'string',
'HumanLoopArn': 'string',
'FlowDefinitionArn': 'string',
'HumanLoopOutput': {
'OutputS3Uri': 'string'
}
}
Response Structure
The creation time when Amazon Augmented AI created the human loop.
The reason why a human loop failed. The failure reason is returned when the status of the human loop is Failed
.
A failure code that identifies the type of failure.
Possible values: ValidationError
, Expired
, InternalError
The status of the human loop.
The name of the human loop. The name must be lowercase, unique within the Region in your account, and can have up to 63 characters. Valid characters: a-z, 0-9, and - (hyphen).
The Amazon Resource Name (ARN) of the human loop.
The Amazon Resource Name (ARN) of the flow definition.
An object that contains information about the output of the human loop.
The location of the Amazon S3 object where Amazon Augmented AI stores your human loop output.
Exceptions
AugmentedAIRuntime.Client.exceptions.ValidationException
AugmentedAIRuntime.Client.exceptions.ResourceNotFoundException
AugmentedAIRuntime.Client.exceptions.ThrottlingException
AugmentedAIRuntime.Client.exceptions.InternalServerException
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
list_human_loops
(**kwargs)¶Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.
See also: AWS API Documentation
Request Syntax
response = client.list_human_loops(
CreationTimeAfter=datetime(2015, 1, 1),
CreationTimeBefore=datetime(2015, 1, 1),
FlowDefinitionArn='string',
SortOrder='Ascending'|'Descending',
NextToken='string',
MaxResults=123
)
2020-02-24
.2020-02-24
.[REQUIRED]
The Amazon Resource Name (ARN) of a flow definition.
Ascending
and Descending
.MaxResults
, then a NextToken
is returned in the output. You can use this token to display the next page of results.dict
Response Syntax
{
'HumanLoopSummaries': [
{
'HumanLoopName': 'string',
'HumanLoopStatus': 'InProgress'|'Failed'|'Completed'|'Stopped'|'Stopping',
'CreationTime': datetime(2015, 1, 1),
'FailureReason': 'string',
'FlowDefinitionArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
HumanLoopSummaries (list) --
An array of objects that contain information about the human loops.
(dict) --
Summary information about the human loop.
HumanLoopName (string) --
The name of the human loop.
HumanLoopStatus (string) --
The status of the human loop.
CreationTime (datetime) --
When Amazon Augmented AI created the human loop.
FailureReason (string) --
The reason why the human loop failed. A failure reason is returned when the status of the human loop is Failed
.
FlowDefinitionArn (string) --
The Amazon Resource Name (ARN) of the flow definition used to configure the human loop.
NextToken (string) --
A token to display the next page of results.
Exceptions
AugmentedAIRuntime.Client.exceptions.ValidationException
AugmentedAIRuntime.Client.exceptions.ResourceNotFoundException
AugmentedAIRuntime.Client.exceptions.ThrottlingException
AugmentedAIRuntime.Client.exceptions.InternalServerException
start_human_loop
(**kwargs)¶Starts a human loop, provided that at least one activation condition is met.
See also: AWS API Documentation
Request Syntax
response = client.start_human_loop(
HumanLoopName='string',
FlowDefinitionArn='string',
HumanLoopInput={
'InputContent': 'string'
},
DataAttributes={
'ContentClassifiers': [
'FreeOfPersonallyIdentifiableInformation'|'FreeOfAdultContent',
]
}
)
[REQUIRED]
The name of the human loop.
[REQUIRED]
The Amazon Resource Name (ARN) of the flow definition associated with this human loop.
[REQUIRED]
An object that contains information about the human loop.
Serialized input from the human loop. The input must be a string representation of a file in JSON format.
Attributes of the specified data. Use DataAttributes
to specify if your data is free of personally identifiable information and/or free of adult content.
Declares that your content is free of personally identifiable information or adult content.
Amazon SageMaker can restrict the Amazon Mechanical Turk workers who can view your task based on this information.
dict
Response Syntax
{
'HumanLoopArn': 'string'
}
Response Structure
(dict) --
HumanLoopArn (string) --
The Amazon Resource Name (ARN) of the human loop.
Exceptions
AugmentedAIRuntime.Client.exceptions.ValidationException
AugmentedAIRuntime.Client.exceptions.ThrottlingException
AugmentedAIRuntime.Client.exceptions.ServiceQuotaExceededException
AugmentedAIRuntime.Client.exceptions.InternalServerException
AugmentedAIRuntime.Client.exceptions.ConflictException
stop_human_loop
(**kwargs)¶Stops the specified human loop.
See also: AWS API Documentation
Request Syntax
response = client.stop_human_loop(
HumanLoopName='string'
)
[REQUIRED]
The name of the human loop that you want to stop.
{}
Response Structure
Exceptions
AugmentedAIRuntime.Client.exceptions.ValidationException
AugmentedAIRuntime.Client.exceptions.ResourceNotFoundException
AugmentedAIRuntime.Client.exceptions.ThrottlingException
AugmentedAIRuntime.Client.exceptions.InternalServerException
The available paginators are:
AugmentedAIRuntime.Paginator.
ListHumanLoops
¶paginator = client.get_paginator('list_human_loops')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AugmentedAIRuntime.Client.list_human_loops()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
CreationTimeAfter=datetime(2015, 1, 1),
CreationTimeBefore=datetime(2015, 1, 1),
FlowDefinitionArn='string',
SortOrder='Ascending'|'Descending',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
2020-02-24
.2020-02-24
.[REQUIRED]
The Amazon Resource Name (ARN) of a flow definition.
Ascending
and Descending
.A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'HumanLoopSummaries': [
{
'HumanLoopName': 'string',
'HumanLoopStatus': 'InProgress'|'Failed'|'Completed'|'Stopped'|'Stopping',
'CreationTime': datetime(2015, 1, 1),
'FailureReason': 'string',
'FlowDefinitionArn': 'string'
},
],
}
Response Structure
(dict) --
HumanLoopSummaries (list) --
An array of objects that contain information about the human loops.
(dict) --
Summary information about the human loop.
HumanLoopName (string) --
The name of the human loop.
HumanLoopStatus (string) --
The status of the human loop.
CreationTime (datetime) --
When Amazon Augmented AI created the human loop.
FailureReason (string) --
The reason why the human loop failed. A failure reason is returned when the status of the human loop is Failed
.
FlowDefinitionArn (string) --
The Amazon Resource Name (ARN) of the flow definition used to configure the human loop.