Skip to content
Closed
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
22 changes: 21 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,24 @@ Based on:
### Generated
- [python v0.8.1] .
### Releases
- [PyPI v0.8.1] https://pypi.org/project/unstructured-client/0.8.1 - .
- [PyPI v0.8.1] https://pypi.org/project/unstructured-client/0.8.1 - .

## 2023-10-05 00:18:04
### Changes
Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.94.0 (2.147.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.8.2] .
### Releases
- [PyPI v0.8.2] https://pypi.org/project/unstructured-client/0.8.2 - .

## 2023-10-07 00:17:38
### Changes
Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.96.1 (2.150.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.9.0] .
### Releases
- [PyPI v0.9.0] https://pypi.org/project/unstructured-client/0.9.0 - .
15 changes: 8 additions & 7 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ s = unstructured_client.UnstructuredClient(
req = shared.PartitionParameters(
chunking_strategy='by_title',
combine_under_n_chars=500,
coordinates=False,
encoding='utf-8',
files=shared.PartitionParametersFiles(
content='+WmI5Q)|yy'.encode(),
files='um',
),
gz_uncompressed_content_type='application/pdf',
hi_res_model_name='yolox',
include_page_breaks=False,
languages=[
'eng',
'[',
'e',
'n',
'g',
']',
],
multipage_sections=False,
new_after_n_chars=1500,
output_format='application/json',
pdf_infer_table_structure=False,
skip_infer_table_types=[
'pdf',
'p',
'd',
'f',
],
strategy='hi_res',
xml_keep_tags=False,
)

res = s.general.partition(req)
Expand Down
4 changes: 2 additions & 2 deletions docs/models/shared/partitionparameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
| `gz_uncompressed_content_type` | *Optional[str]* | :heavy_minus_sign: | If file is gzipped, use this content type after unzipping | application/pdf |
| `hi_res_model_name` | *Optional[str]* | :heavy_minus_sign: | The name of the inference model used when strategy is hi_res | yolox |
| `include_page_breaks` | *Optional[bool]* | :heavy_minus_sign: | If True, the output will include page breaks if the filetype supports it. Default: false | |
| `languages` | list[*str*] | :heavy_minus_sign: | The languages present in the document, for use in partitioning and/or OCR | |
| `languages` | list[*str*] | :heavy_minus_sign: | The languages present in the document, for use in partitioning and/or OCR | [eng] |
| `multipage_sections` | *Optional[bool]* | :heavy_minus_sign: | If chunking strategy is set, determines if sections can span multiple sections. Default: true | |
| `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. 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'] | |
| `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 |
| `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. | |
15 changes: 8 additions & 7 deletions docs/sdks/general/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@ s = unstructured_client.UnstructuredClient(
req = shared.PartitionParameters(
chunking_strategy='by_title',
combine_under_n_chars=500,
coordinates=False,
encoding='utf-8',
files=shared.PartitionParametersFiles(
content='+WmI5Q)|yy'.encode(),
files='um',
),
gz_uncompressed_content_type='application/pdf',
hi_res_model_name='yolox',
include_page_breaks=False,
languages=[
'eng',
'[',
'e',
'n',
'g',
']',
],
multipage_sections=False,
new_after_n_chars=1500,
output_format='application/json',
pdf_infer_table_structure=False,
skip_infer_table_types=[
'pdf',
'p',
'd',
'f',
],
strategy='hi_res',
xml_keep_tags=False,
)

res = s.general.partition(req)
Expand Down
11 changes: 6 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: 25324f1821b1070aa4a416ec8ddca590
docVersion: 0.0.1
speakeasyVersion: 1.92.3
generationVersion: 2.143.2
speakeasyVersion: 1.96.1
generationVersion: 2.150.0
generation:
comments:
disableComments: false
Expand All @@ -14,18 +14,19 @@ generation:
tagNamespacingDisabled: false
features:
python:
core: 2.88.1
core: 2.88.4
downloadStreams: 0.0.1
examples: 2.81.2
globalSecurity: 2.81.1
globalSecurity: 2.82.0
globalServerURLs: 2.82.0
nameOverrides: 2.81.1
retries: 2.82.0
serverIDs: 2.81.1
python:
version: 0.8.1
version: 0.9.0
author: Unstructured
clientServerStatusCodesAsErrors: true
description: Python Client SDK Generated by Speakeasy
flattenGlobalSecurity: false
maxMethodParams: 0
packageName: unstructured-client
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.8.1",
version="0.9.0",
author="Unstructured",
description="Python Client SDK Generated by Speakeasy",
long_description=long_description,
Expand Down
1 change: 1 addition & 0 deletions src/unstructured_client/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

# __init__.py
1 change: 1 addition & 0 deletions src/unstructured_client/models/errors/validationerror.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations
import dataclasses
from ..shared import validationerror_loc as shared_validationerror_loc
from dataclasses_json import Undefined, dataclass_json
from typing import Union
from unstructured_client import utils
Expand Down
8 changes: 5 additions & 3 deletions src/unstructured_client/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UnstructuredClient:
sdk_configuration: SDKConfiguration

def __init__(self,
security: shared.Security = None,
api_key_auth: str,
server: str = None,
server_url: str = None,
url_params: dict[str, str] = None,
Expand All @@ -22,8 +22,8 @@ def __init__(self,
) -> None:
"""Instantiates the SDK configuring it with the provided parameters.

:param security: The security details required for authentication
:type security: shared.Security
:param api_key_auth: The api_key_auth required for authentication
:type api_key_auth: str
:param server: The server by name to use for all operations
:type server: str
:param server_url: The server URL to use for all operations
Expand All @@ -38,8 +38,10 @@ def __init__(self,
if client is None:
client = requests_http.Session()


security_client = utils.configure_security_client(client, security)


if server_url is not None:
if url_params is not None:
server_url = utils.template_url(server_url, url_params)
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 @@ -25,9 +25,9 @@ class SDKConfiguration:
server: str = ''
language: str = 'python'
openapi_doc_version: str = '0.0.1'
sdk_version: str = '0.8.1'
gen_version: str = '2.143.2'
user_agent: str = 'speakeasy-sdk/python 0.8.1 2.143.2 0.0.1 unstructured-client'
sdk_version: str = '0.9.0'
gen_version: str = '2.150.0'
user_agent: str = 'speakeasy-sdk/python 0.9.0 2.150.0 0.0.1 unstructured-client'
retry_config: RetryConfig = None

def get_server_details(self) -> tuple[str, dict[str, str]]:
Expand Down