landingai-ade 0.17.1__tar.gz → 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of landingai-ade might be problematic. Click here for more details.
- landingai_ade-0.18.0/.release-please-manifest.json +3 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/CHANGELOG.md +14 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/PKG-INFO +1 -1
- landingai_ade-0.18.0/api.md +32 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/pyproject.toml +1 -1
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_client.py +13 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_version.py +1 -1
- landingai_ade-0.18.0/src/landingai_ade/resources/__init__.py +19 -0
- landingai_ade-0.18.0/src/landingai_ade/resources/parse_jobs.py +462 -0
- landingai_ade-0.18.0/src/landingai_ade/types/__init__.py +14 -0
- landingai_ade-0.18.0/src/landingai_ade/types/parse_job_create_params.py +45 -0
- landingai_ade-0.18.0/src/landingai_ade/types/parse_job_create_response.py +9 -0
- landingai_ade-0.18.0/src/landingai_ade/types/parse_job_get_response.py +111 -0
- landingai_ade-0.18.0/src/landingai_ade/types/parse_job_list_params.py +21 -0
- landingai_ade-0.18.0/src/landingai_ade/types/parse_job_list_response.py +31 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/types/parse_response.py +6 -49
- landingai_ade-0.18.0/src/landingai_ade/types/shared/__init__.py +4 -0
- landingai_ade-0.18.0/src/landingai_ade/types/shared/parse_grounding_box.py +15 -0
- landingai_ade-0.18.0/src/landingai_ade/types/shared/parse_metadata.py +23 -0
- landingai_ade-0.18.0/tests/api_resources/test_parse_jobs.py +268 -0
- landingai_ade-0.17.1/.release-please-manifest.json +0 -3
- landingai_ade-0.17.1/api.md +0 -12
- landingai_ade-0.17.1/src/landingai_ade/types/__init__.py +0 -8
- landingai_ade-0.17.1/tests/api_resources/__init__.py +0 -1
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/.gitignore +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/CONTRIBUTING.md +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/LICENSE +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/README.md +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/SECURITY.md +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/bin/check-release-environment +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/bin/publish-pypi +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/examples/.keep +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/noxfile.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/release-please-config.json +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/requirements-dev.lock +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/requirements.lock +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/__init__.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_base_client.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_compat.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_constants.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_exceptions.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_files.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_models.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_qs.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_resource.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_response.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_streaming.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_types.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/__init__.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_compat.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_datetime_parse.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_logs.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_proxy.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_reflection.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_resources_proxy.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_streams.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_sync.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_transform.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_typing.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/_utils/_utils.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/lib/.keep +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/lib/__init__.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/lib/schema_utils.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/lib/url_utils.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/py.typed +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/types/client_extract_params.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/types/client_parse_params.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/src/landingai_ade/types/extract_response.py +0 -0
- {landingai_ade-0.17.1/src/landingai_ade/resources → landingai_ade-0.18.0/tests}/__init__.py +0 -0
- {landingai_ade-0.17.1/tests → landingai_ade-0.18.0/tests/api_resources}/__init__.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/api_resources/test_client.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/conftest.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/sample_file.txt +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_client.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_deepcopy.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_extract_files.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_files.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_models.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_qs.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_required_args.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_response.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_streaming.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_transform.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_utils/test_proxy.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/test_utils/test_typing.py +0 -0
- {landingai_ade-0.17.1 → landingai_ade-0.18.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.0 (2025-10-10)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.17.1...v0.18.0](https://github.com/landing-ai/ade-python/compare/v0.17.1...v0.18.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([5743253](https://github.com/landing-ai/ade-python/commit/57432532d8ff622e1980d892a13cad5184cc92c5))
|
|
10
|
+
* **api:** update via SDK Studio ([d94d74a](https://github.com/landing-ai/ade-python/commit/d94d74a9545dba1d8de7e7c616ac63b602c28c95))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* remove custom code ([ba76a38](https://github.com/landing-ai/ade-python/commit/ba76a38dd201f37f687cf43fe6ad2605787bfd0a))
|
|
16
|
+
|
|
3
17
|
## 0.17.1 (2025-10-02)
|
|
4
18
|
|
|
5
19
|
Full Changelog: [v0.17.0...v0.17.1](https://github.com/landing-ai/ade-python/compare/v0.17.0...v0.17.1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: landingai-ade
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: The official Python library for the landingai-ade API
|
|
5
5
|
Project-URL: Homepage, https://github.com/landing-ai/ade-python
|
|
6
6
|
Project-URL: Repository, https://github.com/landing-ai/ade-python
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Shared Types
|
|
2
|
+
|
|
3
|
+
```python
|
|
4
|
+
from landingai_ade.types import ParseGroundingBox, ParseMetadata
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
# LandingAIADE
|
|
8
|
+
|
|
9
|
+
Types:
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from landingai_ade.types import ExtractResponse, ParseResponse
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Methods:
|
|
16
|
+
|
|
17
|
+
- <code title="post /v1/ade/extract">client.<a href="./src/landingai_ade/_client.py">extract</a>(\*\*<a href="src/landingai_ade/types/client_extract_params.py">params</a>) -> <a href="./src/landingai_ade/types/extract_response.py">ExtractResponse</a></code>
|
|
18
|
+
- <code title="post /v1/ade/parse">client.<a href="./src/landingai_ade/_client.py">parse</a>(\*\*<a href="src/landingai_ade/types/client_parse_params.py">params</a>) -> <a href="./src/landingai_ade/types/parse_response.py">ParseResponse</a></code>
|
|
19
|
+
|
|
20
|
+
# ParseJobs
|
|
21
|
+
|
|
22
|
+
Types:
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from landingai_ade.types import ParseJobCreateResponse, ParseJobListResponse, ParseJobGetResponse
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Methods:
|
|
29
|
+
|
|
30
|
+
- <code title="post /v1/ade/parse/jobs">client.parse_jobs.<a href="./src/landingai_ade/resources/parse_jobs.py">create</a>(\*\*<a href="src/landingai_ade/types/parse_job_create_params.py">params</a>) -> <a href="./src/landingai_ade/types/parse_job_create_response.py">ParseJobCreateResponse</a></code>
|
|
31
|
+
- <code title="get /v1/ade/parse/jobs">client.parse_jobs.<a href="./src/landingai_ade/resources/parse_jobs.py">list</a>(\*\*<a href="src/landingai_ade/types/parse_job_list_params.py">params</a>) -> <a href="./src/landingai_ade/types/parse_job_list_response.py">ParseJobListResponse</a></code>
|
|
32
|
+
- <code title="get /v1/ade/parse/jobs/{job_id}">client.parse_jobs.<a href="./src/landingai_ade/resources/parse_jobs.py">get</a>(job_id) -> <a href="./src/landingai_ade/types/parse_job_get_response.py">ParseJobGetResponse</a></code>
|
|
@@ -41,6 +41,7 @@ from ._response import (
|
|
|
41
41
|
async_to_raw_response_wrapper,
|
|
42
42
|
async_to_streamed_response_wrapper,
|
|
43
43
|
)
|
|
44
|
+
from .resources import parse_jobs
|
|
44
45
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
45
46
|
from ._exceptions import APIStatusError, LandingAiadeError
|
|
46
47
|
from ._base_client import (
|
|
@@ -74,6 +75,7 @@ ENVIRONMENTS: Dict[str, str] = {
|
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
class LandingAIADE(SyncAPIClient):
|
|
78
|
+
parse_jobs: parse_jobs.ParseJobsResource
|
|
77
79
|
with_raw_response: LandingAIADEWithRawResponse
|
|
78
80
|
with_streaming_response: LandingAIADEWithStreamedResponse
|
|
79
81
|
|
|
@@ -155,6 +157,7 @@ class LandingAIADE(SyncAPIClient):
|
|
|
155
157
|
_strict_response_validation=_strict_response_validation,
|
|
156
158
|
)
|
|
157
159
|
|
|
160
|
+
self.parse_jobs = parse_jobs.ParseJobsResource(self)
|
|
158
161
|
self.with_raw_response = LandingAIADEWithRawResponse(self)
|
|
159
162
|
self.with_streaming_response = LandingAIADEWithStreamedResponse(self)
|
|
160
163
|
|
|
@@ -422,6 +425,7 @@ class LandingAIADE(SyncAPIClient):
|
|
|
422
425
|
|
|
423
426
|
|
|
424
427
|
class AsyncLandingAIADE(AsyncAPIClient):
|
|
428
|
+
parse_jobs: parse_jobs.AsyncParseJobsResource
|
|
425
429
|
with_raw_response: AsyncLandingAIADEWithRawResponse
|
|
426
430
|
with_streaming_response: AsyncLandingAIADEWithStreamedResponse
|
|
427
431
|
|
|
@@ -503,6 +507,7 @@ class AsyncLandingAIADE(AsyncAPIClient):
|
|
|
503
507
|
_strict_response_validation=_strict_response_validation,
|
|
504
508
|
)
|
|
505
509
|
|
|
510
|
+
self.parse_jobs = parse_jobs.AsyncParseJobsResource(self)
|
|
506
511
|
self.with_raw_response = AsyncLandingAIADEWithRawResponse(self)
|
|
507
512
|
self.with_streaming_response = AsyncLandingAIADEWithStreamedResponse(self)
|
|
508
513
|
|
|
@@ -771,6 +776,8 @@ class AsyncLandingAIADE(AsyncAPIClient):
|
|
|
771
776
|
|
|
772
777
|
class LandingAIADEWithRawResponse:
|
|
773
778
|
def __init__(self, client: LandingAIADE) -> None:
|
|
779
|
+
self.parse_jobs = parse_jobs.ParseJobsResourceWithRawResponse(client.parse_jobs)
|
|
780
|
+
|
|
774
781
|
self.extract = to_raw_response_wrapper(
|
|
775
782
|
client.extract,
|
|
776
783
|
)
|
|
@@ -781,6 +788,8 @@ class LandingAIADEWithRawResponse:
|
|
|
781
788
|
|
|
782
789
|
class AsyncLandingAIADEWithRawResponse:
|
|
783
790
|
def __init__(self, client: AsyncLandingAIADE) -> None:
|
|
791
|
+
self.parse_jobs = parse_jobs.AsyncParseJobsResourceWithRawResponse(client.parse_jobs)
|
|
792
|
+
|
|
784
793
|
self.extract = async_to_raw_response_wrapper(
|
|
785
794
|
client.extract,
|
|
786
795
|
)
|
|
@@ -791,6 +800,8 @@ class AsyncLandingAIADEWithRawResponse:
|
|
|
791
800
|
|
|
792
801
|
class LandingAIADEWithStreamedResponse:
|
|
793
802
|
def __init__(self, client: LandingAIADE) -> None:
|
|
803
|
+
self.parse_jobs = parse_jobs.ParseJobsResourceWithStreamingResponse(client.parse_jobs)
|
|
804
|
+
|
|
794
805
|
self.extract = to_streamed_response_wrapper(
|
|
795
806
|
client.extract,
|
|
796
807
|
)
|
|
@@ -801,6 +812,8 @@ class LandingAIADEWithStreamedResponse:
|
|
|
801
812
|
|
|
802
813
|
class AsyncLandingAIADEWithStreamedResponse:
|
|
803
814
|
def __init__(self, client: AsyncLandingAIADE) -> None:
|
|
815
|
+
self.parse_jobs = parse_jobs.AsyncParseJobsResourceWithStreamingResponse(client.parse_jobs)
|
|
816
|
+
|
|
804
817
|
self.extract = async_to_streamed_response_wrapper(
|
|
805
818
|
client.extract,
|
|
806
819
|
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .parse_jobs import (
|
|
4
|
+
ParseJobsResource,
|
|
5
|
+
AsyncParseJobsResource,
|
|
6
|
+
ParseJobsResourceWithRawResponse,
|
|
7
|
+
AsyncParseJobsResourceWithRawResponse,
|
|
8
|
+
ParseJobsResourceWithStreamingResponse,
|
|
9
|
+
AsyncParseJobsResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"ParseJobsResource",
|
|
14
|
+
"AsyncParseJobsResource",
|
|
15
|
+
"ParseJobsResourceWithRawResponse",
|
|
16
|
+
"AsyncParseJobsResourceWithRawResponse",
|
|
17
|
+
"ParseJobsResourceWithStreamingResponse",
|
|
18
|
+
"AsyncParseJobsResourceWithStreamingResponse",
|
|
19
|
+
]
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Mapping, Optional, cast
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ..types import parse_job_list_params, parse_job_create_params
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
|
|
12
|
+
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
|
|
13
|
+
from .._compat import cached_property
|
|
14
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from .._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from .._base_client import make_request_options
|
|
22
|
+
from ..types.parse_job_get_response import ParseJobGetResponse
|
|
23
|
+
from ..types.parse_job_list_response import ParseJobListResponse
|
|
24
|
+
from ..types.parse_job_create_response import ParseJobCreateResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["ParseJobsResource", "AsyncParseJobsResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ParseJobsResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> ParseJobsResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/landing-ai/ade-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return ParseJobsResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> ParseJobsResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/landing-ai/ade-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return ParseJobsResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
*,
|
|
52
|
+
document: Optional[FileTypes] | Omit = omit,
|
|
53
|
+
document_url: Optional[str] | Omit = omit,
|
|
54
|
+
model: Optional[str] | Omit = omit,
|
|
55
|
+
output_save_url: Optional[str] | Omit = omit,
|
|
56
|
+
split: Optional[Literal["page"]] | Omit = omit,
|
|
57
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
|
+
extra_headers: Headers | None = None,
|
|
60
|
+
extra_query: Query | None = None,
|
|
61
|
+
extra_body: Body | None = None,
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
|
+
) -> ParseJobCreateResponse:
|
|
64
|
+
"""
|
|
65
|
+
Parse documents asynchronously.
|
|
66
|
+
|
|
67
|
+
This endpoint creates a job that handles the processing for both large documents
|
|
68
|
+
and large batches of documents.
|
|
69
|
+
|
|
70
|
+
For EU users, use this endpoint:
|
|
71
|
+
|
|
72
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs`.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
document: A file to be parsed. The file can be a PDF or an image. See the list of
|
|
76
|
+
supported file types here: https://docs.landing.ai/ade/ade-file-types. Either
|
|
77
|
+
this parameter or the `document_url` parameter must be provided.
|
|
78
|
+
|
|
79
|
+
document_url: The URL to the file to be parsed. The file can be a PDF or an image. See the
|
|
80
|
+
list of supported file types here: https://docs.landing.ai/ade/ade-file-types.
|
|
81
|
+
Either this parameter or the `document` parameter must be provided.
|
|
82
|
+
|
|
83
|
+
model: The version of the model to use for parsing.
|
|
84
|
+
|
|
85
|
+
output_save_url: If zero data retention (ZDR) is enabled, you must enter a URL for the parsed
|
|
86
|
+
output to be saved to. When ZDR is enabled, the parsed content will not be in
|
|
87
|
+
the API response.
|
|
88
|
+
|
|
89
|
+
split: If you want to split documents into smaller sections, include the split
|
|
90
|
+
parameter. Set the parameter to page to split documents at the page level. The
|
|
91
|
+
splits object in the API output will contain a set of data for each page.
|
|
92
|
+
|
|
93
|
+
extra_headers: Send extra headers
|
|
94
|
+
|
|
95
|
+
extra_query: Add additional query parameters to the request
|
|
96
|
+
|
|
97
|
+
extra_body: Add additional JSON properties to the request
|
|
98
|
+
|
|
99
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
100
|
+
"""
|
|
101
|
+
body = deepcopy_minimal(
|
|
102
|
+
{
|
|
103
|
+
"document": document,
|
|
104
|
+
"document_url": document_url,
|
|
105
|
+
"model": model,
|
|
106
|
+
"output_save_url": output_save_url,
|
|
107
|
+
"split": split,
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["document"]])
|
|
111
|
+
# It should be noted that the actual Content-Type header that will be
|
|
112
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
113
|
+
# multipart/form-data; boundary=---abc--
|
|
114
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
115
|
+
return self._post(
|
|
116
|
+
"/v1/ade/parse/jobs",
|
|
117
|
+
body=maybe_transform(body, parse_job_create_params.ParseJobCreateParams),
|
|
118
|
+
files=files,
|
|
119
|
+
options=make_request_options(
|
|
120
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
121
|
+
),
|
|
122
|
+
cast_to=ParseJobCreateResponse,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
def list(
|
|
126
|
+
self,
|
|
127
|
+
*,
|
|
128
|
+
page: int | Omit = omit,
|
|
129
|
+
page_size: int | Omit = omit,
|
|
130
|
+
status: Optional[Literal["cancelled", "completed", "failed", "pending", "processing"]] | Omit = omit,
|
|
131
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
132
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
133
|
+
extra_headers: Headers | None = None,
|
|
134
|
+
extra_query: Query | None = None,
|
|
135
|
+
extra_body: Body | None = None,
|
|
136
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
137
|
+
) -> ParseJobListResponse:
|
|
138
|
+
"""List all async parse jobs associated with your API key.
|
|
139
|
+
|
|
140
|
+
Returns the list of jobs
|
|
141
|
+
or an error response. For EU users, use this endpoint:
|
|
142
|
+
|
|
143
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs`.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
page: Page number (0-indexed)
|
|
147
|
+
|
|
148
|
+
page_size: Number of items per page
|
|
149
|
+
|
|
150
|
+
status: Filter by job status.
|
|
151
|
+
|
|
152
|
+
extra_headers: Send extra headers
|
|
153
|
+
|
|
154
|
+
extra_query: Add additional query parameters to the request
|
|
155
|
+
|
|
156
|
+
extra_body: Add additional JSON properties to the request
|
|
157
|
+
|
|
158
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
159
|
+
"""
|
|
160
|
+
return self._get(
|
|
161
|
+
"/v1/ade/parse/jobs",
|
|
162
|
+
options=make_request_options(
|
|
163
|
+
extra_headers=extra_headers,
|
|
164
|
+
extra_query=extra_query,
|
|
165
|
+
extra_body=extra_body,
|
|
166
|
+
timeout=timeout,
|
|
167
|
+
query=maybe_transform(
|
|
168
|
+
{
|
|
169
|
+
"page": page,
|
|
170
|
+
"page_size": page_size,
|
|
171
|
+
"status": status,
|
|
172
|
+
},
|
|
173
|
+
parse_job_list_params.ParseJobListParams,
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
cast_to=ParseJobListResponse,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
def get(
|
|
180
|
+
self,
|
|
181
|
+
job_id: str,
|
|
182
|
+
*,
|
|
183
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
184
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
185
|
+
extra_headers: Headers | None = None,
|
|
186
|
+
extra_query: Query | None = None,
|
|
187
|
+
extra_body: Body | None = None,
|
|
188
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
189
|
+
) -> ParseJobGetResponse:
|
|
190
|
+
"""
|
|
191
|
+
Get the status for an async parse job.
|
|
192
|
+
|
|
193
|
+
Returns the job status or an error response. For EU users, use this endpoint:
|
|
194
|
+
|
|
195
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs/{job_id}`.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
extra_headers: Send extra headers
|
|
199
|
+
|
|
200
|
+
extra_query: Add additional query parameters to the request
|
|
201
|
+
|
|
202
|
+
extra_body: Add additional JSON properties to the request
|
|
203
|
+
|
|
204
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
205
|
+
"""
|
|
206
|
+
if not job_id:
|
|
207
|
+
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
|
|
208
|
+
return self._get(
|
|
209
|
+
f"/v1/ade/parse/jobs/{job_id}",
|
|
210
|
+
options=make_request_options(
|
|
211
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
212
|
+
),
|
|
213
|
+
cast_to=ParseJobGetResponse,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class AsyncParseJobsResource(AsyncAPIResource):
|
|
218
|
+
@cached_property
|
|
219
|
+
def with_raw_response(self) -> AsyncParseJobsResourceWithRawResponse:
|
|
220
|
+
"""
|
|
221
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
222
|
+
the raw response object instead of the parsed content.
|
|
223
|
+
|
|
224
|
+
For more information, see https://www.github.com/landing-ai/ade-python#accessing-raw-response-data-eg-headers
|
|
225
|
+
"""
|
|
226
|
+
return AsyncParseJobsResourceWithRawResponse(self)
|
|
227
|
+
|
|
228
|
+
@cached_property
|
|
229
|
+
def with_streaming_response(self) -> AsyncParseJobsResourceWithStreamingResponse:
|
|
230
|
+
"""
|
|
231
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
232
|
+
|
|
233
|
+
For more information, see https://www.github.com/landing-ai/ade-python#with_streaming_response
|
|
234
|
+
"""
|
|
235
|
+
return AsyncParseJobsResourceWithStreamingResponse(self)
|
|
236
|
+
|
|
237
|
+
async def create(
|
|
238
|
+
self,
|
|
239
|
+
*,
|
|
240
|
+
document: Optional[FileTypes] | Omit = omit,
|
|
241
|
+
document_url: Optional[str] | Omit = omit,
|
|
242
|
+
model: Optional[str] | Omit = omit,
|
|
243
|
+
output_save_url: Optional[str] | Omit = omit,
|
|
244
|
+
split: Optional[Literal["page"]] | Omit = omit,
|
|
245
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
246
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
247
|
+
extra_headers: Headers | None = None,
|
|
248
|
+
extra_query: Query | None = None,
|
|
249
|
+
extra_body: Body | None = None,
|
|
250
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
251
|
+
) -> ParseJobCreateResponse:
|
|
252
|
+
"""
|
|
253
|
+
Parse documents asynchronously.
|
|
254
|
+
|
|
255
|
+
This endpoint creates a job that handles the processing for both large documents
|
|
256
|
+
and large batches of documents.
|
|
257
|
+
|
|
258
|
+
For EU users, use this endpoint:
|
|
259
|
+
|
|
260
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs`.
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
document: A file to be parsed. The file can be a PDF or an image. See the list of
|
|
264
|
+
supported file types here: https://docs.landing.ai/ade/ade-file-types. Either
|
|
265
|
+
this parameter or the `document_url` parameter must be provided.
|
|
266
|
+
|
|
267
|
+
document_url: The URL to the file to be parsed. The file can be a PDF or an image. See the
|
|
268
|
+
list of supported file types here: https://docs.landing.ai/ade/ade-file-types.
|
|
269
|
+
Either this parameter or the `document` parameter must be provided.
|
|
270
|
+
|
|
271
|
+
model: The version of the model to use for parsing.
|
|
272
|
+
|
|
273
|
+
output_save_url: If zero data retention (ZDR) is enabled, you must enter a URL for the parsed
|
|
274
|
+
output to be saved to. When ZDR is enabled, the parsed content will not be in
|
|
275
|
+
the API response.
|
|
276
|
+
|
|
277
|
+
split: If you want to split documents into smaller sections, include the split
|
|
278
|
+
parameter. Set the parameter to page to split documents at the page level. The
|
|
279
|
+
splits object in the API output will contain a set of data for each page.
|
|
280
|
+
|
|
281
|
+
extra_headers: Send extra headers
|
|
282
|
+
|
|
283
|
+
extra_query: Add additional query parameters to the request
|
|
284
|
+
|
|
285
|
+
extra_body: Add additional JSON properties to the request
|
|
286
|
+
|
|
287
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
288
|
+
"""
|
|
289
|
+
body = deepcopy_minimal(
|
|
290
|
+
{
|
|
291
|
+
"document": document,
|
|
292
|
+
"document_url": document_url,
|
|
293
|
+
"model": model,
|
|
294
|
+
"output_save_url": output_save_url,
|
|
295
|
+
"split": split,
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["document"]])
|
|
299
|
+
# It should be noted that the actual Content-Type header that will be
|
|
300
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
301
|
+
# multipart/form-data; boundary=---abc--
|
|
302
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
303
|
+
return await self._post(
|
|
304
|
+
"/v1/ade/parse/jobs",
|
|
305
|
+
body=await async_maybe_transform(body, parse_job_create_params.ParseJobCreateParams),
|
|
306
|
+
files=files,
|
|
307
|
+
options=make_request_options(
|
|
308
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
309
|
+
),
|
|
310
|
+
cast_to=ParseJobCreateResponse,
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
async def list(
|
|
314
|
+
self,
|
|
315
|
+
*,
|
|
316
|
+
page: int | Omit = omit,
|
|
317
|
+
page_size: int | Omit = omit,
|
|
318
|
+
status: Optional[Literal["cancelled", "completed", "failed", "pending", "processing"]] | Omit = omit,
|
|
319
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
320
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
321
|
+
extra_headers: Headers | None = None,
|
|
322
|
+
extra_query: Query | None = None,
|
|
323
|
+
extra_body: Body | None = None,
|
|
324
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
325
|
+
) -> ParseJobListResponse:
|
|
326
|
+
"""List all async parse jobs associated with your API key.
|
|
327
|
+
|
|
328
|
+
Returns the list of jobs
|
|
329
|
+
or an error response. For EU users, use this endpoint:
|
|
330
|
+
|
|
331
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs`.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
page: Page number (0-indexed)
|
|
335
|
+
|
|
336
|
+
page_size: Number of items per page
|
|
337
|
+
|
|
338
|
+
status: Filter by job status.
|
|
339
|
+
|
|
340
|
+
extra_headers: Send extra headers
|
|
341
|
+
|
|
342
|
+
extra_query: Add additional query parameters to the request
|
|
343
|
+
|
|
344
|
+
extra_body: Add additional JSON properties to the request
|
|
345
|
+
|
|
346
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
347
|
+
"""
|
|
348
|
+
return await self._get(
|
|
349
|
+
"/v1/ade/parse/jobs",
|
|
350
|
+
options=make_request_options(
|
|
351
|
+
extra_headers=extra_headers,
|
|
352
|
+
extra_query=extra_query,
|
|
353
|
+
extra_body=extra_body,
|
|
354
|
+
timeout=timeout,
|
|
355
|
+
query=await async_maybe_transform(
|
|
356
|
+
{
|
|
357
|
+
"page": page,
|
|
358
|
+
"page_size": page_size,
|
|
359
|
+
"status": status,
|
|
360
|
+
},
|
|
361
|
+
parse_job_list_params.ParseJobListParams,
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
cast_to=ParseJobListResponse,
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
async def get(
|
|
368
|
+
self,
|
|
369
|
+
job_id: str,
|
|
370
|
+
*,
|
|
371
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
372
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
373
|
+
extra_headers: Headers | None = None,
|
|
374
|
+
extra_query: Query | None = None,
|
|
375
|
+
extra_body: Body | None = None,
|
|
376
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
377
|
+
) -> ParseJobGetResponse:
|
|
378
|
+
"""
|
|
379
|
+
Get the status for an async parse job.
|
|
380
|
+
|
|
381
|
+
Returns the job status or an error response. For EU users, use this endpoint:
|
|
382
|
+
|
|
383
|
+
`https://api.va.eu-west-1.landing.ai/v1/ade/parse/jobs/{job_id}`.
|
|
384
|
+
|
|
385
|
+
Args:
|
|
386
|
+
extra_headers: Send extra headers
|
|
387
|
+
|
|
388
|
+
extra_query: Add additional query parameters to the request
|
|
389
|
+
|
|
390
|
+
extra_body: Add additional JSON properties to the request
|
|
391
|
+
|
|
392
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
393
|
+
"""
|
|
394
|
+
if not job_id:
|
|
395
|
+
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
|
|
396
|
+
return await self._get(
|
|
397
|
+
f"/v1/ade/parse/jobs/{job_id}",
|
|
398
|
+
options=make_request_options(
|
|
399
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
400
|
+
),
|
|
401
|
+
cast_to=ParseJobGetResponse,
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
class ParseJobsResourceWithRawResponse:
|
|
406
|
+
def __init__(self, parse_jobs: ParseJobsResource) -> None:
|
|
407
|
+
self._parse_jobs = parse_jobs
|
|
408
|
+
|
|
409
|
+
self.create = to_raw_response_wrapper(
|
|
410
|
+
parse_jobs.create,
|
|
411
|
+
)
|
|
412
|
+
self.list = to_raw_response_wrapper(
|
|
413
|
+
parse_jobs.list,
|
|
414
|
+
)
|
|
415
|
+
self.get = to_raw_response_wrapper(
|
|
416
|
+
parse_jobs.get,
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
class AsyncParseJobsResourceWithRawResponse:
|
|
421
|
+
def __init__(self, parse_jobs: AsyncParseJobsResource) -> None:
|
|
422
|
+
self._parse_jobs = parse_jobs
|
|
423
|
+
|
|
424
|
+
self.create = async_to_raw_response_wrapper(
|
|
425
|
+
parse_jobs.create,
|
|
426
|
+
)
|
|
427
|
+
self.list = async_to_raw_response_wrapper(
|
|
428
|
+
parse_jobs.list,
|
|
429
|
+
)
|
|
430
|
+
self.get = async_to_raw_response_wrapper(
|
|
431
|
+
parse_jobs.get,
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
class ParseJobsResourceWithStreamingResponse:
|
|
436
|
+
def __init__(self, parse_jobs: ParseJobsResource) -> None:
|
|
437
|
+
self._parse_jobs = parse_jobs
|
|
438
|
+
|
|
439
|
+
self.create = to_streamed_response_wrapper(
|
|
440
|
+
parse_jobs.create,
|
|
441
|
+
)
|
|
442
|
+
self.list = to_streamed_response_wrapper(
|
|
443
|
+
parse_jobs.list,
|
|
444
|
+
)
|
|
445
|
+
self.get = to_streamed_response_wrapper(
|
|
446
|
+
parse_jobs.get,
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
class AsyncParseJobsResourceWithStreamingResponse:
|
|
451
|
+
def __init__(self, parse_jobs: AsyncParseJobsResource) -> None:
|
|
452
|
+
self._parse_jobs = parse_jobs
|
|
453
|
+
|
|
454
|
+
self.create = async_to_streamed_response_wrapper(
|
|
455
|
+
parse_jobs.create,
|
|
456
|
+
)
|
|
457
|
+
self.list = async_to_streamed_response_wrapper(
|
|
458
|
+
parse_jobs.list,
|
|
459
|
+
)
|
|
460
|
+
self.get = async_to_streamed_response_wrapper(
|
|
461
|
+
parse_jobs.get,
|
|
462
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .shared import ParseMetadata as ParseMetadata, ParseGroundingBox as ParseGroundingBox
|
|
6
|
+
from .parse_response import ParseResponse as ParseResponse
|
|
7
|
+
from .extract_response import ExtractResponse as ExtractResponse
|
|
8
|
+
from .client_parse_params import ClientParseParams as ClientParseParams
|
|
9
|
+
from .client_extract_params import ClientExtractParams as ClientExtractParams
|
|
10
|
+
from .parse_job_list_params import ParseJobListParams as ParseJobListParams
|
|
11
|
+
from .parse_job_get_response import ParseJobGetResponse as ParseJobGetResponse
|
|
12
|
+
from .parse_job_create_params import ParseJobCreateParams as ParseJobCreateParams
|
|
13
|
+
from .parse_job_list_response import ParseJobListResponse as ParseJobListResponse
|
|
14
|
+
from .parse_job_create_response import ParseJobCreateResponse as ParseJobCreateResponse
|