Skip to content

Commit d73a160

Browse files
authored
Merge branch 'main' into yuming/RUDOLPH-288_python_sdk_readme_add_serverless_api_signup
2 parents 4cccf22 + f345613 commit d73a160

File tree

14 files changed

+108
-1955
lines changed

14 files changed

+108
-1955
lines changed

.speakeasy/gen.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: ad32e3faae264ab1eb7cf461e373dcfa
4+
docChecksum: 50c3c5e39eb24b50e53fbe08f8156e76
55
docVersion: 1.0.48
6-
speakeasyVersion: 1.396.6
7-
generationVersion: 2.415.6
8-
releaseVersion: 0.26.0-beta.1
9-
configChecksum: 1af6154f17e397a8f89b4f6fd727be8d
6+
speakeasyVersion: 1.401.2
7+
generationVersion: 2.421.3
8+
releaseVersion: 0.26.0-beta.2
9+
configChecksum: 1c64b3f4febc852a778315853edd62ff
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:
1616
additionalDependencies: 1.0.0
17-
constsAndDefaults: 1.0.2
18-
core: 5.5.3
17+
constsAndDefaults: 1.0.3
18+
core: 5.5.4
1919
defaultEnabledRetries: 0.2.0
2020
enumUnions: 0.1.0
2121
envVarSecurityUsage: 0.3.1
@@ -105,6 +105,6 @@ examples:
105105
"200":
106106
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"}}]
107107
"422":
108-
application/json: {"detail": "<value>"}
108+
application/json: {"detail": []}
109109
5XX:
110110
application/json: {"detail": "An error occurred"}

.speakeasy/workflow.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
speakeasyVersion: 1.361.1
1+
speakeasyVersion: 1.401.2
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:403efaa5f402ccbd48b83c579e1d8c14197267223ba67e17ddf9f8b824c78a8e
6-
sourceBlobDigest: sha256:f89c6ba5c02602f9cf8c75d96a69a7fef23f7057cd82e78236557ba51f504e98
5+
sourceRevisionDigest: sha256:8e6306f9d3aef76cdd2d517057e363229b0c83337f56f7ef6ee5e497067ed02e
6+
sourceBlobDigest: sha256:e56a9e82f06b4aecdc8653a8b04256104f5ef4c8000dd8fd30fb2cb66a857567
77
tags:
88
- latest
99
- main
1010
targets:
1111
unstructured-python:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:403efaa5f402ccbd48b83c579e1d8c14197267223ba67e17ddf9f8b824c78a8e
15-
sourceBlobDigest: sha256:f89c6ba5c02602f9cf8c75d96a69a7fef23f7057cd82e78236557ba51f504e98
16-
outLocation: /github/workspace/repo
14+
sourceRevisionDigest: sha256:8e6306f9d3aef76cdd2d517057e363229b0c83337f56f7ef6ee5e497067ed02e
15+
sourceBlobDigest: sha256:e56a9e82f06b4aecdc8653a8b04256104f5ef4c8000dd8fd30fb2cb66a857567
1716
workflow:
1817
workflowVersion: 1.0.0
1918
speakeasyVersion: latest

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ install:
1414
python scripts/prepare-readme.py
1515
poetry install
1616

17+
## install-speakeasy-cli: download the speakeasy cli tool
18+
.PHONY: install-speakeasy-cli
19+
install-speakeasy-cli:
20+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
21+
1722
#################
1823
# Test and Lint #
1924
#################
@@ -48,24 +53,21 @@ lint:
4853
# Speakeasy #
4954
#############
5055

56+
## client-generate: Pull the openapi spec from the free hosted API and generate the SDK
5157
.PHONY: client-generate
5258
client-generate:
5359
wget -nv -q -O openapi.json https://api.unstructured.io/general/openapi.json
5460
speakeasy overlay validate -o ./overlay_client.yaml
5561
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
5662
speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
5763

64+
## client-generate-local: Generate the SDK using a local copy of openapi.json
5865
.PHONY: client-generate-local
5966
client-generate-local:
60-
wget -nv -q -O openapi.json http://localhost:5000/general/openapi.json
6167
speakeasy overlay validate -o ./overlay_client.yaml
6268
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
6369
speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
6470

65-
.PHONY: patch-custom-code
66-
patch-custom-code:
67-
git apply _custom_code.patch
68-
6971
.PHONY: publish
7072
publish:
7173
./scripts/publish.sh

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,4 +654,14 @@ Based on:
654654
### Generated
655655
- [python v0.26.0-beta.1] .
656656
### Releases
657-
- [PyPI v0.26.0-beta.1] https://pypi.org/project/unstructured-client/0.26.0-beta.1 - .
657+
- [PyPI v0.26.0-beta.1] https://pypi.org/project/unstructured-client/0.26.0-beta.1 - .
658+
659+
## 2024-09-21 00:08:49
660+
### Changes
661+
Based on:
662+
- OpenAPI Doc
663+
- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy
664+
### Generated
665+
- [python v0.26.0-beta.2] .
666+
### Releases
667+
- [PyPI v0.26.0-beta.2] https://pypi.org/project/unstructured-client/0.26.0-beta.2 - .

_custom_code.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

_test_unstructured_client/integration/test_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ async def mock_send(_, request: httpx.Request, **kwargs):
356356
)
357357

358358
req = operations.PartitionRequest(
359-
shared.PartitionParameters(
359+
partition_parameters=shared.PartitionParameters(
360360
files=files,
361361
split_pdf_page=True,
362362
split_pdf_allow_failed=False,

_test_unstructured_client/unit/test_custom_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ def mock_post(request):
122122
files = shared.Files(content=f.read(), file_name=filename)
123123

124124
req = operations.PartitionRequest(
125-
shared.PartitionParameters(files=files)
125+
partition_parameters=shared.PartitionParameters(files=files)
126126
)
127127

128128
with pytest.raises(Exception, match=f"Status {status_code}"):
129-
session.general.partition(req, retries=retries)
129+
session.general.partition(request=req, retries=retries)
130130

131131
if expect_retry:
132132
assert number_of_requests[0] > 1

codeSamples.yaml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,7 @@ info:
55
actions:
66
- target: $["paths"]["/general/v0/general"]["post"]
77
update:
8-
x-codeSamples:
9-
- lang: python
10-
label: partition
11-
source: |-
12-
import unstructured_client
13-
from unstructured_client.models import operations, shared
14-
15-
s = unstructured_client.UnstructuredClient()
16-
17-
18-
res = s.general.partition(request=operations.PartitionRequest(
19-
partition_parameters=shared.PartitionParameters(
20-
files=shared.Files(
21-
file_name='your_file_here',
22-
content='0x2cC94b2FEF'.encode(),
23-
),
24-
strategy=shared.Strategy.AUTO,
25-
chunking_strategy=shared.ChunkingStrategy.BASIC,
26-
split_pdf_page_range=[
27-
1,
28-
10,
29-
],
30-
),
31-
))
32-
33-
if res.elements is not None:
34-
# handle response
35-
pass
8+
"x-codeSamples":
9+
- "lang": "python"
10+
"label": "partition"
11+
"source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\ns = UnstructuredClient()\n\nres = s.general.partition(request={\n \"partition_parameters\": {\n \"files\": {\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n },\n \"strategy\": shared.Strategy.AUTO,\n \"chunking_strategy\": shared.ChunkingStrategy.BASIC,\n \"split_pdf_page_range\": [\n 1,\n 10,\n ],\n },\n})\n\nif res.elements is not None:\n # handle response\n pass"

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

0 commit comments

Comments
 (0)