Skip to content

Commit 11068a9

Browse files
authored
Remove some autogen seections
1 parent 86d8536 commit 11068a9

File tree

1 file changed

+2
-181
lines changed

1 file changed

+2
-181
lines changed

README.md

Lines changed: 2 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -96,189 +96,10 @@ const client = new UnstructuredClient({
9696

9797

9898
<!-- No SDK Example Usage -->
99-
10099
<!-- No SDK Available Operations -->
101-
102100
<!-- No Pagination -->
103-
104-
105-
106-
<!-- Start Error Handling -->
107-
# Error Handling
108-
109-
Handling errors in your SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
110-
111-
112-
## Example
113-
114-
```typescript
115-
import { UnstructuredClient } from "unstructured-client";
116-
117-
(async() => {
118-
const sdk = new UnstructuredClient({
119-
security: {
120-
apiKeyAuth: "YOUR_API_KEY",
121-
},
122-
});
123-
124-
125-
let res;
126-
try {
127-
res = await sdk.general.partition({
128-
chunkingStrategy: "by_title",
129-
combineUnderNChars: 500,
130-
encoding: "utf-8",
131-
files: {
132-
content: "+WmI5Q)|yy" as bytes <<<>>>,
133-
files: "string",
134-
},
135-
gzUncompressedContentType: "application/pdf",
136-
hiResModelName: "yolox",
137-
languages: [
138-
"[",
139-
"e",
140-
"n",
141-
"g",
142-
"]",
143-
],
144-
newAfterNChars: 1500,
145-
outputFormat: "application/json",
146-
skipInferTableTypes: [
147-
"p",
148-
"d",
149-
"f",
150-
],
151-
strategy: "hi_res",
152-
});
153-
} catch (e) {
154-
if (e instanceof HTTPValidationError) {
155-
console.error(e) // handle exception
156-
157-
}
158-
159-
160-
if (res.statusCode == 200) {
161-
// handle response
162-
}
163-
})();
164-
```
165-
<!-- End Error Handling -->
166-
167-
168-
169-
<!-- Start Server Selection -->
170-
# Server Selection
171-
172-
## Select Server by Name
173-
174-
You can override the default server globally by passing a server name to the `server: string` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
175-
176-
| Name | Server | Variables |
177-
| ----- | ------ | --------- |
178-
| `prod` | `https://api.unstructured.io` | None |
179-
| `local` | `http://localhost:8000` | None |
180-
181-
For example:
182-
183-
184-
```typescript
185-
import { UnstructuredClient } from "unstructured-client";
186-
187-
(async() => {
188-
const sdk = new UnstructuredClient({
189-
security: {
190-
apiKeyAuth: "YOUR_API_KEY",
191-
},
192-
server: "local",
193-
});
194-
195-
const res = await sdk.general.partition({
196-
chunkingStrategy: "by_title",
197-
combineUnderNChars: 500,
198-
encoding: "utf-8",
199-
files: {
200-
content: "+WmI5Q)|yy" as bytes <<<>>>,
201-
files: "string",
202-
},
203-
gzUncompressedContentType: "application/pdf",
204-
hiResModelName: "yolox",
205-
languages: [
206-
"[",
207-
"e",
208-
"n",
209-
"g",
210-
"]",
211-
],
212-
newAfterNChars: 1500,
213-
outputFormat: "application/json",
214-
skipInferTableTypes: [
215-
"p",
216-
"d",
217-
"f",
218-
],
219-
strategy: "hi_res",
220-
});
221-
222-
223-
if (res.statusCode == 200) {
224-
// handle response
225-
}
226-
})();
227-
```
228-
229-
230-
## Override Server URL Per-Client
231-
232-
The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
233-
234-
235-
```typescript
236-
import { UnstructuredClient } from "unstructured-client";
237-
238-
(async() => {
239-
const sdk = new UnstructuredClient({
240-
security: {
241-
apiKeyAuth: "YOUR_API_KEY",
242-
},
243-
serverURL: "https://api.unstructured.io",
244-
});
245-
246-
const res = await sdk.general.partition({
247-
chunkingStrategy: "by_title",
248-
combineUnderNChars: 500,
249-
encoding: "utf-8",
250-
files: {
251-
content: "+WmI5Q)|yy" as bytes <<<>>>,
252-
files: "string",
253-
},
254-
gzUncompressedContentType: "application/pdf",
255-
hiResModelName: "yolox",
256-
languages: [
257-
"[",
258-
"e",
259-
"n",
260-
"g",
261-
"]",
262-
],
263-
newAfterNChars: 1500,
264-
outputFormat: "application/json",
265-
skipInferTableTypes: [
266-
"p",
267-
"d",
268-
"f",
269-
],
270-
strategy: "hi_res",
271-
});
272-
273-
274-
if (res.statusCode == 200) {
275-
// handle response
276-
}
277-
})();
278-
```
279-
<!-- End Server Selection -->
280-
281-
101+
<!-- No Error Handling -->
102+
<!-- No Server Selection -->
282103

283104
<!-- Start Custom HTTP Client -->
284105
# Custom HTTP Client

0 commit comments

Comments
 (0)