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 a HTTP implementation.MindeeClientV2(String apiKey)
Uses the supplied API-key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InferenceResponse
enqueueAndGetInference(LocalInputSource inputSource, InferenceParameters options)
Send a local file to an async queue, poll, and parse when complete.JobResponse
enqueueInference(LocalInputSource inputSource, InferenceParameters params)
Enqueue a document in the asynchronous queue.InferenceResponse
getInference(String inferenceId)
Get the result of an inference that was previously enqueued.JobResponse
getJob(String jobId)
Get the status 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 a HTTP implementation.
-
-
Method Detail
-
enqueueInference
public JobResponse enqueueInference(LocalInputSource inputSource, InferenceParameters params) throws IOException
Enqueue a document in the asynchronous queue.- 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)
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
Send a local file to an async queue, poll, and parse when complete.- Parameters:
inputSource
- The input source to send.options
- The options 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.
-
-