V2 Mindee HTTP

Mindee API V2

class MindeeAPIV2(api_key, http_client=None)

Settings class relating to API V2 requests.

Parameters:
  • api_key (str | None)

  • http_client (Client | None)

close()

Closes the underlying HTTP client.

Return type:

None

delete_http_client()

Delete the underlying HTTP client.

req_get_job_by_id(job_id)

Get the result of an inference that was previously enqueued.

Parameters:

job_id (str) – Job ID, returned by the enqueue request.

Return type:

JobResponse

req_get_product_result_by_id(response_type, inference_id)

Sends a request matching a given queue_id. Returns either a Job or a Document.

Parameters:
  • inference_id (str) – Inference ID, returned by the job request.

  • response_type (type[TypeVar(ResponseT, bound= BaseInferenceResponse)]) – Type of the response to return.

Return type:

TypeVar(ResponseT, bound= BaseInferenceResponse)

req_get_product_result_by_url(response_type, url)

Get the result of an inference that was previously enqueued.

Parameters:
  • url (str) – URL to use for the request.

  • response_type (type[TypeVar(ResponseT, bound= BaseInferenceResponse)]) – Type of the response to return.

Return type:

TypeVar(ResponseT, bound= BaseInferenceResponse)

Returns:

Response object from the request.

req_get_search_models(name, model_type)

Deprecated. Use search instead.

Return type:

SearchResponse

Parameters:
  • name (str | None)

  • model_type (str | None)

req_post_product_enqueue(input_source, params)

Send a file to the asynchronous processing queue for inference processing.

Parameters:
Return type:

JobResponse

Returns:

A JobResponse containing the enqueued job.

Search for resources matching the given criteria. :type params: BaseSearchParameters[TypeVar(TypeSearchResponse, bound= BaseSearchResponse)] :param params: Search parameters

Return type:

TypeVar(TypeSearchResponse, bound= BaseSearchResponse)

Returns:

A search response containing the matching resources

Parameters:

params (BaseSearchParameters[TypeSearchResponse])

set_base_url(value)

Set the base URL for all requests.

Return type:

None

Parameters:

value (str)

set_timeout(value)

Set the timeout for all requests.

Return type:

None

Parameters:

value (str | int)

api_key: str | None

API Key for the client.

property base_headers: dict[str, str]

Base headers to send with all API requests.

base_url: str

Base URL for all V2 requests.

http_client: Client | None

HTTP client for making requests.

request_timeout: float

Timeout for all requests.

url_root: str

Root of the URL to use for polling.