landingai-ade 0.13.0__py3-none-any.whl → 0.14.0__py3-none-any.whl

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/_client.py CHANGED
@@ -237,7 +237,7 @@ class LandingAIADE(SyncAPIClient):
237
237
  schema: str,
238
238
  markdown: Optional[FileTypes] | Omit = omit,
239
239
  markdown_url: Optional[str] | Omit = omit,
240
- model: Optional[str] | Omit = omit,
240
+ model: Optional[Literal["extract-20250630", "extract-20250930"]] | Omit = omit,
241
241
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
242
242
  # The extra values given here take precedence over values defined on the client or passed to this method.
243
243
  extra_headers: Headers | None = None,
@@ -260,7 +260,7 @@ class LandingAIADE(SyncAPIClient):
260
260
  are extracted from the Markdown. The schema must be a valid JSON object and will
261
261
  be validated before processing the document.
262
262
 
263
- markdown: The Markdown file to extract data from.
263
+ markdown: The Markdown file or Markdown content to extract data from.
264
264
 
265
265
  markdown_url: The URL to the Markdown file to extract data from.
266
266
 
@@ -291,7 +291,6 @@ class LandingAIADE(SyncAPIClient):
291
291
  # multipart/form-data; boundary=---abc--
292
292
  extra_headers = {
293
293
  "Content-Type": "multipart/form-data",
294
- "runtime_tag": f"ade-python-v{_LIB_VERSION}",
295
294
  **(extra_headers or {}),
296
295
  }
297
296
  return self.post(
@@ -331,15 +330,13 @@ class LandingAIADE(SyncAPIClient):
331
330
  `https://api.va.eu-west-1.landing.ai/v1/ade/parse`.
332
331
 
333
332
  Args:
334
- document: A file to be parsed. The file can be a PDF (50 pages max) or an image (50MB).
335
- See the list of supported file types here
336
- (https://docs.landing.ai/ade/ade-file-types). Either this parameter or the
337
- document_url parameter must be provided.
333
+ document: A file to be parsed. The file can be a PDF or an image. See the list of
334
+ supported file types here: https://docs.landing.ai/ade/ade-file-types. Either
335
+ this parameter or the `document_url` parameter must be provided.
338
336
 
339
- document_url: The URL to the file to be parsed. The file can be a PDF (50 pages max) or an
340
- image (50MB). See the list of supported file types here
341
- (https://docs.landing.ai/ade/ade-file-types). Either this parameter or the
342
- document parameter must be provided.
337
+ document_url: The URL to the file to be parsed. The file can be a PDF or an image. See the
338
+ list of supported file types here: https://docs.landing.ai/ade/ade-file-types.
339
+ Either this parameter or the `document` parameter must be provided.
343
340
 
344
341
  model: The version of the model to use for parsing.
345
342
 
@@ -586,7 +583,7 @@ class AsyncLandingAIADE(AsyncAPIClient):
586
583
  schema: str,
587
584
  markdown: Optional[FileTypes] | Omit = omit,
588
585
  markdown_url: Optional[str] | Omit = omit,
589
- model: Optional[str] | Omit = omit,
586
+ model: Optional[Literal["extract-20250630", "extract-20250930"]] | Omit = omit,
590
587
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
591
588
  # The extra values given here take precedence over values defined on the client or passed to this method.
592
589
  extra_headers: Headers | None = None,
@@ -609,7 +606,7 @@ class AsyncLandingAIADE(AsyncAPIClient):
609
606
  are extracted from the Markdown. The schema must be a valid JSON object and will
610
607
  be validated before processing the document.
611
608
 
612
- markdown: The Markdown file to extract data from.
609
+ markdown: The Markdown file or Markdown content to extract data from.
613
610
 
614
611
  markdown_url: The URL to the Markdown file to extract data from.
615
612
 
@@ -640,7 +637,6 @@ class AsyncLandingAIADE(AsyncAPIClient):
640
637
  # multipart/form-data; boundary=---abc--
641
638
  extra_headers = {
642
639
  "Content-Type": "multipart/form-data",
643
- "runtime_tag": f"ade-python-v{_LIB_VERSION}",
644
640
  **(extra_headers or {}),
645
641
  }
646
642
  return await self.post(
@@ -680,15 +676,13 @@ class AsyncLandingAIADE(AsyncAPIClient):
680
676
  `https://api.va.eu-west-1.landing.ai/v1/ade/parse`.
681
677
 
682
678
  Args:
683
- document: A file to be parsed. The file can be a PDF (50 pages max) or an image (50MB).
684
- See the list of supported file types here
685
- (https://docs.landing.ai/ade/ade-file-types). Either this parameter or the
686
- document_url parameter must be provided.
687
-
688
- document_url: The URL to the file to be parsed. The file can be a PDF (50 pages max) or an
689
- image (50MB). See the list of supported file types here
690
- (https://docs.landing.ai/ade/ade-file-types). Either this parameter or the
691
- document parameter must be provided.
679
+ document: A file to be parsed. The file can be a PDF or an image. See the list of
680
+ supported file types here: https://docs.landing.ai/ade/ade-file-types. Either
681
+ this parameter or the `document_url` parameter must be provided.
682
+
683
+ document_url: The URL to the file to be parsed. The file can be a PDF or an image. See the
684
+ list of supported file types here: https://docs.landing.ai/ade/ade-file-types.
685
+ Either this parameter or the `document` parameter must be provided.
692
686
 
693
687
  model: The version of the model to use for parsing.
694
688
 
landingai_ade/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "landingai_ade"
4
- __version__ = "0.13.0" # x-release-please-version
4
+ __version__ = "0.14.0" # x-release-please-version
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Optional
6
- from typing_extensions import Required, TypedDict
6
+ from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .._types import FileTypes
9
9
 
@@ -20,10 +20,10 @@ class ClientExtractParams(TypedDict, total=False):
20
20
  """
21
21
 
22
22
  markdown: Optional[FileTypes]
23
- """The Markdown file to extract data from."""
23
+ """The Markdown file or Markdown content to extract data from."""
24
24
 
25
25
  markdown_url: Optional[str]
26
26
  """The URL to the Markdown file to extract data from."""
27
27
 
28
- model: Optional[str]
28
+ model: Optional[Literal["extract-20250630", "extract-20250930"]]
29
29
  """The version of the model to use for extraction."""
@@ -14,17 +14,17 @@ class ClientParseParams(TypedDict, total=False):
14
14
  document: Optional[FileTypes]
15
15
  """A file to be parsed.
16
16
 
17
- The file can be a PDF (50 pages max) or an image (50MB). See the list of
18
- supported file types here (https://docs.landing.ai/ade/ade-file-types). Either
19
- this parameter or the document_url parameter must be provided.
17
+ The file can be a PDF or an image. See the list of supported file types here:
18
+ https://docs.landing.ai/ade/ade-file-types. Either this parameter or the
19
+ `document_url` parameter must be provided.
20
20
  """
21
21
 
22
22
  document_url: Optional[str]
23
23
  """The URL to the file to be parsed.
24
24
 
25
- The file can be a PDF (50 pages max) or an image (50MB). See the list of
26
- supported file types here (https://docs.landing.ai/ade/ade-file-types). Either
27
- this parameter or the document parameter must be provided.
25
+ The file can be a PDF or an image. See the list of supported file types here:
26
+ https://docs.landing.ai/ade/ade-file-types. Either this parameter or the
27
+ `document` parameter must be provided.
28
28
  """
29
29
 
30
30
  model: Optional[str]
@@ -1,12 +1,22 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import List, Optional
3
+ from typing import Dict, List, Optional
4
+ from typing_extensions import Literal
4
5
 
5
6
  from pydantic import Field as FieldInfo
6
7
 
7
8
  from .._models import BaseModel
8
9
 
9
- __all__ = ["ParseResponse", "Chunk", "ChunkGrounding", "ChunkGroundingBox", "Metadata", "Split"]
10
+ __all__ = [
11
+ "ParseResponse",
12
+ "Chunk",
13
+ "ChunkGrounding",
14
+ "ChunkGroundingBox",
15
+ "Metadata",
16
+ "Split",
17
+ "Grounding",
18
+ "GroundingBox",
19
+ ]
10
20
 
11
21
 
12
22
  class ChunkGroundingBox(BaseModel):
@@ -28,12 +38,12 @@ class ChunkGrounding(BaseModel):
28
38
  class Chunk(BaseModel):
29
39
  id: str
30
40
 
41
+ grounding: ChunkGrounding
42
+
31
43
  markdown: str
32
44
 
33
45
  type: str
34
46
 
35
- grounding: Optional[ChunkGrounding] = None
36
-
37
47
 
38
48
  class Metadata(BaseModel):
39
49
  credit_usage: float
@@ -63,6 +73,41 @@ class Split(BaseModel):
63
73
  pages: List[int]
64
74
 
65
75
 
76
+ class GroundingBox(BaseModel):
77
+ bottom: float
78
+
79
+ left: float
80
+
81
+ right: float
82
+
83
+ top: float
84
+
85
+
86
+ class Grounding(BaseModel):
87
+ box: GroundingBox
88
+
89
+ page: int
90
+
91
+ type: Literal[
92
+ "chunkLogo",
93
+ "chunkCard",
94
+ "chunkAttestation",
95
+ "chunkScanCode",
96
+ "chunkForm",
97
+ "chunkTable",
98
+ "chunkFigure",
99
+ "chunkText",
100
+ "chunkMarginalia",
101
+ "chunkTitle",
102
+ "chunkPageHeader",
103
+ "chunkPageFooter",
104
+ "chunkPageNumber",
105
+ "chunkKeyValue",
106
+ "table",
107
+ "tableCell",
108
+ ]
109
+
110
+
66
111
  class ParseResponse(BaseModel):
67
112
  chunks: List[Chunk]
68
113
 
@@ -71,3 +116,5 @@ class ParseResponse(BaseModel):
71
116
  metadata: Metadata
72
117
 
73
118
  splits: List[Split]
119
+
120
+ grounding: Optional[Dict[str, Grounding]] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: landingai-ade
3
- Version: 0.13.0
3
+ Version: 0.14.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
@@ -74,7 +74,7 @@ client = LandingAIADE(
74
74
  )
75
75
 
76
76
  response = client.parse(
77
- # support document or document_url
77
+ # support document as File or document_url as local path/remote url
78
78
  document_url="path/to/file",
79
79
  model="dpt-2-latest",
80
80
  )
@@ -105,7 +105,7 @@ schema = pydantic_to_json_schema(Person)
105
105
  client = LandingAIADE(apikey=os.environ.get("VISION_AGENT_API_KEY"))
106
106
  response = client.extract(
107
107
  schema=schema,
108
- # support markdown or markdown_url
108
+ # support markdown as File or markdown_url as local path/remote url
109
109
  markdown=Path('path/to/file.md')
110
110
  )
111
111
  ```
@@ -1,6 +1,6 @@
1
1
  landingai_ade/__init__.py,sha256=tyK5QngTNcumeBQ-uhvyRts2TtXr0eAR5rofvktz7JA,2760
2
2
  landingai_ade/_base_client.py,sha256=vIP54_-Z2Yetpi2x_3RCVmlu7G48VMSe8j18zhXzunQ,67054
3
- landingai_ade/_client.py,sha256=YWCzNEpumrvcDC3zxILvALBr8tlXy94EqX7LaeWX7qY,31604
3
+ landingai_ade/_client.py,sha256=o6799t0O9F34KCl38rmqVkTJBrP73DKqcodr68I7OJM,31476
4
4
  landingai_ade/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
5
5
  landingai_ade/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  landingai_ade/_exceptions.py,sha256=bunb9U_h8wb2_IA8tRYVuTx-clbqqDgX8pjmdgX10d8,3232
@@ -11,7 +11,7 @@ landingai_ade/_resource.py,sha256=fZFMI9zYnf0F6ACBB8teJVzhBelkymH2SMQripxfTvI,11
11
11
  landingai_ade/_response.py,sha256=qUH6kfV7CszYHyJKTrJXtJY5b2zPizEM6HyGgsisLtI,28858
12
12
  landingai_ade/_streaming.py,sha256=V4RaEBKfcNOdOfTAwMzlx_klsTLILvpnS7PvBWC5Exw,10124
13
13
  landingai_ade/_types.py,sha256=NLzflzcpP13aYUFLmQMB1XUiX98QV0XwIljPyVDXm8k,7243
14
- landingai_ade/_version.py,sha256=sN1bVMy1DBqv8pMiWTWNgDjBGs9IYPYjPrQrXGtBqCE,166
14
+ landingai_ade/_version.py,sha256=cQvSGUbijp3g1gFpXEui8kM7IGbKYSRJBwzD63L9Grk,166
15
15
  landingai_ade/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  landingai_ade/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  landingai_ade/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
@@ -31,11 +31,11 @@ landingai_ade/lib/schema_utils.py,sha256=TdfJbeyRaKuaaNpookuFwqasjxcYBXp0nvp3h9k
31
31
  landingai_ade/lib/url_utils.py,sha256=ydhsvrpcdM4DBoZOIbp83dME9FeKotUDtpzFVU9FZUE,1797
32
32
  landingai_ade/resources/__init__.py,sha256=ikKh5ucm9qFI-Z42nOKxhBhEI-YHaaxvsSddO_Nx0-Y,86
33
33
  landingai_ade/types/__init__.py,sha256=afoInmNk4PL0G9bmARTsVXzAhFCGNtx5LFSKwm9VYq8,397
34
- landingai_ade/types/client_extract_params.py,sha256=XyR0xk0LzFe36ACBFGr2HKv4S1VMpUyajLp_Cxi1O8I,843
35
- landingai_ade/types/client_parse_params.py,sha256=_9AGv7yaAfXszlwHCb44JazD98Rkx2hqi259xp9YBMU,1292
34
+ landingai_ade/types/client_extract_params.py,sha256=Bafii5ZKxhKFed3OqRSId22pYGOEqtE5uNX-CgrfydE,916
35
+ landingai_ade/types/client_parse_params.py,sha256=sTqMewspihj9q4BcgBYGoSJJlDjapsvPYBeoYlUAXp0,1250
36
36
  landingai_ade/types/extract_response.py,sha256=mAxHf_kqtu5y46GRTaq4KxhZ97oI-t7LD4qvEUduxf4,657
37
- landingai_ade/types/parse_response.py,sha256=5UNneeknxzGAhOIWl1CYb18ZGu9S4l6VUFpT41Bqb0w,1078
38
- landingai_ade-0.13.0.dist-info/METADATA,sha256=G3BliqHcm-GnZ22UPwFnRRC0vpoIxLLxLbhbY8Wum9o,15222
39
- landingai_ade-0.13.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
40
- landingai_ade-0.13.0.dist-info/licenses/LICENSE,sha256=xQsP4c8KA_Ov7OhSD-tj_2U8RQ8z9MQUy-WEjgbJdZU,11343
41
- landingai_ade-0.13.0.dist-info/RECORD,,
37
+ landingai_ade/types/parse_response.py,sha256=K-Ig1Ak2S7pMyBNbnR5yM5ZXkOAtH3PAnu4NtFNusrc,1793
38
+ landingai_ade-0.14.0.dist-info/METADATA,sha256=MJivT8JUz6ttsq5tlPRd79J2sY7IH1KZYqFcOxlfuxE,15288
39
+ landingai_ade-0.14.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
40
+ landingai_ade-0.14.0.dist-info/licenses/LICENSE,sha256=xQsP4c8KA_Ov7OhSD-tj_2U8RQ8z9MQUy-WEjgbJdZU,11343
41
+ landingai_ade-0.14.0.dist-info/RECORD,,