Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.88 KB

File metadata and controls

63 lines (44 loc) · 2.88 KB

General

(general)

Overview

Available Operations

partition

Description

Example Usage

from unstructured_client import UnstructuredClient
from unstructured_client.models import shared


with UnstructuredClient() as uc_client:

    res = uc_client.general.partition(request={
        "partition_parameters": {
            "files": {
                "content": open("example.file", "rb"),
                "file_name": "example.file",
            },
            "split_pdf_page_range": [
                1,
                10,
            ],
            "vlm_model": shared.VLMModel.GPT_4O,
            "vlm_model_provider": shared.VLMModelProvider.OPENAI,
        },
    })

    assert res.elements is not None

    # Handle response
    print(res.elements)

Parameters

Parameter Type Required Description
request operations.PartitionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.
server_url Optional[str] An optional server URL to use.

Response

operations.PartitionResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.ServerError 5XX application/json
errors.SDKError 4XX */*