|
4 | 4 | ```typescript |
5 | 5 | import { UnstructuredClient } from "unstructured-client"; |
6 | 6 |
|
7 | | -(async() => { |
8 | | - const sdk = new UnstructuredClient({ |
9 | | - security: { |
10 | | - apiKeyAuth: "YOUR_API_KEY", |
11 | | - }, |
12 | | - }); |
| 7 | +(async () => { |
| 8 | + const sdk = new UnstructuredClient({ |
| 9 | + security: { |
| 10 | + apiKeyAuth: "YOUR_API_KEY", |
| 11 | + }, |
| 12 | + }); |
13 | 13 |
|
14 | | - const res = await sdk.general.partition({ |
15 | | - chunkingStrategy: "by_title", |
16 | | - combineUnderNChars: 500, |
17 | | - encoding: "utf-8", |
18 | | - files: { |
19 | | - content: "+WmI5Q)|yy" as bytes <<<>>>, |
20 | | - files: "string", |
21 | | - }, |
22 | | - gzUncompressedContentType: "application/pdf", |
23 | | - hiResModelName: "yolox", |
24 | | - languages: [ |
25 | | - "[", |
26 | | - "e", |
27 | | - "n", |
28 | | - "g", |
29 | | - "]", |
30 | | - ], |
31 | | - maxCharacters: 1500, |
32 | | - newAfterNChars: 1500, |
33 | | - outputFormat: "application/json", |
34 | | - skipInferTableTypes: [ |
35 | | - "p", |
36 | | - "d", |
37 | | - "f", |
38 | | - ], |
39 | | - strategy: "hi_res", |
40 | | - }); |
| 14 | + const res = await sdk.general.partition({ |
| 15 | + chunkingStrategy: "by_title", |
| 16 | + combineUnderNChars: 500, |
| 17 | + encoding: "utf-8", |
| 18 | + files: { |
| 19 | + content: new TextEncoder().encode("0x2cC94b2FEF"), |
| 20 | + fileName: "um.shtml", |
| 21 | + }, |
| 22 | + gzUncompressedContentType: "application/pdf", |
| 23 | + hiResModelName: "yolox", |
| 24 | + languages: ["[", "e", "n", "g", "]"], |
| 25 | + maxCharacters: 1500, |
| 26 | + newAfterNChars: 1500, |
| 27 | + outputFormat: "application/json", |
| 28 | + skipInferTableTypes: ["p", "d", "f"], |
| 29 | + strategy: "hi_res", |
| 30 | + }); |
41 | 31 |
|
42 | | - |
43 | | - if (res.statusCode == 200) { |
44 | | - // handle response |
45 | | - } |
| 32 | + if (res.statusCode == 200) { |
| 33 | + // handle response |
| 34 | + } |
46 | 35 | })(); |
| 36 | + |
47 | 37 | ``` |
48 | 38 | <!-- End SDK Example Usage --> |
0 commit comments