Skip to content

Commit

Permalink
Remove some autogen seections
Browse files Browse the repository at this point in the history
  • Loading branch information
awalker4 authored Oct 28, 2023
1 parent 86d8536 commit 11068a9
Showing 1 changed file with 2 additions and 181 deletions.
183 changes: 2 additions & 181 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,189 +96,10 @@ const client = new UnstructuredClient({


<!-- No SDK Example Usage -->

<!-- No SDK Available Operations -->

<!-- No Pagination -->



<!-- Start Error Handling -->
# Error Handling

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.


## Example

```typescript
import { UnstructuredClient } from "unstructured-client";

(async() => {
const sdk = new UnstructuredClient({
security: {
apiKeyAuth: "YOUR_API_KEY",
},
});


let res;
try {
res = await sdk.general.partition({
chunkingStrategy: "by_title",
combineUnderNChars: 500,
encoding: "utf-8",
files: {
content: "+WmI5Q)|yy" as bytes <<<>>>,
files: "string",
},
gzUncompressedContentType: "application/pdf",
hiResModelName: "yolox",
languages: [
"[",
"e",
"n",
"g",
"]",
],
newAfterNChars: 1500,
outputFormat: "application/json",
skipInferTableTypes: [
"p",
"d",
"f",
],
strategy: "hi_res",
});
} catch (e) {
if (e instanceof HTTPValidationError) {
console.error(e) // handle exception

}


if (res.statusCode == 200) {
// handle response
}
})();
```
<!-- End Error Handling -->
<!-- Start Server Selection -->
# Server Selection
## Select Server by Name
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:
| Name | Server | Variables |
| ----- | ------ | --------- |
| `prod` | `https://api.unstructured.io` | None |
| `local` | `http://localhost:8000` | None |

For example:


```typescript
import { UnstructuredClient } from "unstructured-client";
(async() => {
const sdk = new UnstructuredClient({
security: {
apiKeyAuth: "YOUR_API_KEY",
},
server: "local",
});
const res = await sdk.general.partition({
chunkingStrategy: "by_title",
combineUnderNChars: 500,
encoding: "utf-8",
files: {
content: "+WmI5Q)|yy" as bytes <<<>>>,
files: "string",
},
gzUncompressedContentType: "application/pdf",
hiResModelName: "yolox",
languages: [
"[",
"e",
"n",
"g",
"]",
],
newAfterNChars: 1500,
outputFormat: "application/json",
skipInferTableTypes: [
"p",
"d",
"f",
],
strategy: "hi_res",
});
if (res.statusCode == 200) {
// handle response
}
})();
```


## Override Server URL Per-Client

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:


```typescript
import { UnstructuredClient } from "unstructured-client";
(async() => {
const sdk = new UnstructuredClient({
security: {
apiKeyAuth: "YOUR_API_KEY",
},
serverURL: "https://api.unstructured.io",
});
const res = await sdk.general.partition({
chunkingStrategy: "by_title",
combineUnderNChars: 500,
encoding: "utf-8",
files: {
content: "+WmI5Q)|yy" as bytes <<<>>>,
files: "string",
},
gzUncompressedContentType: "application/pdf",
hiResModelName: "yolox",
languages: [
"[",
"e",
"n",
"g",
"]",
],
newAfterNChars: 1500,
outputFormat: "application/json",
skipInferTableTypes: [
"p",
"d",
"f",
],
strategy: "hi_res",
});
if (res.statusCode == 200) {
// handle response
}
})();
```
<!-- End Server Selection -->


<!-- No Error Handling -->
<!-- No Server Selection -->

<!-- Start Custom HTTP Client -->
# Custom HTTP Client
Expand Down

0 comments on commit 11068a9

Please sign in to comment.