latest

Summary

Members

Descriptions

namespaceai::lucidtech::las::sdk

namespace ai::lucidtech::las::sdk

Summary

class ai::lucidtech::las::sdk::Client

Summary

Members

Descriptions

public inlineClient(Credentialscredentials)

A client to invoke api methods from Lucidtech AI Services.

public inline JSONObjectgetDocument(String documentId)

#### Parameters

public inline JSONObjectlistDocuments()

#### Returns

public inline JSONObjectlistDocuments(List< NameValuePair > options)

#### Parameters

public inline JSONObjectcreateDocument(InputStream content,ContentType contentType,String consentId,Map< String, Object > options)

Creates a document handle, calls POST /documents endpoint

public inline JSONObjectcreateDocument(InputStream content,ContentType contentType,String consentId)

Creates a document handle, calls POST /documents endpoint

public inline JSONObjectcreateDocument(byte[] content,ContentType contentType,String consentId,Map< String, Object > options)

Creates a document handle, calls POST /documents endpoint

public inline JSONObjectcreateDocument(byte[] content,ContentType contentType,String consentId)

Creates a document handle, calls POST /documents endpoint

public inline JSONObjectcreatePrediction(String documentId,String modelName)

Run inference and create a prediction, calls the POST /predictions endpoint

public inline JSONObjectcreatePrediction(String documentId,String modelName,Map< String, Object > options)

Run inference and create a prediction, calls the POST /predictions endpoint

public inline Predictionpredict(String documentPath,String modelName,String consentId)

Create a prediction on a document documentPath by path using model modelName. This method takes care of creating and uploading a document as well as running inference using model to create prediction on the document.

public inline JSONObjectupdateDocument(String documentId,JSONObject feedback)

Post feedback to the REST API, calls the POST /documents/{documentId} endpoint. Posting feedback means posting the ground truth data for the particular document. This enables the API to learn from past mistakes

public inline JSONObjectcreateBatch(String description)

Creates a batch handle, calls the POST /batches endpoint

public inline JSONObjectdeleteConsent(String consentId)

Delete documents with this consent_id, calls the DELETE /consent/{consentId} endpoint.

public inline JSONObjectgetUser(String userId)

Get information about user, calls the GET /users/{user_id} endpoint.

Members

public inlineClient(Credentialscredentials)

A client to invoke api methods from Lucidtech AI Services.

Parameters

See also: Credentials

public inline JSONObjectgetDocument(String documentId)

Parameters

  • documentId The document id to run inference and create a prediction on

Returns

response from the API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectlistDocuments()

Returns

All documents from REST API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectlistDocuments(List< NameValuePair > options)

Parameters

  • options Available options are:

Returns

documents from REST API filtered using the passed options

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreateDocument(InputStream content,ContentType contentType,String consentId,Map< String, Object > options)

Creates a document handle, calls POST /documents endpoint

See also: ContentType

Parameters

  • content Input stream

  • contentType A mime type for the document handle

  • consentId An identifier to mark the owner of the document handle

  • options Additional options to include in request body

Returns

Response from API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreateDocument(InputStream content,ContentType contentType,String consentId)

Creates a document handle, calls POST /documents endpoint

See also: ContentType

Parameters

  • content Input stream

  • contentType A mime type for the document handle

  • consentId An identifier to mark the owner of the document handle

Returns

Response from API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreateDocument(byte[] content,ContentType contentType,String consentId,Map< String, Object > options)

Creates a document handle, calls POST /documents endpoint

See also: ContentType

Parameters

  • content Binary data

  • contentType A mime type for the document handle

  • consentId An identifier to mark the owner of the document handle

  • options Additional options to include in request body

Returns

Response from API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreateDocument(byte[] content,ContentType contentType,String consentId)

Creates a document handle, calls POST /documents endpoint

See also: ContentType

Parameters

  • content Binary data

  • contentType A mime type for the document handle

  • consentId An identifier to mark the owner of the document handle

Returns

Response from API

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreatePrediction(String documentId,String modelName)

Run inference and create a prediction, calls the POST /predictions endpoint

See also: Client::createDocument

Parameters

  • documentId The document id to run inference and create a prediction. See createDocument for how to get documentId

  • modelName The name of the model to use for inference

Returns

Prediction on document

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreatePrediction(String documentId,String modelName,Map< String, Object > options)

Run inference and create a prediction, calls the POST /predictions endpoint

See also: Client::createDocument

Parameters

  • documentId The document id to run inference and create a prediction. See createDocument for how to get documentId

  • modelName The name of the model to use for inference

  • options Available options are: maxPages - maximum number of pages to run predictions on autoRotate - whether or not to let the API try different rotations on

Returns

Prediction on document

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline Predictionpredict(String documentPath,String modelName,String consentId)

Create a prediction on a document documentPath by path using model modelName. This method takes care of creating and uploading a document as well as running inference using model to create prediction on the document.

Parameters

  • documentPath Path to document to run inference on

  • modelName The name of the model to use for inference

  • consentId An identifier to mark the owner of the document handle

Returns

Prediction on document

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectupdateDocument(String documentId,JSONObject feedback)

Post feedback to the REST API, calls the POST /documents/{documentId} endpoint. Posting feedback means posting the ground truth data for the particular document. This enables the API to learn from past mistakes

See also: Client::createDocument

Parameters

  • documentId The document id to post feedback to.

  • feedback Feedback to post

Returns

Feedback response

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectcreateBatch(String description)

Creates a batch handle, calls the POST /batches endpoint

Parameters

  • description Creates a batch handle, calls the POST /batches endpoint

Returns

Batch handle id and pre-signed upload url

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectdeleteConsent(String consentId)

Delete documents with this consent_id, calls the DELETE /consent/{consentId} endpoint.

See also: Client::createDocument

Parameters

  • consentId Delete documents with this consentId

Returns

Feedback response

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline JSONObjectgetUser(String userId)

Get information about user, calls the GET /users/{user_id} endpoint.

Parameters

  • userId The user_id to get consent hash for

Returns

User response

Exceptions

  • IOException General IOException

  • APIException Raised when API returns an erroneous status code

  • MissingAccessTokenException Raised if access token cannot be obtained

class ai::lucidtech::las::sdk::Credentials

Summary

Members

Descriptions

public inlineCredentials(String clientId,String clientSecret,String apiKey,String authEndpoint,String apiEndpoint)

Used to fetch and store credentials.

public inline StringgetAccessToken(HttpClient httpClient)

#### Parameters

public inline StringgetApiKey()

public inline StringgetApiEndpoint()

Members

public inlineCredentials(String clientId,String clientSecret,String apiKey,String authEndpoint,String apiEndpoint)

Used to fetch and store credentials.

Parameters

Exceptions

  • MissingCredentialsException Raised if some of credentials are missing

public inline StringgetAccessToken(HttpClient httpClient)

Parameters

  • httpClient Instance of HttpClient used to access the authentication endpoint

Returns

Access token, downloading it if necessary

Exceptions

  • MissingAccessTokenException Raised if access token cannot be obtained

public inline StringgetApiKey()

public inline StringgetApiEndpoint()

Generated by Moxygen