@@ -19,47 +19,27 @@ def initialize(api_key: '')
1919 @mindee_api = Mindee ::HTTP ::MindeeApiV2 . new ( api_key : api_key )
2020 end
2121
22- # Retrieves an inference.
23- # @param inference_id [String]
24- # @return [Mindee::Parsing::V2::InferenceResponse]
25- def get_inference ( inference_id )
26- @mindee_api . req_get_inference ( inference_id )
27- end
28-
2922 # Retrieves a result from a given queue or URL to the result.
3023 # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
3124 # @param resource [String] ID of the inference or URL to the result.
32- # @return [Mindee::Parsing::V2 ::BaseResponse]
25+ # @return [Mindee::V2::Parsing ::BaseResponse]
3326 def get_result ( product , resource )
3427 @mindee_api . req_get_result ( product , resource )
3528 end
3629
3730 # Retrieves an inference from a given queue or URL to the job.
3831 # @param job_id [String] ID of the job.
39- # @return [Mindee::Parsing::V2 ::JobResponse]
32+ # @return [Mindee::V2::Parsing ::JobResponse]
4033 def get_job ( job_id )
4134 @mindee_api . req_get_job ( job_id )
4235 end
4336
44- # Enqueue a document for async parsing.
45- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
46- # The source of the input document (local file or URL).
47- # @param params [Hash, InferenceParameters]
48- # @return [Mindee::Parsing::V2::JobResponse]
49- def enqueue_inference ( input_source , params , disable_redundant_warnings : false )
50- unless disable_redundant_warnings
51- warn '[DEPRECATION] `enqueue_inference` is deprecated; use `enqueue` instead.' , uplevel : 1
52- end
53- normalized_params = normalize_parameters ( Input ::InferenceParameters , params )
54- enqueue ( Mindee ::Parsing ::V2 ::Inference , input_source , normalized_params )
55- end
56-
5737 # Enqueue a document for async parsing.
5838 # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
5939 # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
6040 # The source of the input document (local file or URL).
61- # @param params [Hash, InferenceParameters ] Parameters for the inference.
62- # @return [Mindee::Parsing::V2 ::JobResponse]
41+ # @param params [Hash, Input::BaseParameters ] Parameters for the inference.
42+ # @return [Mindee::V2::Parsing ::JobResponse]
6343 def enqueue (
6444 product ,
6545 input_source ,
@@ -77,8 +57,8 @@ def enqueue(
7757 # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
7858 # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
7959 # The source of the input document (local file or URL).
80- # @param params [Hash, InferenceParameters ] Parameters for the inference.
81- # @return [Mindee:: Parsing::Common::ApiResponse ]
60+ # @param params [Hash, Input::BaseParameters ] Parameters for the inference.
61+ # @return [Parsing::BaseResponse ]
8262 def enqueue_and_get_result (
8363 product ,
8464 input_source ,
@@ -130,26 +110,7 @@ def enqueue_and_get_result(
130110 "Asynchronous parsing request timed out after #{ sec_count } seconds"
131111 end
132112
133- # Enqueue a document for async parsing and automatically try to retrieve it.
134- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
135- # The source of the input document (local file or URL).
136- # @param params [Hash, InferenceParameters] Parameters for the inference.
137- # @return [Mindee::Parsing::V2::InferenceResponse]
138- def enqueue_and_get_inference ( input_source , params , disable_redundant_warnings : false )
139- unless disable_redundant_warnings
140- warn '[DEPRECATION] `enqueue_and_get_inference` is deprecated; use `enqueue_and_get_result` instead.' ,
141- uplevel : 1
142- end
143-
144- response = enqueue_and_get_result ( Mindee ::Parsing ::V2 ::Inference , input_source , params )
145- unless response . is_a? ( Mindee ::Parsing ::V2 ::InferenceResponse )
146- raise TypeError , "Invalid response type \" #{ response . class } \" "
147- end
148-
149- response
150- end
151-
152- # If needed, converts the parsing options provided as a hash into a proper InferenceParameters object.
113+ # If needed, converts the parsing options provided as a hash into a proper BaseParameters subclass object.
153114 # @param params [Hash, Class<BaseParameters>] Params.
154115 # @return [BaseParameters]
155116 def normalize_parameters ( param_class , params )
0 commit comments