Method: Mindee::Client#enqueue
- Defined in:
- lib/mindee/client.rb
#enqueue(input_source, product_class, endpoint: nil, options: {}) ⇒ Mindee::Parsing::Common::ApiResponse
Enqueue a document for async parsing
194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/mindee/client.rb', line 194 def enqueue(input_source, product_class, endpoint: nil, options: {}) opts = () endpoint ||= initialize_endpoint(product_class) logger.debug("Enqueueing document as '#{endpoint.url_root}'") prediction, raw_http = endpoint.predict_async( input_source, opts ) Mindee::Parsing::Common::ApiResponse.new(product_class, prediction, raw_http.to_json) end |