Client
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.
- enqueueAndGetResult() : BaseResponse
- Send a document to an endpoint and poll the server until the result is sent or until the maximum number of tries is reached.
- getJob() : JobResponse
- Get the status of an inference that was previously enqueued.
- getResult() : BaseResponse
- getResultFromUrl() : BaseResponse
- searchModels() : SearchResponse
- Searches for a list of available models for the given API key.
- 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.
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[, PollingOptions|null $pollingOptions = null ]) : BaseResponse
Parameters
- $responseClass : string
-
The response class to construct.
- $inputDoc : InputSource
-
Input document to parse.
- $params : BaseParameters
-
Parameters relating to prediction options.
- $pollingOptions : PollingOptions|null = null
-
Options to apply to the polling.
Tags
Return values
BaseResponse —A response containing parsing results.
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) : BaseResponse
Parameters
- $responseClass : string
-
The response class to construct.
- $resultId : string
-
ID of the result.
Tags
Return values
BaseResponse —A response containing parsing results.
getResultFromUrl()
public
getResultFromUrl(string $responseClass, string $resultUrl) : BaseResponse
Parameters
- $responseClass : string
-
The response class to construct.
- $resultUrl : string
-
URL of the result.
Tags
Return values
BaseResponse —A response containing parsing results.
searchModels()
Searches for a list of available models for the given API key.
public
searchModels([string|null $modelName = null ][, string|null $modelType = null ]) : SearchResponse
Parameters
- $modelName : string|null = null
-
Optional model name to filter by.
- $modelType : string|null = null
-
Optional model type to filter by.
Return values
SearchResponse —The list of models matching the criteria.
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.