11package com .mindee ;
22
3- import com .mindee .http .MindeeApiV2 ;
4- import com .mindee .http .MindeeHttpApiV2 ;
5- import com .mindee .http .MindeeHttpExceptionV2 ;
63import com .mindee .input .LocalInputSource ;
74import com .mindee .input .URLInputSource ;
8- import com .mindee .parsing .v2 .CommonResponse ;
9- import com .mindee .parsing .v2 .ErrorResponse ;
10- import com .mindee .parsing .v2 .InferenceResponse ;
11- import com .mindee .parsing .v2 .JobResponse ;
125import com .mindee .v2 .clientOptions .BaseParameters ;
6+ import com .mindee .v2 .http .MindeeApiV2 ;
7+ import com .mindee .v2 .http .MindeeHttpApiV2 ;
8+ import com .mindee .v2 .http .MindeeHttpException ;
9+ import com .mindee .v2 .parsing .CommonResponse ;
10+ import com .mindee .v2 .parsing .ErrorResponse ;
11+ import com .mindee .v2 .parsing .JobResponse ;
12+ import com .mindee .v2 .product .extraction .ExtractionResponse ;
13+ import com .mindee .v2 .product .extraction .params .ExtractionParameters ;
1314import java .io .IOException ;
1415
1516/**
@@ -38,7 +39,7 @@ public MindeeClientV2(MindeeApiV2 mindeeApi) {
3839 */
3940 public JobResponse enqueueInference (
4041 LocalInputSource inputSource ,
41- InferenceParameters params
42+ ExtractionParameters params
4243 ) throws IOException {
4344 return enqueue (inputSource , params );
4445 }
@@ -48,7 +49,7 @@ public JobResponse enqueueInference(
4849 */
4950 public JobResponse enqueueInference (
5051 URLInputSource inputSource ,
51- InferenceParameters params
52+ ExtractionParameters params
5253 ) throws IOException {
5354 return enqueue (inputSource , params );
5455 }
@@ -90,8 +91,8 @@ public JobResponse getJob(String jobId) {
9091 /**
9192 * @deprecated use `getResult` instead.
9293 */
93- public InferenceResponse getInference (String inferenceId ) {
94- return getResult (InferenceResponse .class , inferenceId );
94+ public ExtractionResponse getInference (String inferenceId ) {
95+ return getResult (ExtractionResponse .class , inferenceId );
9596 }
9697
9798 /**
@@ -111,29 +112,29 @@ public <TResponse extends CommonResponse> TResponse getResult(
111112 /**
112113 * @deprecated use `enqueueAndGetResult` instead.
113114 */
114- public InferenceResponse enqueueAndGetInference (
115+ public ExtractionResponse enqueueAndGetInference (
115116 LocalInputSource inputSource ,
116- InferenceParameters options
117+ ExtractionParameters options
117118 ) throws IOException , InterruptedException {
118- return enqueueAndGetResult (InferenceResponse .class , inputSource , options );
119+ return enqueueAndGetResult (ExtractionResponse .class , inputSource , options );
119120 }
120121
121122 /**
122123 * @deprecated use `enqueueAndGetResult` instead.
123124 */
124- public InferenceResponse enqueueAndGetInference (
125+ public ExtractionResponse enqueueAndGetInference (
125126 URLInputSource inputSource ,
126- InferenceParameters options
127+ ExtractionParameters options
127128 ) throws IOException , InterruptedException {
128- return enqueueAndGetResult (InferenceResponse .class , inputSource , options );
129+ return enqueueAndGetResult (ExtractionResponse .class , inputSource , options );
129130 }
130131
131132 /**
132133 * Send a local file to an async queue, poll, and parse when complete.
133134 *
134135 * @param inputSource The local input source to send.
135136 * @param params The parameters to send along with the file.
136- * @return an instance of {@link InferenceResponse }.
137+ * @return an instance of {@link ExtractionResponse }.
137138 * @throws IOException Throws if the file can't be accessed.
138139 * @throws InterruptedException Throws if the thread is interrupted.
139140 */
@@ -152,7 +153,7 @@ public <TResponse extends CommonResponse> TResponse enqueueAndGetResult(
152153 *
153154 * @param inputSource The URL input source to send.
154155 * @param params The parameters to send along with the file.
155- * @return an instance of {@link InferenceResponse }.
156+ * @return an instance of {@link ExtractionResponse }.
156157 * @throws IOException Throws if the file can't be accessed.
157158 * @throws InterruptedException Throws if the thread is interrupted.
158159 */
@@ -170,7 +171,7 @@ public <TResponse extends CommonResponse> TResponse enqueueAndGetResult(
170171 * Common logic for polling an asynchronous job for local & url files.
171172 *
172173 * @param initialJob The initial job response.
173- * @return an instance of {@link InferenceResponse }.
174+ * @return an instance of {@link ExtractionResponse }.
174175 * @throws InterruptedException Throws if interrupted.
175176 */
176177 private <TResponse extends CommonResponse > TResponse pollAndFetch (
@@ -199,7 +200,7 @@ private <TResponse extends CommonResponse> TResponse pollAndFetch(
199200
200201 ErrorResponse error = resp .getJob ().getError ();
201202 if (error != null ) {
202- throw new MindeeHttpExceptionV2 (error .getStatus (), error .getDetail ());
203+ throw new MindeeHttpException (error .getStatus (), error .getDetail ());
203204 }
204205 throw new RuntimeException ("Max retries exceeded (" + max + ")." );
205206 }
0 commit comments