Package com.mindee
Class MindeeClientV2
- java.lang.Object
-
- com.mindee.MindeeClientV2
-
public class MindeeClientV2 extends Object
Entry point for the Mindee **V2** API features.
-
-
Constructor Summary
Constructors Constructor Description MindeeClientV2()Uses an API key read from the environment variables.MindeeClientV2(MindeeApiV2 mindeeApi)Inject both a PDF implementation and an HTTP implementation.MindeeClientV2(String apiKey)Uses the supplied API key.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JobResponseenqueue(LocalInputSource inputSource, BaseParameters params)Enqueue a document in the asynchronous queue.JobResponseenqueue(URLInputSource inputSource, BaseParameters params)Enqueue a document in the asynchronous queue.InferenceResponseenqueueAndGetInference(LocalInputSource inputSource, InferenceParameters options)Deprecated.use `enqueueAndGetResult` instead.InferenceResponseenqueueAndGetInference(URLInputSource inputSource, InferenceParameters options)Deprecated.use `enqueueAndGetResult` instead.<TResponse extends CommonResponse>
TResponseenqueueAndGetResult(Class<TResponse> responseClass, LocalInputSource inputSource, BaseParameters params)Send a local file to an async queue, poll, and parse when complete.<TResponse extends CommonResponse>
TResponseenqueueAndGetResult(Class<TResponse> responseClass, URLInputSource inputSource, BaseParameters params)Send a remote file to an async queue, poll, and parse when complete.JobResponseenqueueInference(LocalInputSource inputSource, InferenceParameters params)Deprecated.use `enqueue` instead.JobResponseenqueueInference(URLInputSource inputSource, InferenceParameters params)Deprecated.use `enqueue` instead.InferenceResponsegetInference(String inferenceId)Deprecated.use `getResult` instead.JobResponsegetJob(String jobId)Get the status of an inference that was previously enqueued.<TResponse extends CommonResponse>
TResponsegetResult(Class<TResponse> responseClass, String inferenceId)Get the result of an inference that was previously enqueued.
-
-
-
Constructor Detail
-
MindeeClientV2
public MindeeClientV2()
Uses an API key read from the environment variables.
-
MindeeClientV2
public MindeeClientV2(String apiKey)
Uses the supplied API key.
-
MindeeClientV2
public MindeeClientV2(MindeeApiV2 mindeeApi)
Inject both a PDF implementation and an HTTP implementation.
-
-
Method Detail
-
enqueueInference
public JobResponse enqueueInference(LocalInputSource inputSource, InferenceParameters params) throws IOException
Deprecated.use `enqueue` instead.- Throws:
IOException
-
enqueueInference
public JobResponse enqueueInference(URLInputSource inputSource, InferenceParameters params) throws IOException
Deprecated.use `enqueue` instead.- Throws:
IOException
-
enqueue
public JobResponse enqueue(LocalInputSource inputSource, BaseParameters params) throws IOException
Enqueue a document in the asynchronous queue.- Parameters:
inputSource- The local input source to send.params- The parameters to send along with the file.- Throws:
IOException
-
enqueue
public JobResponse enqueue(URLInputSource inputSource, BaseParameters params) throws IOException
Enqueue a document in the asynchronous queue.- Parameters:
inputSource- The URL input source to send.params- The parameters to send along with the file.- Throws:
IOException
-
getJob
public JobResponse getJob(String jobId)
Get the status of an inference that was previously enqueued. Can be used for polling.
-
getInference
public InferenceResponse getInference(String inferenceId)
Deprecated.use `getResult` instead.
-
getResult
public <TResponse extends CommonResponse> TResponse getResult(Class<TResponse> responseClass, String inferenceId)
Get the result of an inference that was previously enqueued. The inference will only be available after it has finished processing.
-
enqueueAndGetInference
public InferenceResponse enqueueAndGetInference(LocalInputSource inputSource, InferenceParameters options) throws IOException, InterruptedException
Deprecated.use `enqueueAndGetResult` instead.- Throws:
IOExceptionInterruptedException
-
enqueueAndGetInference
public InferenceResponse enqueueAndGetInference(URLInputSource inputSource, InferenceParameters options) throws IOException, InterruptedException
Deprecated.use `enqueueAndGetResult` instead.- Throws:
IOExceptionInterruptedException
-
enqueueAndGetResult
public <TResponse extends CommonResponse> TResponse enqueueAndGetResult(Class<TResponse> responseClass, LocalInputSource inputSource, BaseParameters params) throws IOException, InterruptedException
Send a local file to an async queue, poll, and parse when complete.- Parameters:
inputSource- The local input source to send.params- The parameters to send along with the file.- Returns:
- an instance of
InferenceResponse. - Throws:
IOException- Throws if the file can't be accessed.InterruptedException- Throws if the thread is interrupted.
-
enqueueAndGetResult
public <TResponse extends CommonResponse> TResponse enqueueAndGetResult(Class<TResponse> responseClass, URLInputSource inputSource, BaseParameters params) throws IOException, InterruptedException
Send a remote file to an async queue, poll, and parse when complete.- Parameters:
inputSource- The URL input source to send.params- The parameters to send along with the file.- Returns:
- an instance of
InferenceResponse. - Throws:
IOException- Throws if the file can't be accessed.InterruptedException- Throws if the thread is interrupted.
-
-