-
Notifications
You must be signed in to change notification settings - Fork 6
/
codeSamples.yaml
34 lines (30 loc) · 1019 Bytes
/
codeSamples.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
overlay: 1.0.0
info:
title: CodeSamples overlay for typescript target
version: 0.0.0
actions:
- target: $["paths"]["/general/v0/general"]["post"]
update:
x-codeSamples:
- lang: typescript
label: partition
source: |-
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import { Strategy } from "unstructured-client/sdk/models/shared";
const unstructuredClient = new UnstructuredClient({
security: {
apiKeyAuth: "YOUR_API_KEY",
},
});
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("./sample-file"),
strategy: Strategy.Auto,
},
});
// Handle the result
console.log(result)
}
run();