Skip to content

chore: 🐝 Update SDK - Generate #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

This is a Python client for the [Unstructured API](https://unstructured-io.github.io/unstructured/api.html).

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

```bash
pip install unstructured-client
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

## Usage
Only the `files` parameter is required. See the [general partition](docs/sdks/general/README.md) page for all available parameters. 
Expand Down Expand Up @@ -86,17 +86,13 @@ s = unstructured_client.UnstructuredClient(
)
```

<!-- Start Dev Containers -->

<!-- End Dev Containers -->

<!-- No SDK Example Usage -->
<!-- No SDK Available Operations -->
<!-- No Pagination -->
<!-- No Error Handling -->
<!-- No Server Selection -->

<!-- Start Custom HTTP Client -->
<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
Expand All @@ -110,7 +106,7 @@ http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = unstructured_client.UnstructuredClient(client: http_client)
```
<!-- End Custom HTTP Client -->
<!-- End Custom HTTP Client [http-client] -->

<!-- No Retries -->
<!-- No Authentication -->
Expand Down
22 changes: 21 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,24 @@ Based on:
### Generated
- [python v0.14.3] .
### Releases
- [PyPI v0.14.3] https://pypi.org/project/unstructured-client/0.14.3 - .
- [PyPI v0.14.3] https://pypi.org/project/unstructured-client/0.14.3 - .

## 2023-12-06 00:19:29
### Changes
Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.125.2 (2.210.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.14.4] .
### Releases
- [PyPI v0.14.4] https://pypi.org/project/unstructured-client/0.14.4 - .

## 2023-12-12 00:19:45
### Changes
Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.126.0 (2.213.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.15.0] .
### Releases
- [PyPI v0.15.0] https://pypi.org/project/unstructured-client/0.15.0 - .
8 changes: 3 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
```python
import unstructured_client
from unstructured_client.models import shared
Expand Down Expand Up @@ -28,9 +28,7 @@ req = shared.PartitionParameters(
new_after_n_chars=1500,
output_format='application/json',
skip_infer_table_types=[
'p',
'd',
'f',
'pdf',
],
strategy='hi_res',
)
Expand All @@ -41,4 +39,4 @@ if res.elements is not None:
# handle response
pass
```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->
2 changes: 1 addition & 1 deletion docs/models/shared/partitionparameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
| `new_after_n_chars` | *Optional[int]* | :heavy_minus_sign: | If chunking strategy is set, cut off new sections after reaching a length of n chars (soft max). Default: 1500 | 1500 |
| `output_format` | *Optional[str]* | :heavy_minus_sign: | The format of the response. Supported formats are application/json and text/csv. Default: application/json. | application/json |
| `pdf_infer_table_structure` | *Optional[bool]* | :heavy_minus_sign: | If True and strategy=hi_res, any Table Elements extracted from a PDF will include an additional metadata field, 'text_as_html', where the value (string) is a just a transformation of the data into an HTML <table>. | |
| `skip_infer_table_types` | List[*str*] | :heavy_minus_sign: | The document types that you want to skip table extraction with. Default: ['pdf', 'jpg', 'png'] | pdf |
| `skip_infer_table_types` | List[*str*] | :heavy_minus_sign: | The document types that you want to skip table extraction with. Default: ['pdf', 'jpg', 'png'] | |
| `strategy` | *Optional[str]* | :heavy_minus_sign: | The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: auto | hi_res |
| `xml_keep_tags` | *Optional[bool]* | :heavy_minus_sign: | If True, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to partition_xml. | |
24 changes: 0 additions & 24 deletions docs/models/utils/retryconfig.md

This file was deleted.

73 changes: 0 additions & 73 deletions docs/sdks/general/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/sdks/unstructuredclient/README.md

This file was deleted.

5 changes: 1 addition & 4 deletions files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ src/unstructured_client/models/__init__.py
src/unstructured_client/models/errors/__init__.py
src/unstructured_client/models/operations/__init__.py
src/unstructured_client/models/shared/__init__.py
USAGE.md
docs/models/operations/partitionresponse.md
docs/models/errors/httpvalidationerror.md
docs/models/shared/loc.md
docs/models/shared/validationerror.md
docs/models/shared/files.md
docs/models/shared/partitionparameters.md
docs/models/shared/security.md
docs/sdks/unstructuredclient/README.md
docs/models/utils/retryconfig.md
docs/sdks/general/README.md
USAGE.md
.gitattributes
10 changes: 5 additions & 5 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ configVersion: 1.0.0
management:
docChecksum: bf57420eebd40f2b1d166092f01e3927
docVersion: 0.0.1
speakeasyVersion: 1.121.3
generationVersion: 2.195.2
speakeasyVersion: 1.126.0
generationVersion: 2.213.3
generation:
comments: {}
sdkClassName: unstructured_client
Expand All @@ -12,15 +12,15 @@ generation:
optionalPropertyRendering: withExample
features:
python:
core: 4.1.5
core: 4.3.0
examples: 2.81.3
globalSecurity: 2.83.0
globalSecurity: 2.83.1
globalServerURLs: 2.82.1
nameOverrides: 2.81.1
retries: 2.82.0
serverIDs: 2.81.1
python:
version: 0.14.3
version: 0.15.0
author: Unstructured
clientServerStatusCodesAsErrors: true
description: Python Client SDK for Unstructured API
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="unstructured-client",
version="0.14.3",
version="0.15.0",
author="Unstructured",
description="Python Client SDK for Unstructured API",
long_description=long_description,
Expand Down
4 changes: 2 additions & 2 deletions src/unstructured_client/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def __init__(self, sdk_config: SDKConfiguration) -> None:



def partition(self, request: shared.PartitionParameters, retries: Optional[utils.RetryConfig] = None) -> operations.PartitionResponse:
def partition(self, request: Optional[shared.PartitionParameters], retries: Optional[utils.RetryConfig] = None) -> operations.PartitionResponse:
r"""Pipeline 1"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = base_url + '/general/v0/general'
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request", False, True, 'multipart')
req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.PartitionParameters], "request", False, True, 'multipart')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class HTTPValidationError(Exception):


def __str__(self) -> str:
return utils.marshal_json(self)
return utils.marshal_json(self, type(self))
4 changes: 2 additions & 2 deletions src/unstructured_client/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests as requests_http
from .general import General
from .sdkconfiguration import SDKConfiguration
from typing import Callable, Dict, Union
from typing import Dict
from unstructured_client import utils
from unstructured_client.models import shared

Expand All @@ -14,7 +14,7 @@ class UnstructuredClient:
sdk_configuration: SDKConfiguration

def __init__(self,
api_key_auth: Union[str,Callable[[], str]],
api_key_auth: str ,
server: str = None,
server_url: str = None,
url_params: Dict[str, str] = None,
Expand Down
6 changes: 3 additions & 3 deletions src/unstructured_client/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class SDKConfiguration:
server: str = ''
language: str = 'python'
openapi_doc_version: str = '0.0.1'
sdk_version: str = '0.14.3'
gen_version: str = '2.195.2'
user_agent: str = 'speakeasy-sdk/python 0.14.3 2.195.2 0.0.1 unstructured-client'
sdk_version: str = '0.15.0'
gen_version: str = '2.213.3'
user_agent: str = 'speakeasy-sdk/python 0.15.0 2.213.3 0.0.1 unstructured-client'
retry_config: RetryConfig = None

def get_server_details(self) -> Tuple[str, Dict[str, str]]:
Expand Down
Loading