ClientV2
in package
uses
CustomSleepMixin
Mindee Client V2.
Table of Contents
Properties
Methods
- __construct() : mixed
- Mindee Client V2.
- enqueue() : JobResponse
- Send the document to an asynchronous endpoint and return its ID in the queue.
- enqueueAndGetInference() : InferenceResponse
- Send a document to an endpoint and poll the server until the result is sent or until the maximum number of tries is reached.
- enqueueAndGetResult() : T
- Send a document to an endpoint and poll the server until the result is sent or until the maximum number of tries is reached.
- enqueueInference() : JobResponse
- Send the document to an asynchronous endpoint and return its ID in the queue.
- getInference() : InferenceResponse
- Retrieves an inference.
- getJob() : JobResponse
- Get the status of an inference that was previously enqueued.
- getResult() : T
- getResultFromUrl() : T
- customSleep() : void
- Waits for a custom amount of time from either a float or an integer.
Properties
$mindeeApi
protected
MindeeApiV2
$mindeeApi
Mindee API V2.
Methods
__construct()
Mindee Client V2.
public
__construct([string|null $apiKey = null ]) : mixed
Parameters
- $apiKey : string|null = null
-
Optional API key. Will fall back to environment variable if not provided.
enqueue()
Send the document to an asynchronous endpoint and return its ID in the queue.
public
enqueue(InputSource $inputSource, BaseParameters $params) : JobResponse
Parameters
- $inputSource : InputSource
-
File to parse.
- $params : BaseParameters
-
Parameters relating to prediction options.
Tags
Return values
JobResponse —A JobResponse containing the job (queue) corresponding to a document.
enqueueAndGetInference()
Send a document to an endpoint and poll the server until the result is sent or until the maximum number of tries is reached.
public
enqueueAndGetInference(InputSource $inputDoc, InferenceParameters $params) : InferenceResponse
Parameters
- $inputDoc : InputSource
-
Input document to parse.
- $params : InferenceParameters
-
Parameters relating to prediction options.
Tags
Return values
InferenceResponse —A response containing parsing results.
enqueueAndGetResult()
Send a document to an endpoint and poll the server until the result is sent or until the maximum number of tries is reached.
public
enqueueAndGetResult(string $responseClass, InputSource $inputDoc, BaseParameters $params) : T
Parameters
- $responseClass : string
-
The response class to construct.
- $inputDoc : InputSource
-
Input document to parse.
- $params : BaseParameters
-
Parameters relating to prediction options.
Tags
Return values
T —A response containing parsing results.
enqueueInference()
Send the document to an asynchronous endpoint and return its ID in the queue.
public
enqueueInference(InputSource $inputSource, InferenceParameters $params) : JobResponse
Parameters
- $inputSource : InputSource
-
File to parse.
- $params : InferenceParameters
-
Parameters relating to prediction options.
Tags
Return values
JobResponse —A JobResponse containing the job (queue) corresponding to a document.
getInference()
Retrieves an inference.
public
getInference(string $inferenceId) : InferenceResponse
Parameters
- $inferenceId : string
-
ID of the queue to poll.
Tags
Return values
InferenceResponse —An InferenceResponse containing a Job.
getJob()
Get the status of an inference that was previously enqueued.
public
getJob(string $jobId) : JobResponse
Can be used for polling.
Parameters
- $jobId : string
-
ID of the queue to poll.
Tags
Return values
JobResponse —A JobResponse containing a Job, which also contains a Document if the parsing is complete.
getResult()
public
getResult(string $responseClass, string $resultId) : T
Parameters
- $responseClass : string
-
The response class to construct.
- $resultId : string
-
ID of the result.
Tags
Return values
T —A response containing parsing results.
getResultFromUrl()
public
getResultFromUrl(string $responseClass, string $resultUrl) : T
Parameters
- $responseClass : string
-
The response class to construct.
- $resultUrl : string
-
URL of the result.
Tags
Return values
T —A response containing parsing results.
customSleep()
Waits for a custom amount of time from either a float or an integer.
protected
static customSleep(float|int $delay) : void
Purposefully waits for one more millisecond on windows due to flakiness in delays between OS.
Parameters
- $delay : float|int
-
Delay in seconds.