Skip to content

Commit dfe94fb

Browse files
committed
ci: regenerated with OpenAPI Doc 0.0.1, Speakeay CLI 1.109.0
1 parent 0c63972 commit dfe94fb

File tree

5 files changed

+210
-9
lines changed

5 files changed

+210
-9
lines changed

README.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,197 @@ s = unstructured_client.UnstructuredClient(
9696

9797
<!-- No Pagination -->
9898

99+
100+
101+
<!-- Start Error Handling -->
102+
# Error Handling
103+
104+
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.
105+
106+
107+
## Example
108+
109+
```python
110+
import unstructured_client
111+
from unstructured_client.models import shared
112+
113+
s = unstructured_client.UnstructuredClient(
114+
api_key_auth="YOUR_API_KEY",
115+
)
116+
117+
req = shared.PartitionParameters(
118+
chunking_strategy='by_title',
119+
combine_under_n_chars=500,
120+
encoding='utf-8',
121+
files=shared.PartitionParametersFiles(
122+
content='+WmI5Q)|yy'.encode(),
123+
files='string',
124+
),
125+
gz_uncompressed_content_type='application/pdf',
126+
hi_res_model_name='yolox',
127+
languages=[
128+
'[',
129+
'e',
130+
'n',
131+
'g',
132+
']',
133+
],
134+
new_after_n_chars=1500,
135+
output_format='application/json',
136+
skip_infer_table_types=[
137+
'p',
138+
'd',
139+
'f',
140+
],
141+
strategy='hi_res',
142+
)
143+
144+
res = None
145+
try:
146+
res = s.general.partition(req)
147+
148+
except (HTTPValidationError) as e:
149+
print(e) # handle exception
150+
151+
152+
if res.elements is not None:
153+
# handle response
154+
pass
155+
```
156+
<!-- End Error Handling -->
157+
158+
159+
160+
<!-- Start Server Selection -->
161+
# Server Selection
162+
163+
## Select Server by Name
164+
165+
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:
166+
167+
| Name | Server | Variables |
168+
| ----- | ------ | --------- |
169+
| `prod` | `https://api.unstructured.io` | None |
170+
| `local` | `http://localhost:8000` | None |
171+
172+
For example:
173+
174+
175+
```python
176+
import unstructured_client
177+
from unstructured_client.models import shared
178+
179+
s = unstructured_client.UnstructuredClient(
180+
api_key_auth="YOUR_API_KEY",
181+
server="local"
182+
)
183+
184+
req = shared.PartitionParameters(
185+
chunking_strategy='by_title',
186+
combine_under_n_chars=500,
187+
encoding='utf-8',
188+
files=shared.PartitionParametersFiles(
189+
content='+WmI5Q)|yy'.encode(),
190+
files='string',
191+
),
192+
gz_uncompressed_content_type='application/pdf',
193+
hi_res_model_name='yolox',
194+
languages=[
195+
'[',
196+
'e',
197+
'n',
198+
'g',
199+
']',
200+
],
201+
new_after_n_chars=1500,
202+
output_format='application/json',
203+
skip_infer_table_types=[
204+
'p',
205+
'd',
206+
'f',
207+
],
208+
strategy='hi_res',
209+
)
210+
211+
res = s.general.partition(req)
212+
213+
if res.elements is not None:
214+
# handle response
215+
pass
216+
```
217+
218+
219+
## Override Server URL Per-Client
220+
221+
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:
222+
223+
224+
```python
225+
import unstructured_client
226+
from unstructured_client.models import shared
227+
228+
s = unstructured_client.UnstructuredClient(
229+
api_key_auth="YOUR_API_KEY",
230+
server_url="https://api.unstructured.io"
231+
)
232+
233+
req = shared.PartitionParameters(
234+
chunking_strategy='by_title',
235+
combine_under_n_chars=500,
236+
encoding='utf-8',
237+
files=shared.PartitionParametersFiles(
238+
content='+WmI5Q)|yy'.encode(),
239+
files='string',
240+
),
241+
gz_uncompressed_content_type='application/pdf',
242+
hi_res_model_name='yolox',
243+
languages=[
244+
'[',
245+
'e',
246+
'n',
247+
'g',
248+
']',
249+
],
250+
new_after_n_chars=1500,
251+
output_format='application/json',
252+
skip_infer_table_types=[
253+
'p',
254+
'd',
255+
'f',
256+
],
257+
strategy='hi_res',
258+
)
259+
260+
res = s.general.partition(req)
261+
262+
if res.elements is not None:
263+
# handle response
264+
pass
265+
```
266+
<!-- End Server Selection -->
267+
268+
269+
270+
<!-- Start Custom HTTP Client -->
271+
# Custom HTTP Client
272+
273+
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.
274+
275+
276+
For example, you could specify a header for every request that your sdk makes as follows:
277+
278+
```python
279+
import unstructured_client
280+
import requests
281+
282+
http_client = requests.Session()
283+
http_client.headers.update({'x-custom-header': 'someValue'})
284+
s = unstructured_client.UnstructuredClient(client: http_client)
285+
```
286+
287+
288+
<!-- End Custom HTTP Client -->
289+
99290
<!-- Placeholder for Future Speakeasy SDK Sections -->
100291

101292
### Maturity

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,14 @@ Based on:
214214
### Generated
215215
- [python v0.12.0] .
216216
### Releases
217-
- [PyPI v0.12.0] https://pypi.org/project/unstructured-client/0.12.0 - .
217+
- [PyPI v0.12.0] https://pypi.org/project/unstructured-client/0.12.0 - .
218+
219+
## 2023-10-28 00:17:22
220+
### Changes
221+
Based on:
222+
- OpenAPI Doc 0.0.1
223+
- Speakeasy CLI 1.109.0 (2.173.0) https://github.com/speakeasy-api/speakeasy
224+
### Generated
225+
- [python v0.12.1] .
226+
### Releases
227+
- [PyPI v0.12.1] https://pypi.org/project/unstructured-client/0.12.1 - .

gen.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ configVersion: 1.0.0
22
management:
33
docChecksum: 25324f1821b1070aa4a416ec8ddca590
44
docVersion: 0.0.1
5-
speakeasyVersion: 1.104.0
6-
generationVersion: 2.169.0
5+
speakeasyVersion: 1.109.0
6+
generationVersion: 2.173.0
77
generation:
88
comments:
99
disableComments: false
@@ -15,15 +15,15 @@ generation:
1515
tagNamespacingDisabled: false
1616
features:
1717
python:
18-
core: 3.3.0
18+
core: 3.3.1
1919
examples: 2.81.3
2020
globalSecurity: 2.82.0
2121
globalServerURLs: 2.82.0
2222
nameOverrides: 2.81.1
2323
retries: 2.82.0
2424
serverIDs: 2.81.1
2525
python:
26-
version: 0.12.0
26+
version: 0.12.1
2727
author: Unstructured
2828
clientServerStatusCodesAsErrors: true
2929
description: Python Client SDK for Unstructured API

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="unstructured-client",
13-
version="0.12.0",
13+
version="0.12.1",
1414
author="Unstructured",
1515
description="Python Client SDK for Unstructured API",
1616
long_description=long_description,

src/unstructured_client/sdkconfiguration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class SDKConfiguration:
2626
server: str = ''
2727
language: str = 'python'
2828
openapi_doc_version: str = '0.0.1'
29-
sdk_version: str = '0.12.0'
30-
gen_version: str = '2.169.0'
31-
user_agent: str = 'speakeasy-sdk/python 0.12.0 2.169.0 0.0.1 unstructured-client'
29+
sdk_version: str = '0.12.1'
30+
gen_version: str = '2.173.0'
31+
user_agent: str = 'speakeasy-sdk/python 0.12.1 2.173.0 0.0.1 unstructured-client'
3232
retry_config: RetryConfig = None
3333

3434
def get_server_details(self) -> Tuple[str, Dict[str, str]]:

0 commit comments

Comments
 (0)