You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-17Lines changed: 7 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,9 +172,7 @@ from landingai_ade import LandingAIADE
172
172
client = LandingAIADE()
173
173
174
174
try:
175
-
client.extract(
176
-
schema="schema",
177
-
)
175
+
client.parse()
178
176
except landingai_ade.APIConnectionError as e:
179
177
print("The server could not be reached")
180
178
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -217,9 +215,7 @@ client = LandingAIADE(
217
215
)
218
216
219
217
# Or, configure per-request:
220
-
client.with_options(max_retries=5).extract(
221
-
schema="schema",
222
-
)
218
+
client.with_options(max_retries=5).parse()
223
219
```
224
220
225
221
### Timeouts
@@ -242,9 +238,7 @@ client = LandingAIADE(
242
238
)
243
239
244
240
# Override per-request:
245
-
client.with_options(timeout=5.0).extract(
246
-
schema="schema",
247
-
)
241
+
client.with_options(timeout=5.0).parse()
248
242
```
249
243
250
244
On timeout, an `APITimeoutError` is thrown.
@@ -285,13 +279,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
285
279
from landingai_ade import LandingAIADE
286
280
287
281
client = LandingAIADE()
288
-
response = client.with_raw_response.extract(
289
-
schema="schema",
290
-
)
282
+
response = client.with_raw_response.parse()
291
283
print(response.headers.get('X-My-Header'))
292
284
293
-
client = response.parse() # get the object that `extract()` would have returned
294
-
print(client.extraction)
285
+
client = response.parse() # get the object that `parse()` would have returned
286
+
print(client.chunks)
295
287
```
296
288
297
289
These methods return an [`APIResponse`](https://github.com/landing-ai/ade-python/tree/main/src/landingai_ade/_response.py) object.
@@ -305,9 +297,7 @@ The above interface eagerly reads the full response body when you make the reque
305
297
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
306
298
307
299
```python
308
-
with client.with_streaming_response.extract(
309
-
schema="schema",
310
-
) as response:
300
+
with client.with_streaming_response.parse() as response:
0 commit comments