[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ranade1/unstructured-python-client/main/codeSamples.yaml [Back]  [Original]

overlay: 1.0.0
info:
  title: CodeSamples overlay for python target
  version: 0.0.0
actions:
  - target: $["paths"]["/general/v0/general"]["post"]
    update:
      "x-codeSamples":
        - "lang": "python"
          "label": "partition"
          "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\ns = UnstructuredClient()\n\nres = s.general.partition(request={\n    \"partition_parameters\": {\n        \"files\": {\n            \"file_name\": \"example.file\",\n            \"content\": open(\"example.file\", \"rb\"),\n        },\n        \"strategy\": shared.Strategy.AUTO,\n        \"chunking_strategy\": shared.ChunkingStrategy.BASIC,\n        \"split_pdf_page_range\": [\n            1,\n            10,\n        ],\n    },\n})\n\nif res.elements is not None:\n    # handle response\n    pass"

Web Proxy Viewer  |  New URL  |  Original Page