Skip to main content
The following information applies to the legacy Unstructured Partition Endpoint.Unstructured recommends that you use the local-file processing jobs functionality in the Unstructured Pipeline API instead. Unstructured’s local-file processing jobs provide many benefits over the legacy Unstructured Partition Endpoint, including support for:
  • Production-level usage.
  • Multiple local input files in batches.
  • The latest and highest-performing models.
  • Post-transform enrichments.
  • All of Unstructured’s chunking strategies.
  • The generation of vector embeddings.
The Unstructured API also provides support for processing files and data in remote locations.
For the Unstructured Python SDK, the Unstructured Partition Endpoint returns errors primarily through the UnstructuredClientError class (the base class for all errors raised by the Unstructured Python SDK) and the HTTPValidationError class (inherited from UnstructuredClientError). Less common errors are returned through the following classes:
  • httpx.RequestError, the base class for request errors.
  • httpx.ConnectError, for HTTP connection request errors.
  • httpx.TimeoutException, for HTTP request timeout errors.
  • ServerError (inherited from UnstructuredClientError), for server-side errors.
  • ResponseValidationError (inherited from UnstructuredClientError), for type mismatches between the response data and the expected Pydantic model.
Each of the preceding classes has the following members: The following example shows how to handle the preceding errors. In this example, a required Unstructured API key is intentionally commented out of the code, so that a 401 Unauthorized error is intentionally thrown.
The results of running the preceding code are similar to the following: