Skip to content

Commit c4602c4

Browse files
committed
Regenerate on latest API spec
1 parent 7f75744 commit c4602c4

File tree

10 files changed

+29
-20
lines changed

10 files changed

+29
-20
lines changed

.speakeasy/gen.lock

Lines changed: 4 additions & 4 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: c20db13bfb07ee6d97a80d72980a238c
5-
docVersion: 1.0.41
4+
docChecksum: 450837a4834b835d4eca4335d5b85dc2
5+
docVersion: 1.0.44
66
speakeasyVersion: 1.346.0
77
generationVersion: 2.379.3
8-
releaseVersion: 0.25.0
9-
configChecksum: 7d86c81e5c2aaef79b43b261bbdf9035
8+
releaseVersion: 0.25.1
9+
configChecksum: 49efc6eec9f55ed1900337179c42d679
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git

docs/models/shared/partitionparameters.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| `files` | [shared.Files](../../models/shared/files.md) | :heavy_check_mark: | The file to extract | |
99
| `chunking_strategy` | [OptionalNullable[shared.ChunkingStrategy]](../../models/shared/chunkingstrategy.md) | :heavy_minus_sign: | Use one of the supported strategies to chunk the returned elements after partitioning. When 'chunking_strategy' is not specified, no chunking is performed and any other chunking parameters provided are ignored. Supported strategies: 'basic', 'by_page', 'by_similarity', or 'by_title' | by_title |
1010
| `combine_under_n_chars` | *OptionalNullable[int]* | :heavy_minus_sign: | If chunking strategy is set, combine elements until a section reaches a length of n chars. Default: 500 | |
11+
| `content_type` | *OptionalNullable[str]* | :heavy_minus_sign: | A hint about the content type to use (such as text/markdown), when there are problems processing a specific file. This value is a MIME type in the format type/subtype. | |
1112
| `coordinates` | *Optional[bool]* | :heavy_minus_sign: | If `True`, return coordinates for each element extracted via OCR. Default: `False` | |
1213
| `encoding` | *OptionalNullable[str]* | :heavy_minus_sign: | The encoding method used to decode the text input. Default: utf-8 | |
1314
| `extract_image_block_types` | List[*str*] | :heavy_minus_sign: | The types of elements to extract, for use in extracting image blocks as base64 encoded data stored in metadata fields. | |

docs/models/shared/security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
| Field | Type | Required | Description | Example |
77
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
8-
| `api_key_auth` | *str* | :heavy_check_mark: | N/A | YOUR_API_KEY |
8+
| `api_key_auth` | *Optional[str]* | :heavy_minus_sign: | N/A | YOUR_API_KEY |

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.25.0
13+
version: 0.25.1
1414
additionalDependencies:
1515
dev: {}
1616
main:

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.25.0"
3+
version = "0.25.1"
44
description = "Python Client SDK for Unstructured API"
55
authors = ["Unstructured",]
66
readme = "README.md"

src/unstructured_client/general.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def partition(
6363
retry_config = None
6464
if isinstance(retries, utils.RetryConfig):
6565
retry_config = (retries, [
66-
"5xx"
66+
"502",
67+
"503",
68+
"504"
6769
])
6870

6971
http_res = self.do_request(
@@ -143,7 +145,9 @@ async def partition_async(
143145
retry_config = None
144146
if isinstance(retries, utils.RetryConfig):
145147
retry_config = (retries, [
146-
"5xx"
148+
"502",
149+
"503",
150+
"504"
147151
])
148152

149153
http_res = await self.do_request_async(

src/unstructured_client/models/shared/partition_parameters.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class PartitionParametersTypedDict(TypedDict):
5050
r"""Use one of the supported strategies to chunk the returned elements after partitioning. When 'chunking_strategy' is not specified, no chunking is performed and any other chunking parameters provided are ignored. Supported strategies: 'basic', 'by_page', 'by_similarity', or 'by_title'"""
5151
combine_under_n_chars: NotRequired[Nullable[int]]
5252
r"""If chunking strategy is set, combine elements until a section reaches a length of n chars. Default: 500"""
53+
content_type: NotRequired[Nullable[str]]
54+
r"""A hint about the content type to use (such as text/markdown), when there are problems processing a specific file. This value is a MIME type in the format type/subtype."""
5355
coordinates: NotRequired[bool]
5456
r"""If `True`, return coordinates for each element extracted via OCR. Default: `False`"""
5557
encoding: NotRequired[Nullable[str]]
@@ -109,6 +111,8 @@ class PartitionParameters(BaseModel):
109111
r"""Use one of the supported strategies to chunk the returned elements after partitioning. When 'chunking_strategy' is not specified, no chunking is performed and any other chunking parameters provided are ignored. Supported strategies: 'basic', 'by_page', 'by_similarity', or 'by_title'"""
110112
combine_under_n_chars: Annotated[OptionalNullable[int], FieldMetadata(multipart=True)] = None
111113
r"""If chunking strategy is set, combine elements until a section reaches a length of n chars. Default: 500"""
114+
content_type: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = None
115+
r"""A hint about the content type to use (such as text/markdown), when there are problems processing a specific file. This value is a MIME type in the format type/subtype."""
112116
coordinates: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False
113117
r"""If `True`, return coordinates for each element extracted via OCR. Default: `False`"""
114118
encoding: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = None
@@ -162,9 +166,9 @@ class PartitionParameters(BaseModel):
162166

163167
@model_serializer(mode="wrap")
164168
def serialize_model(self, handler):
165-
optional_fields = ["chunking_strategy", "combine_under_n_chars", "coordinates", "encoding", "extract_image_block_types", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "include_page_breaks", "languages", "max_characters", "multipage_sections", "new_after_n_chars", "ocr_languages", "output_format", "overlap", "overlap_all", "pdf_infer_table_structure", "similarity_threshold", "skip_infer_table_types", "split_pdf_concurrency_level", "split_pdf_page", "split_pdf_page_range", "starting_page_number", "strategy", "unique_element_ids", "xml_keep_tags"]
166-
nullable_fields = ["chunking_strategy", "combine_under_n_chars", "encoding", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "max_characters", "new_after_n_chars", "similarity_threshold", "starting_page_number"]
167-
null_default_fields = ["chunking_strategy", "combine_under_n_chars", "encoding", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "max_characters", "new_after_n_chars", "similarity_threshold", "starting_page_number"]
169+
optional_fields = ["chunking_strategy", "combine_under_n_chars", "content_type", "coordinates", "encoding", "extract_image_block_types", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "include_page_breaks", "languages", "max_characters", "multipage_sections", "new_after_n_chars", "ocr_languages", "output_format", "overlap", "overlap_all", "pdf_infer_table_structure", "similarity_threshold", "skip_infer_table_types", "split_pdf_concurrency_level", "split_pdf_page", "split_pdf_page_range", "starting_page_number", "strategy", "unique_element_ids", "xml_keep_tags"]
170+
nullable_fields = ["chunking_strategy", "combine_under_n_chars", "content_type", "encoding", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "max_characters", "new_after_n_chars", "similarity_threshold", "starting_page_number"]
171+
null_default_fields = ["chunking_strategy", "combine_under_n_chars", "content_type", "encoding", "gz_uncompressed_content_type", "hi_res_model_name", "include_orig_elements", "max_characters", "new_after_n_chars", "similarity_threshold", "starting_page_number"]
168172

169173
serialized = handler(self)
170174

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

33
from __future__ import annotations
4-
from typing import TypedDict
5-
from typing_extensions import Annotated
4+
from typing import Optional, TypedDict
5+
from typing_extensions import Annotated, NotRequired
66
from unstructured_client.types import BaseModel
77
from unstructured_client.utils import FieldMetadata, SecurityMetadata
88

99

1010
class SecurityTypedDict(TypedDict):
11-
api_key_auth: str
11+
api_key_auth: NotRequired[str]
1212

1313

1414
class Security(BaseModel):
15-
api_key_auth: Annotated[str, FieldMetadata(security=SecurityMetadata(scheme=True, scheme_type="apiKey", sub_type="header", field_name="unstructured-api-key"))]
15+
api_key_auth: Annotated[Optional[str], FieldMetadata(security=SecurityMetadata(scheme=True, scheme_type="apiKey", sub_type="header", field_name="unstructured-api-key"))] = None
1616

src/unstructured_client/sdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class UnstructuredClient(BaseSDK):
1616
general: General
1717
def __init__(
1818
self,
19-
api_key_auth: Union[str, Callable[[], str]],
19+
api_key_auth: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None,
2020
server: Optional[str] = None,
2121
server_url: Optional[str] = None,
2222
url_params: Optional[Dict[str, str]] = None,

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.41"
37-
sdk_version: str = "0.25.0"
36+
openapi_doc_version: str = "1.0.44"
37+
sdk_version: str = "0.25.1"
3838
gen_version: str = "2.379.3"
39-
user_agent: str = "speakeasy-sdk/python 0.25.0 2.379.3 1.0.41 unstructured-client"
39+
user_agent: str = "speakeasy-sdk/python 0.25.1 2.379.3 1.0.44 unstructured-client"
4040
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
4141
timeout_ms: Optional[int] = None
4242

0 commit comments

Comments
 (0)