Skip to content

Commit 390038d

Browse files
committed
local regen of client based on expected openapi spec
1 parent 911138c commit 390038d

File tree

10 files changed

+51
-13
lines changed

10 files changed

+51
-13
lines changed

.speakeasy/gen.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: b1c17258d127ea2ce7e4bfa09a8eb004
5-
docVersion: 1.0.51
4+
docChecksum: 80b2dc9fb0c56267e34c1679522a1794
5+
docVersion: 1.0.52
66
speakeasyVersion: 1.421.0
77
generationVersion: 2.438.15
8-
releaseVersion: 0.26.2
9-
configChecksum: c46fa7f108a08d4565530aa29da677b5
8+
releaseVersion: 0.27.0
9+
configChecksum: 6ece96f34cb076ad455a9c66b68c30b0
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1313
published: true
1414
features:
1515
python:
16+
acceptHeaders: 3.0.0
1617
additionalDependencies: 1.0.0
1718
constsAndDefaults: 1.0.4
1819
core: 5.6.1
@@ -107,6 +108,7 @@ examples:
107108
responses:
108109
"200":
109110
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}]
111+
text/csv: "<value>"
110112
"422":
111113
application/json: {"detail": []}
112114
5XX:

docs/models/operations/partitionresponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
99
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
1010
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
11+
| `csv_elements` | *Optional[str]* | :heavy_minus_sign: | Successful Response |
1112
| `elements` | List[Dict[str, *Any*]] | :heavy_minus_sign: | Successful Response |

docs/models/shared/strategy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto.
1010
| `FAST` | fast |
1111
| `HI_RES` | hi_res |
1212
| `AUTO` | auto |
13-
| `OCR_ONLY` | ocr_only |
13+
| `OCR_ONLY` | ocr_only |
14+
| `OD_ONLY` | od_only |

gen.yaml

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

pyproject.toml

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

src/unstructured_client/_version.py

Lines changed: 1 addition & 1 deletion
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.2"
6+
__version__: str = "0.27.0"
77

88
try:
99
if __package__ is not None:

src/unstructured_client/general.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
22

33
from .basesdk import BaseSDK
4+
from enum import Enum
45
from typing import Any, Dict, List, Optional, Union, cast
56
from unstructured_client import utils
67
from unstructured_client._hooks import HookContext
78
from unstructured_client.models import errors, operations, shared
89
from unstructured_client.types import BaseModel, OptionalNullable, UNSET
910

1011

12+
class PartitionAcceptEnum(str, Enum):
13+
APPLICATION_JSON = "application/json"
14+
TEXT_CSV = "text/csv"
15+
16+
1117
class General(BaseSDK):
1218
def partition(
1319
self,
@@ -18,6 +24,7 @@ def partition(
1824
retries: OptionalNullable[utils.RetryConfig] = UNSET,
1925
server_url: Optional[str] = None,
2026
timeout_ms: Optional[int] = None,
27+
accept_header_override: Optional[PartitionAcceptEnum] = None,
2128
) -> operations.PartitionResponse:
2229
r"""Summary
2330
@@ -27,6 +34,7 @@ def partition(
2734
:param retries: Override the default retry configuration for this method
2835
:param server_url: Override the default server URL for this method
2936
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
37+
:param accept_header_override: Override the default accept header for this method
3038
"""
3139
base_url = None
3240
url_variables = None
@@ -50,7 +58,9 @@ def partition(
5058
request_has_path_params=False,
5159
request_has_query_params=True,
5260
user_agent_header="user-agent",
53-
accept_header_value="application/json",
61+
accept_header_value=accept_header_override.value
62+
if accept_header_override is not None
63+
else "application/json;q=1, text/csv;q=0",
5464
security=self.sdk_configuration.security,
5565
get_serialized_body=lambda: utils.serialize_request_body(
5666
request.partition_parameters,
@@ -95,6 +105,13 @@ def partition(
95105
content_type=http_res.headers.get("Content-Type") or "",
96106
raw_response=http_res,
97107
)
108+
if utils.match_response(http_res, "200", "text/csv"):
109+
return operations.PartitionResponse(
110+
csv_elements=http_res.text,
111+
status_code=http_res.status_code,
112+
content_type=http_res.headers.get("Content-Type") or "",
113+
raw_response=http_res,
114+
)
98115
if utils.match_response(http_res, "422", "application/json"):
99116
data = utils.unmarshal_json(http_res.text, errors.HTTPValidationErrorData)
100117
raise errors.HTTPValidationError(data=data)
@@ -125,6 +142,7 @@ async def partition_async(
125142
retries: OptionalNullable[utils.RetryConfig] = UNSET,
126143
server_url: Optional[str] = None,
127144
timeout_ms: Optional[int] = None,
145+
accept_header_override: Optional[PartitionAcceptEnum] = None,
128146
) -> operations.PartitionResponse:
129147
r"""Summary
130148
@@ -134,6 +152,7 @@ async def partition_async(
134152
:param retries: Override the default retry configuration for this method
135153
:param server_url: Override the default server URL for this method
136154
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
155+
:param accept_header_override: Override the default accept header for this method
137156
"""
138157
base_url = None
139158
url_variables = None
@@ -157,7 +176,9 @@ async def partition_async(
157176
request_has_path_params=False,
158177
request_has_query_params=True,
159178
user_agent_header="user-agent",
160-
accept_header_value="application/json",
179+
accept_header_value=accept_header_override.value
180+
if accept_header_override is not None
181+
else "application/json;q=1, text/csv;q=0",
161182
security=self.sdk_configuration.security,
162183
get_serialized_body=lambda: utils.serialize_request_body(
163184
request.partition_parameters,
@@ -202,6 +223,13 @@ async def partition_async(
202223
content_type=http_res.headers.get("Content-Type") or "",
203224
raw_response=http_res,
204225
)
226+
if utils.match_response(http_res, "200", "text/csv"):
227+
return operations.PartitionResponse(
228+
csv_elements=http_res.text,
229+
status_code=http_res.status_code,
230+
content_type=http_res.headers.get("Content-Type") or "",
231+
raw_response=http_res,
232+
)
205233
if utils.match_response(http_res, "422", "application/json"):
206234
data = utils.unmarshal_json(http_res.text, errors.HTTPValidationErrorData)
207235
raise errors.HTTPValidationError(data=data)

src/unstructured_client/models/operations/partition.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class PartitionResponseTypedDict(TypedDict):
7474
r"""HTTP response status code for this operation"""
7575
raw_response: httpx.Response
7676
r"""Raw HTTP response; suitable for custom response parsing"""
77+
csv_elements: NotRequired[str]
78+
r"""Successful Response"""
7779
elements: NotRequired[List[Dict[str, Any]]]
7880
r"""Successful Response"""
7981

@@ -88,5 +90,8 @@ class PartitionResponse(BaseModel):
8890
raw_response: httpx.Response
8991
r"""Raw HTTP response; suitable for custom response parsing"""
9092

93+
csv_elements: Optional[str] = None
94+
r"""Successful Response"""
95+
9196
elements: Optional[List[Dict[str, Any]]] = None
9297
r"""Successful Response"""

src/unstructured_client/models/shared/partition_parameters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class Strategy(str, Enum, metaclass=utils.OpenEnumMeta):
6767
HI_RES = "hi_res"
6868
AUTO = "auto"
6969
OCR_ONLY = "ocr_only"
70+
OD_ONLY = "od_only"
7071

7172

7273
class PartitionParametersTypedDict(TypedDict):

src/unstructured_client/sdkconfiguration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class SDKConfiguration:
3333
server_url: Optional[str] = ""
3434
server: Optional[str] = ""
3535
language: str = "python"
36-
openapi_doc_version: str = "1.0.51"
37-
sdk_version: str = "0.26.2"
36+
openapi_doc_version: str = "1.0.52"
37+
sdk_version: str = "0.27.0"
3838
gen_version: str = "2.438.15"
39-
user_agent: str = "speakeasy-sdk/python 0.26.2 2.438.15 1.0.51 unstructured-client"
39+
user_agent: str = "speakeasy-sdk/python 0.27.0 2.438.15 1.0.52 unstructured-client"
4040
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
4141
timeout_ms: Optional[int] = None
4242

0 commit comments

Comments
 (0)