Mindee API Client.
api_key (str)
Add a custom endpoint, created using the Mindee API Builder.
endpoint_name (str) – The “API name” field in the “Settings” page of the API Builder
account_name (str, default: 'mindee') – Your organization’s username on the API Builder
version (Optional[str], default: None) – If set, locks the version of the model to use.
If not set, use the latest version of the model.
Enqueues a document to an asynchronous endpoint.
product_class (Type[Inference]) – The document class to use.
The response object will be instantiated based on this parameter.
input_source (Union[LocalInputSource, UrlInputSource]) – The document/source file to use.
Has to be created beforehand.
include_words (bool, default: False) – Whether to include the full text for each page.
This performs a full OCR operation on the server and will increase response time.
close_file (bool, default: True) – Whether to close() the file after parsing it.
Set to False if you need to access the file after this operation.
page_options (Optional[PageOptions], default: None) – If set, remove pages from the document as specified.
This is done before sending the file to the server.
It is useful to avoid page limitations.
cropper (bool, default: False) – Whether to include cropper results for each page.
This performs a cropping operation on the server and will increase response time.
endpoint (Optional[Endpoint], default: None) – For custom endpoints, an endpoint has to be given.
full_text (bool, default: False) – Whether to include the full OCR text response in compatible APIs.
workflow_id (Optional[str], default: None) – Workflow ID.
rag (bool, default: False) – If set, will enable Retrieval-Augmented Generation.
Only works if a valid workflow_id is set.
Enqueues to an asynchronous endpoint and automatically polls for a response.
product_class (Type[Inference]) – The document class to use.
The response object will be instantiated based on this parameter.
input_source (Union[LocalInputSource, UrlInputSource]) – The document/source file to use.
Has to be created beforehand.
include_words (bool, default: False) – Whether to include the full text for each page.
This performs a full OCR operation on the server and will increase response time.
close_file (bool, default: True) – Whether to close() the file after parsing it.
Set to False if you need to access the file after this operation.
page_options (Optional[PageOptions], default: None) – If set, remove pages from the document as specified.
This is done before sending the file to the server.
It is useful to avoid page limitations.
cropper (bool, default: False) – Whether to include cropper results for each page.
This performs a cropping operation on the server and will increase response time.
endpoint (Optional[Endpoint], default: None) – For custom endpoints, an endpoint has to be given.
initial_delay_sec (float, default: 2) – Delay between each polling attempts.
This should not be shorter than 1 second.
delay_sec (float, default: 1.5) – Delay between each polling attempts.
This should not be shorter than 1 second.
max_retries (int, default: 80) – Total amount of polling attempts.
full_text (bool, default: False) – Whether to include the full OCR text response in compatible APIs.
workflow_id (Optional[str], default: None) – Workflow ID.
rag (bool, default: False) – If set, will enable Retrieval-Augmented Generation.
Only works if a valid workflow_id is set.
Send the document to a workflow execution.
input_source (Union[LocalInputSource, UrlInputSource]) – The document/source file to use.
Has to be created beforehand.
workflow_id (str) – ID of the workflow.
page_options (Optional[PageOptions], default: None) – If set, remove pages from the document as specified.
This is done before sending the file to the server.
It is useful to avoid page limitations.
options (Optional[WorkflowOptions], default: None) – Options for the workflow.
WorkflowResponse
Load a prediction.
product_class (Type[Inference]) – Class of the product to use.
local_response (LocalResponse) – Local response to load.
Union[AsyncPredictResponse, PredictResponse]
A valid prediction.
Call prediction API on the document and parse the results.
product_class (Type[Inference]) – The document class to use.
The response object will be instantiated based on this parameter.
input_source (Union[LocalInputSource, UrlInputSource]) – The document/source file to use.
Has to be created beforehand.
include_words (bool, default: False) – Whether to include the full text for each page.
This performs a full OCR operation on the server and will increase response time.
Only available on financial document APIs.
close_file (bool, default: True) – Whether to close() the file after parsing it.
Set to False if you need to access the file after this operation.
page_options (Optional[PageOptions], default: None) – If set, remove pages from the document as specified.
This is done before sending the file to the server.
It is useful to avoid page limitations.
cropper (bool, default: False) – Whether to include cropper results for each page.
This performs a cropping operation on the server and will increase response time.
endpoint (Optional[Endpoint], default: None) – For custom endpoints, an endpoint has to be given.
full_text (bool, default: False) – Whether to include the full OCR text response in compatible APIs.
PredictResponse
Parses a queued document.
product_class (Type[Inference]) – The document class to use.
The response object will be instantiated based on this parameter.
queue_id (str) – queue_id received from the API.
endpoint (Optional[Endpoint], default: None) – For custom endpoints, an endpoint has to be given.
Send a feedback for a document.
product_class (Type[Inference]) – The document class to use.
The response object will be instantiated based on this parameter.
document_id (str) – The id of the document to send feedback to.
feedback (Dict[str, Any]) – Feedback to send.
endpoint (Optional[Endpoint], default: None) – For custom endpoints, an endpoint has to be given.