Skip to content

Commit 3e2749a

Browse files
committed
Merge branch 'main' into NEXUS-703/remove-nestio-loop
2 parents 6491041 + ec4e3aa commit 3e2749a

File tree

83 files changed

+1365
-2003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1365
-2003
lines changed

.genignore

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ _test_unstructured_client
88
# ignore Makefile
99
Makefile
1010

11-
# Ignore the base resource classes while we're patching in our own server url logic
12-
# If we add a new endpoint, we need to:
13-
# - Comment out the ignore for the right file
11+
# Ignore general.py so we can patch in our partitioning url
12+
# If we ever have a new endpoint under /general, we need to:
13+
# - Comment out this ignore line
1414
# - Generate locally, watch the new endpoint appear
15+
# - Adjust the custom url snippets in the file
1516
# - Bring back the ignore line and commit
16-
src/unstructured_client/destinations.py
1717
src/unstructured_client/general.py
18-
src/unstructured_client/jobs.py
19-
src/unstructured_client/sources.py
20-
src/unstructured_client/workflows.py

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,5 @@ A clear and concise description of what you expected to happen.
1919
**Screenshots**
2020
If applicable, add screenshots to help explain your problem.
2121

22-
**Environment Info**
23-
Please run `python scripts/collect_env.py` and paste the output here.
24-
This will help us understand more about the environment in which the bug occurred.
25-
2622
**Additional context**
2723
Add any other context about the problem here.

.speakeasy/gen.lock

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: 3e52fdac3e417f8e48fcb920b829025c
5-
docVersion: 1.1.34
6-
speakeasyVersion: 1.552.0
7-
generationVersion: 2.610.0
8-
releaseVersion: 0.39.1
9-
configChecksum: 2b0094ee827eb2deb71ef0ff9e572192
4+
docChecksum: ae9cd2cec2edbde7b002c0a127c7aa84
5+
docVersion: 1.1.42
6+
speakeasyVersion: 1.589.0
7+
generationVersion: 2.664.0
8+
releaseVersion: 0.41.0
9+
configChecksum: b2d39b13446f595978a73e31a796dbe7
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
@@ -16,30 +16,28 @@ features:
1616
acceptHeaders: 3.0.0
1717
additionalDependencies: 1.0.0
1818
constsAndDefaults: 1.0.5
19-
core: 5.19.0
19+
core: 5.19.4
2020
customCodeRegions: 0.1.1
2121
defaultEnabledRetries: 0.2.0
2222
enumUnions: 0.1.0
2323
envVarSecurityUsage: 0.3.2
24-
examples: 3.0.1
24+
examples: 3.0.2
2525
globalSecurity: 3.0.3
2626
globalSecurityCallbacks: 1.0.0
2727
globalSecurityFlattening: 1.0.0
2828
globalServerURLs: 3.1.1
29-
methodServerURLs: 3.1.1
3029
multipartFileContentType: 1.0.0
3130
nameOverrides: 3.0.1
3231
nullables: 1.0.1
3332
openEnums: 1.0.1
3433
responseFormat: 1.0.1
3534
retries: 3.0.2
36-
sdkHooks: 1.0.1
35+
sdkHooks: 1.1.0
3736
serverIDs: 3.0.0
3837
unions: 3.0.4
3938
uploadStreams: 1.0.0
4039
generatedFiles:
4140
- .gitattributes
42-
- .python-version
4341
- .vscode/settings.json
4442
- USAGE.md
4543
- docs/models/errors/detail.md
@@ -71,6 +69,8 @@ generatedFiles:
7169
- docs/models/operations/getconnectionchecksourcesresponse.md
7270
- docs/models/operations/getdestinationrequest.md
7371
- docs/models/operations/getdestinationresponse.md
72+
- docs/models/operations/getencryptioncertificaterequest.md
73+
- docs/models/operations/getencryptioncertificateresponse.md
7474
- docs/models/operations/getjobdetailsrequest.md
7575
- docs/models/operations/getjobdetailsresponse.md
7676
- docs/models/operations/getjobfailedfilesrequest.md
@@ -91,8 +91,6 @@ generatedFiles:
9191
- docs/models/operations/listworkflowsresponse.md
9292
- docs/models/operations/partitionrequest.md
9393
- docs/models/operations/partitionresponse.md
94-
- docs/models/operations/retrieverequest.md
95-
- docs/models/operations/retrieveresponse.md
9694
- docs/models/operations/runworkflowrequest.md
9795
- docs/models/operations/runworkflowresponse.md
9896
- docs/models/operations/storesecretrequest.md
@@ -140,6 +138,7 @@ generatedFiles:
140138
- docs/models/shared/elasticsearchconnectorconfig.md
141139
- docs/models/shared/elasticsearchconnectorconfiginput.md
142140
- docs/models/shared/encryptedsecret.md
141+
- docs/models/shared/encryptioncertificateresponse.md
143142
- docs/models/shared/encryptiontype.md
144143
- docs/models/shared/failedfile.md
145144
- docs/models/shared/files.md
@@ -181,7 +180,6 @@ generatedFiles:
181180
- docs/models/shared/outlooksourceconnectorconfiginput.md
182181
- docs/models/shared/outputformat.md
183182
- docs/models/shared/partitionparameters.md
184-
- docs/models/shared/pemauthresponse.md
185183
- docs/models/shared/pineconedestinationconnectorconfig.md
186184
- docs/models/shared/pineconedestinationconnectorconfiginput.md
187185
- docs/models/shared/postgresdestinationconnectorconfig.md
@@ -252,12 +250,17 @@ generatedFiles:
252250
- src/unstructured_client/_hooks/types.py
253251
- src/unstructured_client/_version.py
254252
- src/unstructured_client/basesdk.py
253+
- src/unstructured_client/destinations.py
255254
- src/unstructured_client/httpclient.py
255+
- src/unstructured_client/jobs.py
256256
- src/unstructured_client/models/__init__.py
257257
- src/unstructured_client/models/errors/__init__.py
258258
- src/unstructured_client/models/errors/httpvalidationerror.py
259+
- src/unstructured_client/models/errors/no_response_error.py
260+
- src/unstructured_client/models/errors/responsevalidationerror.py
259261
- src/unstructured_client/models/errors/sdkerror.py
260262
- src/unstructured_client/models/errors/servererror.py
263+
- src/unstructured_client/models/errors/unstructuredclienterror.py
261264
- src/unstructured_client/models/operations/__init__.py
262265
- src/unstructured_client/models/operations/cancel_job.py
263266
- src/unstructured_client/models/operations/create_connection_check_destinations.py
@@ -272,6 +275,7 @@ generatedFiles:
272275
- src/unstructured_client/models/operations/get_connection_check_destinations.py
273276
- src/unstructured_client/models/operations/get_connection_check_sources.py
274277
- src/unstructured_client/models/operations/get_destination.py
278+
- src/unstructured_client/models/operations/get_encryption_certificate.py
275279
- src/unstructured_client/models/operations/get_job.py
276280
- src/unstructured_client/models/operations/get_job_details.py
277281
- src/unstructured_client/models/operations/get_job_failed_files.py
@@ -282,7 +286,6 @@ generatedFiles:
282286
- src/unstructured_client/models/operations/list_sources.py
283287
- src/unstructured_client/models/operations/list_workflows.py
284288
- src/unstructured_client/models/operations/partition.py
285-
- src/unstructured_client/models/operations/retrieve.py
286289
- src/unstructured_client/models/operations/run_workflow.py
287290
- src/unstructured_client/models/operations/store_secret.py
288291
- src/unstructured_client/models/operations/update_destination.py
@@ -323,6 +326,7 @@ generatedFiles:
323326
- src/unstructured_client/models/shared/elasticsearchconnectorconfig.py
324327
- src/unstructured_client/models/shared/elasticsearchconnectorconfiginput.py
325328
- src/unstructured_client/models/shared/encryptedsecret.py
329+
- src/unstructured_client/models/shared/encryptioncertificateresponse.py
326330
- src/unstructured_client/models/shared/encryptiontype.py
327331
- src/unstructured_client/models/shared/failedfile.py
328332
- src/unstructured_client/models/shared/gcsdestinationconnectorconfig.py
@@ -359,7 +363,6 @@ generatedFiles:
359363
- src/unstructured_client/models/shared/outlooksourceconnectorconfig.py
360364
- src/unstructured_client/models/shared/outlooksourceconnectorconfiginput.py
361365
- src/unstructured_client/models/shared/partition_parameters.py
362-
- src/unstructured_client/models/shared/pemauthresponse.py
363366
- src/unstructured_client/models/shared/pineconedestinationconnectorconfig.py
364367
- src/unstructured_client/models/shared/pineconedestinationconnectorconfiginput.py
365368
- src/unstructured_client/models/shared/postgresdestinationconnectorconfig.py
@@ -404,6 +407,7 @@ generatedFiles:
404407
- src/unstructured_client/py.typed
405408
- src/unstructured_client/sdk.py
406409
- src/unstructured_client/sdkconfiguration.py
410+
- src/unstructured_client/sources.py
407411
- src/unstructured_client/types/__init__.py
408412
- src/unstructured_client/types/basemodel.py
409413
- src/unstructured_client/users.py
@@ -421,8 +425,10 @@ generatedFiles:
421425
- src/unstructured_client/utils/retries.py
422426
- src/unstructured_client/utils/security.py
423427
- src/unstructured_client/utils/serializers.py
428+
- src/unstructured_client/utils/unmarshal_json_response.py
424429
- src/unstructured_client/utils/url.py
425430
- src/unstructured_client/utils/values.py
431+
- src/unstructured_client/workflows.py
426432
examples:
427433
create_connection_check_destinations:
428434
speakeasy-default-create-connection-check-destinations:
@@ -709,5 +715,12 @@ examples:
709715
application/json: {"id": "<id>"}
710716
"422":
711717
application/json: {"detail": []}
718+
get_encryption_certificate:
719+
speakeasy-default-get-encryption-certificate:
720+
responses:
721+
"200":
722+
application/json: {"ca_chain": "<value>", "encryption_certificate": "<value>"}
723+
"422":
724+
application/json: {"detail": []}
712725
examplesVersion: 1.0.2
713726
generatedTests: {}

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.552.0
1+
speakeasyVersion: 1.589.0
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:ac2955e4a812caa63ad339156504c9bdfae02dd241800a6c48892aaf37552c54
6-
sourceBlobDigest: sha256:eb516ced31caa9801a7996b8216fa7c7a46ab16dc9edd4d9eef5721cee7acd6c
5+
sourceRevisionDigest: sha256:dc1c7c974419187404b25cb443e0d2497aa8b3ab71c95f27054eb5cd87b02ed0
6+
sourceBlobDigest: sha256:538ee1e259eb1db25ba57b09ba271636bad0015a794517bf6f910315e7ecaac3
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1752365566
10-
- 1.1.34
9+
- speakeasy-sdk-regen-1753403247
10+
- 1.1.42
1111
targets:
1212
unstructured-python:
1313
source: my-source
1414
sourceNamespace: my-source
15-
sourceRevisionDigest: sha256:ac2955e4a812caa63ad339156504c9bdfae02dd241800a6c48892aaf37552c54
16-
sourceBlobDigest: sha256:eb516ced31caa9801a7996b8216fa7c7a46ab16dc9edd4d9eef5721cee7acd6c
15+
sourceRevisionDigest: sha256:dc1c7c974419187404b25cb443e0d2497aa8b3ab71c95f27054eb5cd87b02ed0
16+
sourceBlobDigest: sha256:538ee1e259eb1db25ba57b09ba271636bad0015a794517bf6f910315e7ecaac3
1717
codeSamplesNamespace: my-source-code-samples
18-
codeSamplesRevisionDigest: sha256:e644b82aab2fb0dc0c506d643aa22910ae14bc998f2b13ac7cc019a789dbe552
18+
codeSamplesRevisionDigest: sha256:1e8db4a01c54f1f99e27cc80d3f5283192aa2a6a68001f80424fbf9bdface495
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 0.41.0
2+
3+
### Enhancements
4+
5+
### Features
6+
* Provide a base `UnstructuredClientError` to capture every error raised by the SDK. Note that some exceptions such as `SDKError` now have more information in the `message` field. This will impact any users who rely on string matching in their error handling.
7+
8+
### Fixes
9+
110
## 0.37.3
211

312
### Enhancements

README.md

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -153,26 +153,18 @@ with UnstructuredClient(
153153
<!-- Start Error Handling [errors] -->
154154
## Error Handling
155155

156-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
156+
[`UnstructuredClientError`](./src/unstructured_client/models/errors/unstructuredclienterror.py) is the base class for all HTTP error responses. It has the following properties:
157157

158-
By default, an API error will raise a errors.SDKError exception, which has the following properties:
159-
160-
| Property | Type | Description |
161-
|-----------------|------------------|-----------------------|
162-
| `.status_code` | *int* | The HTTP status code |
163-
| `.message` | *str* | The error message |
164-
| `.raw_response` | *httpx.Response* | The raw HTTP response |
165-
| `.body` | *str* | The response content |
166-
167-
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_connection_check_destinations_async` method may raise the following exceptions:
168-
169-
| Error Type | Status Code | Content Type |
170-
| -------------------------- | ----------- | ---------------- |
171-
| errors.HTTPValidationError | 422 | application/json |
172-
| errors.SDKError | 4XX, 5XX | \*/\* |
158+
| Property | Type | Description |
159+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
160+
| `err.message` | `str` | Error message |
161+
| `err.status_code` | `int` | HTTP response status code eg `404` |
162+
| `err.headers` | `httpx.Headers` | HTTP response headers |
163+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
164+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
165+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
173166

174167
### Example
175-
176168
```python
177169
from unstructured_client import UnstructuredClient
178170
from unstructured_client.models import errors
@@ -191,13 +183,42 @@ with UnstructuredClient() as uc_client:
191183
# Handle response
192184
print(res.dag_node_connection_check)
193185

194-
except errors.HTTPValidationError as e:
195-
# handle e.data: errors.HTTPValidationErrorData
196-
raise(e)
197-
except errors.SDKError as e:
198-
# handle exception
199-
raise(e)
186+
187+
except errors.UnstructuredClientError as e:
188+
# The base class for HTTP error responses
189+
print(e.message)
190+
print(e.status_code)
191+
print(e.body)
192+
print(e.headers)
193+
print(e.raw_response)
194+
195+
# Depending on the method different errors may be thrown
196+
if isinstance(e, errors.HTTPValidationError):
197+
print(e.data.detail) # Optional[errors.Detail]
200198
```
199+
200+
### Error Classes
201+
**Primary errors:**
202+
* [`UnstructuredClientError`](./src/unstructured_client/models/errors/unstructuredclienterror.py): The base class for HTTP error responses.
203+
* [`HTTPValidationError`](./src/unstructured_client/models/errors/httpvalidationerror.py): Validation Error. Status code `422`.
204+
205+
<details><summary>Less common errors (6)</summary>
206+
207+
<br />
208+
209+
**Network errors:**
210+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
211+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
212+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
213+
214+
215+
**Inherit from [`UnstructuredClientError`](./src/unstructured_client/models/errors/unstructuredclienterror.py)**:
216+
* [`ServerError`](./src/unstructured_client/models/errors/servererror.py): Server Error. Status code `5XX`. Applicable to 1 of 29 methods.*
217+
* [`ResponseValidationError`](./src/unstructured_client/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
218+
219+
</details>
220+
221+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
201222
<!-- End Error Handling [errors] -->
202223

203224
<!-- Start Custom HTTP Client [http-client] -->
@@ -316,7 +337,7 @@ with UnstructuredClient() as uc_client:
316337

317338
</br>
318339

319-
The same SDK client can also be used to make asynchronous requests by importing asyncio.
340+
The same SDK client can also be used to make asychronous requests by importing asyncio.
320341
```python
321342
# Asynchronous Example
322343
import asyncio
@@ -410,30 +431,18 @@ Certain SDK methods accept file objects as part of a request body or multi-part
410431
411432
```python
412433
from unstructured_client import UnstructuredClient
413-
from unstructured_client.models import shared
414434

415435

416436
with UnstructuredClient() as uc_client:
417437

418-
res = uc_client.general.partition(request={
419-
"partition_parameters": {
420-
"files": {
421-
"content": open("example.file", "rb"),
422-
"file_name": "example.file",
423-
},
424-
"split_pdf_page_range": [
425-
1,
426-
10,
427-
],
428-
"vlm_model": shared.VLMModel.GPT_4O,
429-
"vlm_model_provider": shared.VLMModelProvider.OPENAI,
430-
},
438+
res = uc_client.workflows.run_workflow(request={
439+
"workflow_id": "e7054f23-ce92-4bf1-a1d7-7cf9cb14d013",
431440
})
432441

433-
assert res.elements is not None
442+
assert res.job_information is not None
434443

435444
# Handle response
436-
print(res.elements)
445+
print(res.job_information)
437446

438447
```
439448
<!-- End File uploads [file-upload] -->

RELEASES.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,4 +1058,25 @@ Based on:
10581058
### Generated
10591059
- [python v0.39.1] .
10601060
### Releases
1061-
- [PyPI v0.39.1] https://pypi.org/project/unstructured-client/0.39.1 - .
1061+
- [PyPI v0.39.1] https://pypi.org/project/unstructured-client/0.39.1 - .
1062+
1063+
## 2025-07-23 19:20:27
1064+
### Changes
1065+
Based on:
1066+
- OpenAPI Doc
1067+
- Speakeasy CLI 1.552.0 (2.610.0) https://github.com/speakeasy-api/speakeasy
1068+
### Generated
1069+
- [python v0.40.0] .
1070+
### Releases
1071+
- [PyPI v0.40.0] https://pypi.org/project/unstructured-client/0.40.0 - .
1072+
1073+
1074+
## 2025-07-25 00:27:12
1075+
### Changes
1076+
Based on:
1077+
- OpenAPI Doc
1078+
- Speakeasy CLI 1.589.0 (2.664.0) https://github.com/speakeasy-api/speakeasy
1079+
### Generated
1080+
- [python v0.41.0] .
1081+
### Releases
1082+
- [PyPI v0.41.0] https://pypi.org/project/unstructured-client/0.41.0 - .

0 commit comments

Comments
 (0)