Skip to content

Commit d8bda78

Browse files
update speakeasy
1 parent 9d28122 commit d8bda78

File tree

7 files changed

+75
-11
lines changed

7 files changed

+75
-11
lines changed

.speakeasy/gen.lock

Lines changed: 5 additions & 5 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: 8c3ba3d80aca4eb8e7b1d6bdcb158ef1
4+
docChecksum: 3a9a6dec47caf7b55eee42f76f6f40fb
55
docVersion: 1.0.30
6-
speakeasyVersion: 1.285.4
7-
generationVersion: 2.326.3
8-
releaseVersion: 0.25.2
9-
configChecksum: a76b1ee94ee258d031efbf84a8671247
6+
speakeasyVersion: 1.286.3
7+
generationVersion: 2.329.0
8+
releaseVersion: 0.26.0
9+
configChecksum: 6b09a51b36144398cdd3410d938f7d8c
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
@@ -27,6 +27,7 @@
2727
| `similarity_threshold` | *Optional[float]* | :heavy_minus_sign: | A value between 0.0 and 1.0 describing the minimum similarity two elements must have to be included in the same chunk. Note that similar elements may be separated to meet chunk-size criteria; this value can only guarantees that two elements with similarity below the threshold will appear in separate chunks. | |
2828
| `skip_infer_table_types` | List[*str*] | :heavy_minus_sign: | The document types that you want to skip table extraction with. Default: [] | |
2929
| `split_pdf_page` | *Optional[bool]* | :heavy_minus_sign: | Should the pdf file be split at client. Ignored on backend. | |
30+
| `split_pdf_threads` | *Optional[int]* | :heavy_minus_sign: | Number of threads used when sending requests of splitted PDF. Ignored on backend. | |
3031
| `starting_page_number` | *Optional[int]* | :heavy_minus_sign: | When PDF is split into pages before sending it into the API, providing this information will allow the page number to be assigned correctly. Introduced in 1.0.27. | |
3132
| `strategy` | [Optional[shared.Strategy]](../../models/shared/strategy.md) | :heavy_minus_sign: | The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: auto | auto |
3233
| `unique_element_ids` | *Optional[bool]* | :heavy_minus_sign: | When `True`, assign UUIDs to element IDs, which guarantees their uniqueness <br/>(useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: False | |

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.2
13+
version: 0.26.0
1414
additionalDependencies:
1515
dependencies:
1616
deepdiff: '>=6.0'

setup.py

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

2020
setuptools.setup(
2121
name='unstructured-client',
22-
version='0.25.2',
22+
version='0.26.0',
2323
author='Unstructured',
2424
description='Python Client SDK for Unstructured API',
2525
license = 'MIT',

src/unstructured_client/models/shared/partition_parameters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ class PartitionParameters:
7777
r"""A value between 0.0 and 1.0 describing the minimum similarity two elements must have to be included in the same chunk. Note that similar elements may be separated to meet chunk-size criteria; this value can only guarantees that two elements with similarity below the threshold will appear in separate chunks."""
7878
skip_infer_table_types: Optional[List[str]] = dataclasses.field(default=None, metadata={'multipart_form': { 'field_name': 'skip_infer_table_types' }})
7979
r"""The document types that you want to skip table extraction with. Default: []"""
80-
split_pdf_page: Optional[bool] = dataclasses.field(default=None, metadata={'multipart_form': { 'field_name': 'split_pdf_page' }})
80+
split_pdf_page: Optional[bool] = dataclasses.field(default=True, metadata={'multipart_form': { 'field_name': 'split_pdf_page' }})
8181
r"""Should the pdf file be split at client. Ignored on backend."""
82+
split_pdf_threads: Optional[int] = dataclasses.field(default=5, metadata={'multipart_form': { 'field_name': 'split_pdf_threads' }})
83+
r"""Number of threads used when sending requests of splitted PDF. Ignored on backend."""
8284
starting_page_number: Optional[int] = dataclasses.field(default=None, metadata={'multipart_form': { 'field_name': 'starting_page_number' }})
8385
r"""When PDF is split into pages before sending it into the API, providing this information will allow the page number to be assigned correctly. Introduced in 1.0.27."""
8486
strategy: Optional[Strategy] = dataclasses.field(default=Strategy.AUTO, metadata={'multipart_form': { 'field_name': 'strategy' }})

src/unstructured_client/sdkconfiguration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class SDKConfiguration:
2929
server: Optional[str] = ''
3030
language: str = 'python'
3131
openapi_doc_version: str = '1.0.30'
32-
sdk_version: str = '0.25.2'
33-
gen_version: str = '2.326.3'
34-
user_agent: str = 'speakeasy-sdk/python 0.25.2 2.326.3 1.0.30 unstructured-client'
32+
sdk_version: str = '0.26.0'
33+
gen_version: str = '2.329.0'
34+
user_agent: str = 'speakeasy-sdk/python 0.26.0 2.329.0 1.0.30 unstructured-client'
3535
retry_config: Optional[RetryConfig] = None
3636

3737
def __post_init__(self):

tests/helpers.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
3+
import re
4+
5+
6+
def sort_query_parameters(url):
7+
parts = url.split("?")
8+
9+
if len(parts) == 1:
10+
return url
11+
12+
query = parts[1]
13+
params = query.split("&")
14+
15+
params.sort(key=lambda x: x.split('=')[0])
16+
17+
return parts[0] + "?" + "&".join(params)
18+
19+
20+
def sort_serialized_maps(inp: any, regex: str, delim: str):
21+
22+
def sort_map(m):
23+
entire_match = m.group(0)
24+
25+
groups = m.groups()
26+
27+
for group in groups:
28+
pairs = []
29+
if '=' in group:
30+
pairs = group.split(delim)
31+
32+
pairs.sort(key=lambda x: x.split('=')[0])
33+
else:
34+
values = group.split(delim)
35+
36+
if len(values) == 1:
37+
pairs = values
38+
else:
39+
pairs = [''] * int(len(values)/2)
40+
# loop though every 2nd item
41+
for i in range(0, len(values), 2):
42+
pairs[int(i/2)] = values[i] + delim + values[i+1]
43+
44+
pairs.sort(key=lambda x: x.split(delim)[0])
45+
46+
entire_match = entire_match.replace(group, delim.join(pairs))
47+
48+
return entire_match
49+
50+
if isinstance(inp, str):
51+
return re.sub(regex, sort_map, inp)
52+
elif isinstance(inp, list):
53+
for i, v in enumerate(inp):
54+
inp[i] = sort_serialized_maps(v, regex, delim)
55+
return inp
56+
elif isinstance(inp, dict):
57+
for k, v in inp.items():
58+
inp[k] = sort_serialized_maps(v, regex, delim)
59+
return inp
60+
else:
61+
raise Exception("Unsupported type")

0 commit comments

Comments
 (0)