@@ -36,6 +36,10 @@ deployment of Unstructured API, you can access the API using the Python or TypeS
36
36
to ensure compatibility with future updates.
37
37
</Note >
38
38
39
+ <Note >
40
+ Currently, the clients only support sending one file at a time.
41
+ </Note >
42
+
39
43
Let's start with a simple example in which you send a pdf document to be partitioned via the free Unstructured API:
40
44
41
45
<CodeGroup >
@@ -53,15 +57,14 @@ deployment of Unstructured API, you can access the API using the Python or TypeS
53
57
file = open (filename, " rb" )
54
58
req = operations.PartitionRequest(
55
59
partition_parameters = shared.PartitionParameters(
56
- # --- `files` is the only required parameter ---
57
- files = shared.Files( # The sdk currently only supports sending a single file
60
+ files = shared.Files(
58
61
content = file .read(),
59
62
file_name = filename,
60
63
),
61
64
# --- Other partition parameters ---
62
65
# Note: Defining `strategy`, `chunking_strategy`, and `output_format`
63
66
# parameters as strings is accepted, but will not pass strict type checking. It is
64
- # advised to use the new enum classes for defining those parameters as shown below.
67
+ # advised to use the defined enum classes as shown below.
65
68
strategy = shared.Strategy.AUTO ,
66
69
languages = [' eng' ],
67
70
),
@@ -87,9 +90,7 @@ deployment of Unstructured API, you can access the API using the Python or TypeS
87
90
async function run () {
88
91
const res = await client .general .partition ({
89
92
partitionParameters: {
90
- // --- `files` is the only required parameter ---
91
- files: await openAsBlob (" sample-docs/layout-parser-paper.pdf" ), // The sdk currently only supports sending a single file
92
- // --- Other partition params ---
93
+ files: await openAsBlob (" sample-docs/layout-parser-paper.pdf" ),
93
94
strategy: Strategy .Auto ,
94
95
languages: [' eng' ],
95
96
},
@@ -115,9 +116,8 @@ deployment of Unstructured API, you can access the API using the Python or TypeS
115
116
filename = " sample-docs/layout-parser-paper.pdf"
116
117
file = open (filename, " rb" )
117
118
118
- # Requests not wrapped in `shared.PartitionRequest` may be deprecated and break in future versions
119
119
req = shared.PartitionParameters(
120
- files = shared.Files( # The sdk currently only supports sending a single file
120
+ files = shared.Files(
121
121
content = file .read(),
122
122
file_name = filename,
123
123
),
@@ -149,7 +149,6 @@ deployment of Unstructured API, you can access the API using the Python or TypeS
149
149
const data = fs .readFileSync (filename);
150
150
151
151
client .general .partition ({
152
- // The sdk currently only supports sending a single file
153
152
files: {
154
153
content: data,
155
154
fileName: filename,
0 commit comments