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 dfe94fb commit f069aa1
Showing 1 changed file with 3 additions and 168 deletions.
171 changes: 3 additions & 168 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,181 +95,16 @@ s = unstructured_client.UnstructuredClient(
<!-- No SDK Available Operations -->

<!-- No Pagination -->
<!-- No Error Handling -->



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

Handling errors in your SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.


## Example

```python
import unstructured_client
from unstructured_client.models import shared

s = unstructured_client.UnstructuredClient(
api_key_auth="YOUR_API_KEY",
)

req = shared.PartitionParameters(
chunking_strategy='by_title',
combine_under_n_chars=500,
encoding='utf-8',
files=shared.PartitionParametersFiles(
content='+WmI5Q)|yy'.encode(),
files='string',
),
gz_uncompressed_content_type='application/pdf',
hi_res_model_name='yolox',
languages=[
'[',
'e',
'n',
'g',
']',
],
new_after_n_chars=1500,
output_format='application/json',
skip_infer_table_types=[
'p',
'd',
'f',
],
strategy='hi_res',
)

res = None
try:
res = s.general.partition(req)

except (HTTPValidationError) as e:
print(e) # handle exception


if res.elements is not None:
# handle response
pass
```
<!-- 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: str` 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:


```python
import unstructured_client
from unstructured_client.models import shared

s = unstructured_client.UnstructuredClient(
api_key_auth="YOUR_API_KEY",
server="local"
)

req = shared.PartitionParameters(
chunking_strategy='by_title',
combine_under_n_chars=500,
encoding='utf-8',
files=shared.PartitionParametersFiles(
content='+WmI5Q)|yy'.encode(),
files='string',
),
gz_uncompressed_content_type='application/pdf',
hi_res_model_name='yolox',
languages=[
'[',
'e',
'n',
'g',
']',
],
new_after_n_chars=1500,
output_format='application/json',
skip_infer_table_types=[
'p',
'd',
'f',
],
strategy='hi_res',
)

res = s.general.partition(req)

if res.elements is not None:
# handle response
pass
```


## Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:


```python
import unstructured_client
from unstructured_client.models import shared

s = unstructured_client.UnstructuredClient(
api_key_auth="YOUR_API_KEY",
server_url="https://api.unstructured.io"
)

req = shared.PartitionParameters(
chunking_strategy='by_title',
combine_under_n_chars=500,
encoding='utf-8',
files=shared.PartitionParametersFiles(
content='+WmI5Q)|yy'.encode(),
files='string',
),
gz_uncompressed_content_type='application/pdf',
hi_res_model_name='yolox',
languages=[
'[',
'e',
'n',
'g',
']',
],
new_after_n_chars=1500,
output_format='application/json',
skip_infer_table_types=[
'p',
'd',
'f',
],
strategy='hi_res',
)

res = s.general.partition(req)

if res.elements is not None:
# handle response
pass
```
<!-- End Server Selection -->


<!-- No Server Selection -->

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

The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.


Expand Down

0 comments on commit f069aa1

Please sign in to comment.