forked from Unstructured-IO/unstructured-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodeSamples.yaml
11 lines (11 loc) · 866 Bytes
/
codeSamples.yaml
1
2
3
4
5
6
7
8
9
10
11
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"