Skip to content

Commit 99c6385

Browse files
chore: 🐝 Update SDK - Generate 0.26.2 (#199)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/linting-report/9c325105dfa290a8755df12c901712d0> > OpenAPI Change report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/changes-report/09e885b005e165e9aa40a7d4a7b03a69> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.422.1 (2.438.15) https://github.com/speakeasy-api/speakeasy ## OpenAPI Change Summary No specification changes Co-authored-by: speakeasybot <[email protected]>
1 parent 4d07f22 commit 99c6385

File tree

10 files changed

+50
-18
lines changed

10 files changed

+50
-18
lines changed

Diff for: .speakeasy/gen.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
44
docChecksum: 21f469b38bb72725739ee9d9d0fc8780
55
docVersion: 1.0.51
6-
speakeasyVersion: 1.418.1
7-
generationVersion: 2.438.3
8-
releaseVersion: 0.26.1
9-
configChecksum: 55ded3ef4f1b052725cdab6587da0ea4
6+
speakeasyVersion: 1.422.1
7+
generationVersion: 2.438.15
8+
releaseVersion: 0.26.2
9+
configChecksum: c46fa7f108a08d4565530aa29da677b5
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git

Diff for: .speakeasy/workflow.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
speakeasyVersion: 1.418.1
1+
speakeasyVersion: 1.422.1
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:a820d523af3e56f0dd1fc84f4f29e15330edb26cc253e93981bddb4a5176ac3c
5+
sourceRevisionDigest: sha256:31c94056ebc941cdfcf3fd4ba5e04880e978740963f7ce79169ba66cd033d74d
66
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
77
tags:
88
- latest
@@ -11,7 +11,7 @@ targets:
1111
unstructured-python:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:a820d523af3e56f0dd1fc84f4f29e15330edb26cc253e93981bddb4a5176ac3c
14+
sourceRevisionDigest: sha256:31c94056ebc941cdfcf3fd4ba5e04880e978740963f7ce79169ba66cd033d74d
1515
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
1616
workflow:
1717
workflowVersion: 1.0.0

Diff for: RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -704,4 +704,14 @@ Based on:
704704
### Generated
705705
- [python v0.26.1] .
706706
### Releases
707-
- [PyPI v0.26.1] https://pypi.org/project/unstructured-client/0.26.1 - .
707+
- [PyPI v0.26.1] https://pypi.org/project/unstructured-client/0.26.1 - .
708+
709+
## 2024-10-28 00:09:56
710+
### Changes
711+
Based on:
712+
- OpenAPI Doc
713+
- Speakeasy CLI 1.422.1 (2.438.15) https://github.com/speakeasy-api/speakeasy
714+
### Generated
715+
- [python v0.26.2] .
716+
### Releases
717+
- [PyPI v0.26.2] https://pypi.org/project/unstructured-client/0.26.2 - .

Diff for: gen.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ generation:
1010
auth:
1111
oAuth2ClientCredentialsEnabled: false
1212
python:
13-
version: 0.26.1
13+
version: 0.26.2
1414
additionalDependencies:
1515
dev:
1616
deepdiff: '>=6.0'

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "unstructured-client"
3-
version = "0.26.1"
3+
version = "0.26.2"
44
description = "Python Client SDK for Unstructured API"
55
authors = ["Unstructured",]
66
readme = "README-PYPI.md"

Diff for: src/unstructured_client/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import importlib.metadata
44

55
__title__: str = "unstructured-client"
6-
__version__: str = "0.26.1"
6+
__version__: str = "0.26.2"
77

88
try:
99
if __package__ is not None:

Diff for: src/unstructured_client/general.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,20 @@ def partition(
9999
data = utils.unmarshal_json(http_res.text, errors.HTTPValidationErrorData)
100100
raise errors.HTTPValidationError(data=data)
101101
if utils.match_response(http_res, "4XX", "*"):
102+
http_res_text = utils.stream_to_text(http_res)
102103
raise errors.SDKError(
103-
"API error occurred", http_res.status_code, http_res.text, http_res
104+
"API error occurred", http_res.status_code, http_res_text, http_res
104105
)
105106
if utils.match_response(http_res, "5XX", "application/json"):
106107
data = utils.unmarshal_json(http_res.text, errors.ServerErrorData)
107108
raise errors.ServerError(data=data)
108109

109110
content_type = http_res.headers.get("Content-Type")
111+
http_res_text = utils.stream_to_text(http_res)
110112
raise errors.SDKError(
111113
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
112114
http_res.status_code,
113-
http_res.text,
115+
http_res_text,
114116
http_res,
115117
)
116118

@@ -204,17 +206,19 @@ async def partition_async(
204206
data = utils.unmarshal_json(http_res.text, errors.HTTPValidationErrorData)
205207
raise errors.HTTPValidationError(data=data)
206208
if utils.match_response(http_res, "4XX", "*"):
209+
http_res_text = await utils.stream_to_text_async(http_res)
207210
raise errors.SDKError(
208-
"API error occurred", http_res.status_code, http_res.text, http_res
211+
"API error occurred", http_res.status_code, http_res_text, http_res
209212
)
210213
if utils.match_response(http_res, "5XX", "application/json"):
211214
data = utils.unmarshal_json(http_res.text, errors.ServerErrorData)
212215
raise errors.ServerError(data=data)
213216

214217
content_type = http_res.headers.get("Content-Type")
218+
http_res_text = await utils.stream_to_text_async(http_res)
215219
raise errors.SDKError(
216220
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
217221
http_res.status_code,
218-
http_res.text,
222+
http_res_text,
219223
http_res,
220224
)

Diff for: src/unstructured_client/sdkconfiguration.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class SDKConfiguration:
3434
server: Optional[str] = ""
3535
language: str = "python"
3636
openapi_doc_version: str = "1.0.51"
37-
sdk_version: str = "0.26.1"
38-
gen_version: str = "2.438.3"
39-
user_agent: str = "speakeasy-sdk/python 0.26.1 2.438.3 1.0.51 unstructured-client"
37+
sdk_version: str = "0.26.2"
38+
gen_version: str = "2.438.15"
39+
user_agent: str = "speakeasy-sdk/python 0.26.2 2.438.15 1.0.51 unstructured-client"
4040
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
4141
timeout_ms: Optional[int] = None
4242

Diff for: src/unstructured_client/utils/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
serialize_float,
2828
serialize_int,
2929
stream_to_text,
30+
stream_to_text_async,
31+
stream_to_bytes,
32+
stream_to_bytes_async,
3033
validate_const,
3134
validate_decimal,
3235
validate_float,
@@ -80,6 +83,9 @@
8083
"serialize_request_body",
8184
"SerializedRequestBody",
8285
"stream_to_text",
86+
"stream_to_text_async",
87+
"stream_to_bytes",
88+
"stream_to_bytes_async",
8389
"template_url",
8490
"unmarshal",
8591
"unmarshal_json",

Diff for: src/unstructured_client/utils/serializers.py

+12
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ def stream_to_text(stream: httpx.Response) -> str:
185185
return "".join(stream.iter_text())
186186

187187

188+
async def stream_to_text_async(stream: httpx.Response) -> str:
189+
return "".join([chunk async for chunk in stream.aiter_text()])
190+
191+
192+
def stream_to_bytes(stream: httpx.Response) -> bytes:
193+
return stream.content
194+
195+
196+
async def stream_to_bytes_async(stream: httpx.Response) -> bytes:
197+
return await stream.aread()
198+
199+
188200
def get_pydantic_model(data: Any, typ: Any) -> Any:
189201
if not _contains_pydantic_model(data):
190202
return unmarshal(data, typ)

0 commit comments

Comments
 (0)