aws / aws-sdk-ruby

The official AWS SDK for Ruby.
https://aws.amazon.com/sdk-for-ruby/
Apache License 2.0
3.53k stars 1.21k forks source link

Textract human_loop_config parameters available only on synchronous operations #2318

Closed joshkinabrew closed 4 years ago

joshkinabrew commented 4 years ago

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug In the documentation for setting up human_loop_config here: https://github.com/aws-samples/amazon-a2i-sample-jupyter-notebooks/blob/37e74300d9e1a19bd6d6413d7e5a9e53e09b5b6d/Amazon%20Augmented%20AI%20(A2I)%20and%20Textract%20AnalyzeDocument.ipynb under "Analyze Document with Textract" it describes how to call textract.analyze_document() with the HumanLoopConfig parameter. From my reading it is the same in Ruby as well except I use the key human_loop_config

#analyze_document is a synchronous operation as described here: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Textract/Client.html#analyze_document-instance_method. However I would expect the same parameters available in #analyze_document to be available in #start_document_analysis which is an asynchronous method. When I add human_loop_config: {...<snip>...} in the #start_document_analysis method it gives me an error ArgumentError (unexpected value at params[:human_loop_config]):

can the human_loop_config be added to the available params in #start_document_analysis?

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version aws-sdk-textract (1.14.0)

Version of Ruby, OS environment ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

To Reproduce (observed behavior)

client = Aws::Textract::Client.new(region: 'us-east-1')
client.start_document_analysis(
  document_location: {
    s3_object: {
      bucket: 'my-s3-bucket',
      name: 'a_key_in_my_bucket'
    },
    human_loop_config: {},
    feature_types: %w[TABLES FORMS],
    client_request_token: SecureRandom.uuid,
    job_tag: 'textract_job',
    notification_channel: {
      sns_topic_arn: 'my-sns-topic-arn',
      role_arn: 'my-role-arn'
    }
  }
)

Expected behavior I expect human_loop_config to be available to asynchronous operations like #start_document_analysis and not to just synchronous methods like #analyze_document.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context It would be great for us to be able to send documents to Textract asynchronously with a human loop and once reviewed by a human notify the notification ARN so we know when the human is done reviewing it.

ajredniwja commented 4 years ago

Hey @joshkinabrew thank-you reaching out to us with your issue, while it is not necessarily a bug with the SDK but an enhancement for a service, I have marked it as a feature request. The API model is not controlled by the SDK but the specific service teams, I have reached out to the service team regarding this feature. I am not sure how early they will pick it up but I can update you once I hear back from them.

ajredniwja commented 4 years ago

The feature is in the service team's backlog for 2020 but I cant really comment on the timeline of when it will be delivered.

Closing this issue now, will update this once the feature is released by the service team.

Deboshruti commented 2 years ago

31/02/2022 - Any update on this yet?

mhsFlairs commented 8 months ago

Any update on this yet?

RanVaknin commented 8 months ago

Hello to all the upvoters, and commentors.

I just want to chime in again on this. I have reached out to the Textract team once again to try and let them know that this feature is still being asked for.

Since this is a service related feature request, this is not actionable by the SDK team. The internal ticket number was P36195407 but was closed. I have created a new one P105237137 asking for this feature once again. If one of the requestors on the thread feels inclined, you can create a support ticket via the AWS Console, reference the new internal ticket, and ask for this to get prioritized. That might help get the attention of the Textract team.

Thank you for your patience.

All the best, Ran~

mhsFlairs commented 8 months ago

Thanks