Issue with invoking start_human_loop on the API's
I am having an issue invoking the start_human_loop method on the Augmented AI API's.
**Code:**
def startHumanReview():
bucket= '{S3 Bucket name}'
document = 'xxxx.pdf'
s3_fname= 's3://%s/%s' % (bucket,document)
inputContent = {
'initialValue': "Withdrawal",
'taskObject': s3_fname # the s3 object will be passed to the worker task UI to render
}
client = boto3.client('sagemaker-a2i-runtime')
response = client.start_human_loop(
HumanLoopName='ManualTEST011',
FlowDefinitionArn='{FlowARN}',
HumanLoopInput={
"InputContent": json.dumps(inputContent)
}
)
if __name__ == "__main__":
startHumanReview()
**Error:**
Traceback (most recent call last):
File "test.py", line 138, in <module>
startHumanReview()
File "test.py", line 125, in startHumanReview
response = client.start_human_loop(
File "\AppData\Roaming\Python\Python38\site-packages\botocore\client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "\AppData\Roaming\Python\Python38\site-packages\botocore\client.py", line 635, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the StartHumanLoop operation: Provided InputContent is not valid. Please use valid InputContent JSON and try your request again.
Any guidance on how to fix this issue?
The format of the inputContent is similar to what's described in the following
https://aws.amazon.com/blogs/machine-learning/object-detection-and-model-retraining-with-amazon-sagemaker-and-amazon-augmented-ai/