landingai-ade 0.18.1__py3-none-any.whl → 0.18.3__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/_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.18.1" # x-release-please-version
4
+ __version__ = "0.18.3" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: landingai-ade
3
- Version: 0.18.1
3
+ Version: 0.18.3
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
@@ -65,6 +65,7 @@ The full API of this library can be found in [api.md](https://github.com/landing
65
65
 
66
66
  ```python
67
67
  import os
68
+ from pathlib import Path
68
69
  from landingai_ade import LandingAIADE
69
70
 
70
71
  client = LandingAIADE(
@@ -74,8 +75,8 @@ client = LandingAIADE(
74
75
  )
75
76
 
76
77
  response = client.parse(
77
- # support document as File or document_url as local path/remote url
78
- document_url="path/to/file",
78
+ # use document= for local files, document_url= for remote URLs
79
+ document=Path("path/to/file"),
79
80
  model="dpt-2-latest",
80
81
  )
81
82
  print(response.chunks)
@@ -86,36 +87,13 @@ we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
86
87
  to add `VISION_AGENT_API_KEY="My Apikey"` to your `.env` file
87
88
  so that your Apikey is not stored in source control.
88
89
 
89
- ### Extract
90
-
91
- ```python
92
- from landingai_ade import LandingAIADE
93
- from landingai_ade.lib import pydantic_to_json_schema
94
- from pydantic import BaseModel, Field
95
- from pathlib import Path
96
-
97
- # Define your schema
98
- class Person(BaseModel):
99
- name: str = Field(description="Person's name")
100
- age: int = Field(description="Person's age")
101
-
102
- # Convert to JSON schema
103
- schema = pydantic_to_json_schema(Person)
104
- # Use with the SDK
105
- client = LandingAIADE(apikey=os.environ.get("VISION_AGENT_API_KEY"))
106
- response = client.extract(
107
- schema=schema,
108
- # support markdown as File or markdown_url as local path/remote url
109
- markdown=Path('path/to/file.md')
110
- )
111
- ```
112
-
113
90
  ### Parse Jobs
114
91
 
115
- For processing large documents or batches of documents asynchronously:
92
+ For processing large documents asynchronously:
116
93
 
117
94
  ```python
118
95
  import os
96
+ from pathlib import Path
119
97
  from landingai_ade import LandingAIADE
120
98
 
121
99
  client = LandingAIADE(
@@ -124,7 +102,7 @@ client = LandingAIADE(
124
102
 
125
103
  # Create an async parse job
126
104
  job = client.parse_jobs.create(
127
- document_url="path/to/large_file.pdf",
105
+ document=Path("path/to/large_file.pdf"),
128
106
  model="dpt-2-latest",
129
107
  )
130
108
  print(f"Job created with ID: {job.job_id}")
@@ -143,6 +121,31 @@ for job in response.jobs:
143
121
  print(f"Job {job.job_id}: {job.status}")
144
122
  ```
145
123
 
124
+ ### Extract
125
+
126
+ ```python
127
+ import os
128
+ from pathlib import Path
129
+ from landingai_ade import LandingAIADE
130
+ from landingai_ade.lib import pydantic_to_json_schema
131
+ from pydantic import BaseModel, Field
132
+
133
+ # Define your schema
134
+ class Person(BaseModel):
135
+ name: str = Field(description="Person's name")
136
+ age: int = Field(description="Person's age")
137
+
138
+ # Convert to JSON schema
139
+ schema = pydantic_to_json_schema(Person)
140
+ # Use with the SDK
141
+ client = LandingAIADE(apikey=os.environ.get("VISION_AGENT_API_KEY"))
142
+ response = client.extract(
143
+ schema=schema,
144
+ # use markdown= for local files, markdown_url= for remote URLs
145
+ markdown=Path('path/to/file.md')
146
+ )
147
+ ```
148
+
146
149
  ## Async usage
147
150
 
148
151
  Simply import `AsyncLandingAIADE` instead of `LandingAIADE` and use `await` with each API call:
@@ -150,6 +153,7 @@ Simply import `AsyncLandingAIADE` instead of `LandingAIADE` and use `await` with
150
153
  ```python
151
154
  import os
152
155
  import asyncio
156
+ from pathlib import Path
153
157
  from landingai_ade import AsyncLandingAIADE
154
158
 
155
159
  client = AsyncLandingAIADE(
@@ -161,7 +165,7 @@ client = AsyncLandingAIADE(
161
165
 
162
166
  async def main() -> None:
163
167
  response = await client.parse(
164
- document_url="path/to/file",
168
+ document=Path("path/to/file"),
165
169
  model="dpt-2-latest",
166
170
  )
167
171
  print(response.chunks)
@@ -187,6 +191,7 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
187
191
 
188
192
  ```python
189
193
  import asyncio
194
+ from pathlib import Path
190
195
  from landingai_ade import DefaultAioHttpClient
191
196
  from landingai_ade import AsyncLandingAIADE
192
197
 
@@ -197,7 +202,7 @@ async def main() -> None:
197
202
  http_client=DefaultAioHttpClient(),
198
203
  ) as client:
199
204
  response = await client.parse(
200
- document_url="path/to/file",
205
+ document=Path("path/to/file"),
201
206
  model="dpt-2-latest",
202
207
  )
203
208
  print(response.chunks)
@@ -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=8of7ETx2GzlS0kq-JMky4iQt-ZtOQeppgwjQMFF85nw,7253
14
- landingai_ade/_version.py,sha256=J0nnSdAhAwIhIfQCi8w7YdO3y9QHkqbcM9bCD03XT6g,166
14
+ landingai_ade/_version.py,sha256=pwLfShhGC5beob06aE9l9WrY1tOTrwF5wcGD1UyMLt0,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
@@ -44,7 +44,7 @@ landingai_ade/types/parse_response.py,sha256=yr_IvBPWJBwK22FJ3spqcdvaD19enADGBZx
44
44
  landingai_ade/types/shared/__init__.py,sha256=n7dKpO8IQEstmlDczxcje4R_Kkg9EKn3UMejh8Q7_ns,218
45
45
  landingai_ade/types/shared/parse_grounding_box.py,sha256=tZ85sGAtkcTs-_jiVjD-hK8tHTn6vh6VHEW_ndmBB3w,260
46
46
  landingai_ade/types/shared/parse_metadata.py,sha256=r509Ig1rWW96pplh3PR25wNH40mGJBFENgsLvSFmHgY,384
47
- landingai_ade-0.18.1.dist-info/METADATA,sha256=bL72j-YFnz8_lHPdeluZ_hqIni-cd0KPgOJ6naF3xJ4,16003
48
- landingai_ade-0.18.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
49
- landingai_ade-0.18.1.dist-info/licenses/LICENSE,sha256=xQsP4c8KA_Ov7OhSD-tj_2U8RQ8z9MQUy-WEjgbJdZU,11343
50
- landingai_ade-0.18.1.dist-info/RECORD,,
47
+ landingai_ade-0.18.3.dist-info/METADATA,sha256=WcH63vjWEv-6DIqODfJBIV36QxQWvBUZz0dMtGbtqjM,16087
48
+ landingai_ade-0.18.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
49
+ landingai_ade-0.18.3.dist-info/licenses/LICENSE,sha256=xQsP4c8KA_Ov7OhSD-tj_2U8RQ8z9MQUy-WEjgbJdZU,11343
50
+ landingai_ade-0.18.3.dist-info/RECORD,,