llama-cloud 0.1.14__py3-none-any.whl → 0.1.15__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 llama-cloud might be problematic. Click here for more details.
- llama_cloud/__init__.py +8 -0
- llama_cloud/resources/llama_extract/client.py +168 -6
- llama_cloud/resources/parsing/client.py +0 -8
- llama_cloud/types/__init__.py +8 -0
- llama_cloud/types/chunk_mode.py +4 -0
- llama_cloud/types/extract_job_create_batch.py +42 -0
- llama_cloud/types/extract_job_create_batch_data_schema_override.py +9 -0
- llama_cloud/types/extract_job_create_batch_data_schema_override_zero_value.py +7 -0
- llama_cloud/types/llama_parse_parameters.py +0 -1
- llama_cloud/types/paginated_extract_runs_response.py +39 -0
- llama_cloud/types/usage.py +2 -1
- {llama_cloud-0.1.14.dist-info → llama_cloud-0.1.15.dist-info}/METADATA +1 -1
- {llama_cloud-0.1.14.dist-info → llama_cloud-0.1.15.dist-info}/RECORD +15 -11
- {llama_cloud-0.1.14.dist-info → llama_cloud-0.1.15.dist-info}/LICENSE +0 -0
- {llama_cloud-0.1.14.dist-info → llama_cloud-0.1.15.dist-info}/WHEEL +0 -0
llama_cloud/__init__.py
CHANGED
|
@@ -116,6 +116,9 @@ from .types import (
|
|
|
116
116
|
ExtractConfig,
|
|
117
117
|
ExtractJob,
|
|
118
118
|
ExtractJobCreate,
|
|
119
|
+
ExtractJobCreateBatch,
|
|
120
|
+
ExtractJobCreateBatchDataSchemaOverride,
|
|
121
|
+
ExtractJobCreateBatchDataSchemaOverrideZeroValue,
|
|
119
122
|
ExtractJobCreateDataSchemaOverride,
|
|
120
123
|
ExtractJobCreateDataSchemaOverrideZeroValue,
|
|
121
124
|
ExtractMode,
|
|
@@ -194,6 +197,7 @@ from .types import (
|
|
|
194
197
|
PageScreenshotNodeWithScore,
|
|
195
198
|
PageSegmentationConfig,
|
|
196
199
|
PageSplitterNodeParser,
|
|
200
|
+
PaginatedExtractRunsResponse,
|
|
197
201
|
PaginatedJobsHistoryWithMetrics,
|
|
198
202
|
PaginatedListCloudDocumentsResponse,
|
|
199
203
|
PaginatedListPipelineFilesResponse,
|
|
@@ -490,6 +494,9 @@ __all__ = [
|
|
|
490
494
|
"ExtractConfig",
|
|
491
495
|
"ExtractJob",
|
|
492
496
|
"ExtractJobCreate",
|
|
497
|
+
"ExtractJobCreateBatch",
|
|
498
|
+
"ExtractJobCreateBatchDataSchemaOverride",
|
|
499
|
+
"ExtractJobCreateBatchDataSchemaOverrideZeroValue",
|
|
493
500
|
"ExtractJobCreateDataSchemaOverride",
|
|
494
501
|
"ExtractJobCreateDataSchemaOverrideZeroValue",
|
|
495
502
|
"ExtractMode",
|
|
@@ -572,6 +579,7 @@ __all__ = [
|
|
|
572
579
|
"PageScreenshotNodeWithScore",
|
|
573
580
|
"PageSegmentationConfig",
|
|
574
581
|
"PageSplitterNodeParser",
|
|
582
|
+
"PaginatedExtractRunsResponse",
|
|
575
583
|
"PaginatedJobsHistoryWithMetrics",
|
|
576
584
|
"PaginatedListCloudDocumentsResponse",
|
|
577
585
|
"PaginatedListPipelineFilesResponse",
|
|
@@ -14,12 +14,14 @@ from ...types.extract_agent_create import ExtractAgentCreate
|
|
|
14
14
|
from ...types.extract_agent_update import ExtractAgentUpdate
|
|
15
15
|
from ...types.extract_job import ExtractJob
|
|
16
16
|
from ...types.extract_job_create import ExtractJobCreate
|
|
17
|
+
from ...types.extract_job_create_batch import ExtractJobCreateBatch
|
|
17
18
|
from ...types.extract_resultset import ExtractResultset
|
|
18
19
|
from ...types.extract_run import ExtractRun
|
|
19
20
|
from ...types.extract_schema_validate_request import ExtractSchemaValidateRequest
|
|
20
21
|
from ...types.extract_schema_validate_response import ExtractSchemaValidateResponse
|
|
21
22
|
from ...types.http_validation_error import HttpValidationError
|
|
22
23
|
from ...types.llama_extract_settings import LlamaExtractSettings
|
|
24
|
+
from ...types.paginated_extract_runs_response import PaginatedExtractRunsResponse
|
|
23
25
|
|
|
24
26
|
try:
|
|
25
27
|
import pydantic
|
|
@@ -469,6 +471,50 @@ class LlamaExtractClient:
|
|
|
469
471
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
470
472
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
471
473
|
|
|
474
|
+
def run_batch_jobs(self, *, request: ExtractJobCreateBatch) -> typing.List[ExtractJob]:
|
|
475
|
+
"""
|
|
476
|
+
Parameters:
|
|
477
|
+
- request: ExtractJobCreateBatch.
|
|
478
|
+
---
|
|
479
|
+
from llama_cloud import (
|
|
480
|
+
ExtractConfig,
|
|
481
|
+
ExtractJobCreateBatch,
|
|
482
|
+
ExtractMode,
|
|
483
|
+
ExtractTarget,
|
|
484
|
+
)
|
|
485
|
+
from llama_cloud.client import LlamaCloud
|
|
486
|
+
|
|
487
|
+
client = LlamaCloud(
|
|
488
|
+
token="YOUR_TOKEN",
|
|
489
|
+
)
|
|
490
|
+
client.llama_extract.run_batch_jobs(
|
|
491
|
+
request=ExtractJobCreateBatch(
|
|
492
|
+
extraction_agent_id="string",
|
|
493
|
+
file_ids=[],
|
|
494
|
+
config_override=ExtractConfig(
|
|
495
|
+
extraction_target=ExtractTarget.PER_DOC,
|
|
496
|
+
extraction_mode=ExtractMode.FAST,
|
|
497
|
+
),
|
|
498
|
+
),
|
|
499
|
+
)
|
|
500
|
+
"""
|
|
501
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
502
|
+
"POST",
|
|
503
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/jobs/batch"),
|
|
504
|
+
json=jsonable_encoder(request),
|
|
505
|
+
headers=self._client_wrapper.get_headers(),
|
|
506
|
+
timeout=60,
|
|
507
|
+
)
|
|
508
|
+
if 200 <= _response.status_code < 300:
|
|
509
|
+
return pydantic.parse_obj_as(typing.List[ExtractJob], _response.json()) # type: ignore
|
|
510
|
+
if _response.status_code == 422:
|
|
511
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
512
|
+
try:
|
|
513
|
+
_response_json = _response.json()
|
|
514
|
+
except JSONDecodeError:
|
|
515
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
516
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
517
|
+
|
|
472
518
|
def get_job_result(self, job_id: str) -> ExtractResultset:
|
|
473
519
|
"""
|
|
474
520
|
Parameters:
|
|
@@ -499,10 +545,16 @@ class LlamaExtractClient:
|
|
|
499
545
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
500
546
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
501
547
|
|
|
502
|
-
def list_extract_runs(
|
|
548
|
+
def list_extract_runs(
|
|
549
|
+
self, *, extraction_agent_id: str, skip: typing.Optional[int] = None, limit: typing.Optional[int] = None
|
|
550
|
+
) -> PaginatedExtractRunsResponse:
|
|
503
551
|
"""
|
|
504
552
|
Parameters:
|
|
505
553
|
- extraction_agent_id: str.
|
|
554
|
+
|
|
555
|
+
- skip: typing.Optional[int].
|
|
556
|
+
|
|
557
|
+
- limit: typing.Optional[int].
|
|
506
558
|
---
|
|
507
559
|
from llama_cloud.client import LlamaCloud
|
|
508
560
|
|
|
@@ -516,12 +568,12 @@ class LlamaExtractClient:
|
|
|
516
568
|
_response = self._client_wrapper.httpx_client.request(
|
|
517
569
|
"GET",
|
|
518
570
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/runs"),
|
|
519
|
-
params=remove_none_from_dict({"extraction_agent_id": extraction_agent_id}),
|
|
571
|
+
params=remove_none_from_dict({"extraction_agent_id": extraction_agent_id, "skip": skip, "limit": limit}),
|
|
520
572
|
headers=self._client_wrapper.get_headers(),
|
|
521
573
|
timeout=60,
|
|
522
574
|
)
|
|
523
575
|
if 200 <= _response.status_code < 300:
|
|
524
|
-
return pydantic.parse_obj_as(
|
|
576
|
+
return pydantic.parse_obj_as(PaginatedExtractRunsResponse, _response.json()) # type: ignore
|
|
525
577
|
if _response.status_code == 422:
|
|
526
578
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
527
579
|
try:
|
|
@@ -590,6 +642,36 @@ class LlamaExtractClient:
|
|
|
590
642
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
591
643
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
592
644
|
|
|
645
|
+
def delete_extraction_run(self, run_id: str) -> typing.Any:
|
|
646
|
+
"""
|
|
647
|
+
Parameters:
|
|
648
|
+
- run_id: str.
|
|
649
|
+
---
|
|
650
|
+
from llama_cloud.client import LlamaCloud
|
|
651
|
+
|
|
652
|
+
client = LlamaCloud(
|
|
653
|
+
token="YOUR_TOKEN",
|
|
654
|
+
)
|
|
655
|
+
client.llama_extract.delete_extraction_run(
|
|
656
|
+
run_id="string",
|
|
657
|
+
)
|
|
658
|
+
"""
|
|
659
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
660
|
+
"DELETE",
|
|
661
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
662
|
+
headers=self._client_wrapper.get_headers(),
|
|
663
|
+
timeout=60,
|
|
664
|
+
)
|
|
665
|
+
if 200 <= _response.status_code < 300:
|
|
666
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
|
667
|
+
if _response.status_code == 422:
|
|
668
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
669
|
+
try:
|
|
670
|
+
_response_json = _response.json()
|
|
671
|
+
except JSONDecodeError:
|
|
672
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
673
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
674
|
+
|
|
593
675
|
|
|
594
676
|
class AsyncLlamaExtractClient:
|
|
595
677
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -1029,6 +1111,50 @@ class AsyncLlamaExtractClient:
|
|
|
1029
1111
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1030
1112
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1031
1113
|
|
|
1114
|
+
async def run_batch_jobs(self, *, request: ExtractJobCreateBatch) -> typing.List[ExtractJob]:
|
|
1115
|
+
"""
|
|
1116
|
+
Parameters:
|
|
1117
|
+
- request: ExtractJobCreateBatch.
|
|
1118
|
+
---
|
|
1119
|
+
from llama_cloud import (
|
|
1120
|
+
ExtractConfig,
|
|
1121
|
+
ExtractJobCreateBatch,
|
|
1122
|
+
ExtractMode,
|
|
1123
|
+
ExtractTarget,
|
|
1124
|
+
)
|
|
1125
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
1126
|
+
|
|
1127
|
+
client = AsyncLlamaCloud(
|
|
1128
|
+
token="YOUR_TOKEN",
|
|
1129
|
+
)
|
|
1130
|
+
await client.llama_extract.run_batch_jobs(
|
|
1131
|
+
request=ExtractJobCreateBatch(
|
|
1132
|
+
extraction_agent_id="string",
|
|
1133
|
+
file_ids=[],
|
|
1134
|
+
config_override=ExtractConfig(
|
|
1135
|
+
extraction_target=ExtractTarget.PER_DOC,
|
|
1136
|
+
extraction_mode=ExtractMode.FAST,
|
|
1137
|
+
),
|
|
1138
|
+
),
|
|
1139
|
+
)
|
|
1140
|
+
"""
|
|
1141
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1142
|
+
"POST",
|
|
1143
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/jobs/batch"),
|
|
1144
|
+
json=jsonable_encoder(request),
|
|
1145
|
+
headers=self._client_wrapper.get_headers(),
|
|
1146
|
+
timeout=60,
|
|
1147
|
+
)
|
|
1148
|
+
if 200 <= _response.status_code < 300:
|
|
1149
|
+
return pydantic.parse_obj_as(typing.List[ExtractJob], _response.json()) # type: ignore
|
|
1150
|
+
if _response.status_code == 422:
|
|
1151
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1152
|
+
try:
|
|
1153
|
+
_response_json = _response.json()
|
|
1154
|
+
except JSONDecodeError:
|
|
1155
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1156
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1157
|
+
|
|
1032
1158
|
async def get_job_result(self, job_id: str) -> ExtractResultset:
|
|
1033
1159
|
"""
|
|
1034
1160
|
Parameters:
|
|
@@ -1059,10 +1185,16 @@ class AsyncLlamaExtractClient:
|
|
|
1059
1185
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1060
1186
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1061
1187
|
|
|
1062
|
-
async def list_extract_runs(
|
|
1188
|
+
async def list_extract_runs(
|
|
1189
|
+
self, *, extraction_agent_id: str, skip: typing.Optional[int] = None, limit: typing.Optional[int] = None
|
|
1190
|
+
) -> PaginatedExtractRunsResponse:
|
|
1063
1191
|
"""
|
|
1064
1192
|
Parameters:
|
|
1065
1193
|
- extraction_agent_id: str.
|
|
1194
|
+
|
|
1195
|
+
- skip: typing.Optional[int].
|
|
1196
|
+
|
|
1197
|
+
- limit: typing.Optional[int].
|
|
1066
1198
|
---
|
|
1067
1199
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1068
1200
|
|
|
@@ -1076,12 +1208,12 @@ class AsyncLlamaExtractClient:
|
|
|
1076
1208
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1077
1209
|
"GET",
|
|
1078
1210
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/runs"),
|
|
1079
|
-
params=remove_none_from_dict({"extraction_agent_id": extraction_agent_id}),
|
|
1211
|
+
params=remove_none_from_dict({"extraction_agent_id": extraction_agent_id, "skip": skip, "limit": limit}),
|
|
1080
1212
|
headers=self._client_wrapper.get_headers(),
|
|
1081
1213
|
timeout=60,
|
|
1082
1214
|
)
|
|
1083
1215
|
if 200 <= _response.status_code < 300:
|
|
1084
|
-
return pydantic.parse_obj_as(
|
|
1216
|
+
return pydantic.parse_obj_as(PaginatedExtractRunsResponse, _response.json()) # type: ignore
|
|
1085
1217
|
if _response.status_code == 422:
|
|
1086
1218
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1087
1219
|
try:
|
|
@@ -1149,3 +1281,33 @@ class AsyncLlamaExtractClient:
|
|
|
1149
1281
|
except JSONDecodeError:
|
|
1150
1282
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1151
1283
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1284
|
+
|
|
1285
|
+
async def delete_extraction_run(self, run_id: str) -> typing.Any:
|
|
1286
|
+
"""
|
|
1287
|
+
Parameters:
|
|
1288
|
+
- run_id: str.
|
|
1289
|
+
---
|
|
1290
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
1291
|
+
|
|
1292
|
+
client = AsyncLlamaCloud(
|
|
1293
|
+
token="YOUR_TOKEN",
|
|
1294
|
+
)
|
|
1295
|
+
await client.llama_extract.delete_extraction_run(
|
|
1296
|
+
run_id="string",
|
|
1297
|
+
)
|
|
1298
|
+
"""
|
|
1299
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1300
|
+
"DELETE",
|
|
1301
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
1302
|
+
headers=self._client_wrapper.get_headers(),
|
|
1303
|
+
timeout=60,
|
|
1304
|
+
)
|
|
1305
|
+
if 200 <= _response.status_code < 300:
|
|
1306
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
|
1307
|
+
if _response.status_code == 422:
|
|
1308
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1309
|
+
try:
|
|
1310
|
+
_response_json = _response.json()
|
|
1311
|
+
except JSONDecodeError:
|
|
1312
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1313
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -212,7 +212,6 @@ class ParsingClient:
|
|
|
212
212
|
bbox_left: float,
|
|
213
213
|
bbox_right: float,
|
|
214
214
|
bbox_top: float,
|
|
215
|
-
compact_markdown_table: bool,
|
|
216
215
|
disable_ocr: bool,
|
|
217
216
|
disable_reconstruction: bool,
|
|
218
217
|
disable_image_extraction: bool,
|
|
@@ -314,8 +313,6 @@ class ParsingClient:
|
|
|
314
313
|
|
|
315
314
|
- bbox_top: float.
|
|
316
315
|
|
|
317
|
-
- compact_markdown_table: bool.
|
|
318
|
-
|
|
319
316
|
- disable_ocr: bool.
|
|
320
317
|
|
|
321
318
|
- disable_reconstruction: bool.
|
|
@@ -452,7 +449,6 @@ class ParsingClient:
|
|
|
452
449
|
"bbox_left": bbox_left,
|
|
453
450
|
"bbox_right": bbox_right,
|
|
454
451
|
"bbox_top": bbox_top,
|
|
455
|
-
"compact_markdown_table": compact_markdown_table,
|
|
456
452
|
"disable_ocr": disable_ocr,
|
|
457
453
|
"disable_reconstruction": disable_reconstruction,
|
|
458
454
|
"disable_image_extraction": disable_image_extraction,
|
|
@@ -1192,7 +1188,6 @@ class AsyncParsingClient:
|
|
|
1192
1188
|
bbox_left: float,
|
|
1193
1189
|
bbox_right: float,
|
|
1194
1190
|
bbox_top: float,
|
|
1195
|
-
compact_markdown_table: bool,
|
|
1196
1191
|
disable_ocr: bool,
|
|
1197
1192
|
disable_reconstruction: bool,
|
|
1198
1193
|
disable_image_extraction: bool,
|
|
@@ -1294,8 +1289,6 @@ class AsyncParsingClient:
|
|
|
1294
1289
|
|
|
1295
1290
|
- bbox_top: float.
|
|
1296
1291
|
|
|
1297
|
-
- compact_markdown_table: bool.
|
|
1298
|
-
|
|
1299
1292
|
- disable_ocr: bool.
|
|
1300
1293
|
|
|
1301
1294
|
- disable_reconstruction: bool.
|
|
@@ -1432,7 +1425,6 @@ class AsyncParsingClient:
|
|
|
1432
1425
|
"bbox_left": bbox_left,
|
|
1433
1426
|
"bbox_right": bbox_right,
|
|
1434
1427
|
"bbox_top": bbox_top,
|
|
1435
|
-
"compact_markdown_table": compact_markdown_table,
|
|
1436
1428
|
"disable_ocr": disable_ocr,
|
|
1437
1429
|
"disable_reconstruction": disable_reconstruction,
|
|
1438
1430
|
"disable_image_extraction": disable_image_extraction,
|
llama_cloud/types/__init__.py
CHANGED
|
@@ -123,6 +123,9 @@ from .extract_agent_update_data_schema_zero_value import ExtractAgentUpdateDataS
|
|
|
123
123
|
from .extract_config import ExtractConfig
|
|
124
124
|
from .extract_job import ExtractJob
|
|
125
125
|
from .extract_job_create import ExtractJobCreate
|
|
126
|
+
from .extract_job_create_batch import ExtractJobCreateBatch
|
|
127
|
+
from .extract_job_create_batch_data_schema_override import ExtractJobCreateBatchDataSchemaOverride
|
|
128
|
+
from .extract_job_create_batch_data_schema_override_zero_value import ExtractJobCreateBatchDataSchemaOverrideZeroValue
|
|
126
129
|
from .extract_job_create_data_schema_override import ExtractJobCreateDataSchemaOverride
|
|
127
130
|
from .extract_job_create_data_schema_override_zero_value import ExtractJobCreateDataSchemaOverrideZeroValue
|
|
128
131
|
from .extract_mode import ExtractMode
|
|
@@ -203,6 +206,7 @@ from .page_screenshot_metadata import PageScreenshotMetadata
|
|
|
203
206
|
from .page_screenshot_node_with_score import PageScreenshotNodeWithScore
|
|
204
207
|
from .page_segmentation_config import PageSegmentationConfig
|
|
205
208
|
from .page_splitter_node_parser import PageSplitterNodeParser
|
|
209
|
+
from .paginated_extract_runs_response import PaginatedExtractRunsResponse
|
|
206
210
|
from .paginated_jobs_history_with_metrics import PaginatedJobsHistoryWithMetrics
|
|
207
211
|
from .paginated_list_cloud_documents_response import PaginatedListCloudDocumentsResponse
|
|
208
212
|
from .paginated_list_pipeline_files_response import PaginatedListPipelineFilesResponse
|
|
@@ -451,6 +455,9 @@ __all__ = [
|
|
|
451
455
|
"ExtractConfig",
|
|
452
456
|
"ExtractJob",
|
|
453
457
|
"ExtractJobCreate",
|
|
458
|
+
"ExtractJobCreateBatch",
|
|
459
|
+
"ExtractJobCreateBatchDataSchemaOverride",
|
|
460
|
+
"ExtractJobCreateBatchDataSchemaOverrideZeroValue",
|
|
454
461
|
"ExtractJobCreateDataSchemaOverride",
|
|
455
462
|
"ExtractJobCreateDataSchemaOverrideZeroValue",
|
|
456
463
|
"ExtractMode",
|
|
@@ -529,6 +536,7 @@ __all__ = [
|
|
|
529
536
|
"PageScreenshotNodeWithScore",
|
|
530
537
|
"PageSegmentationConfig",
|
|
531
538
|
"PageSplitterNodeParser",
|
|
539
|
+
"PaginatedExtractRunsResponse",
|
|
532
540
|
"PaginatedJobsHistoryWithMetrics",
|
|
533
541
|
"PaginatedListCloudDocumentsResponse",
|
|
534
542
|
"PaginatedListPipelineFilesResponse",
|
llama_cloud/types/chunk_mode.py
CHANGED
|
@@ -10,12 +10,14 @@ class ChunkMode(str, enum.Enum):
|
|
|
10
10
|
PAGE = "PAGE"
|
|
11
11
|
DOCUMENT = "DOCUMENT"
|
|
12
12
|
SECTION = "SECTION"
|
|
13
|
+
GROUPED_PAGES = "GROUPED_PAGES"
|
|
13
14
|
|
|
14
15
|
def visit(
|
|
15
16
|
self,
|
|
16
17
|
page: typing.Callable[[], T_Result],
|
|
17
18
|
document: typing.Callable[[], T_Result],
|
|
18
19
|
section: typing.Callable[[], T_Result],
|
|
20
|
+
grouped_pages: typing.Callable[[], T_Result],
|
|
19
21
|
) -> T_Result:
|
|
20
22
|
if self is ChunkMode.PAGE:
|
|
21
23
|
return page()
|
|
@@ -23,3 +25,5 @@ class ChunkMode(str, enum.Enum):
|
|
|
23
25
|
return document()
|
|
24
26
|
if self is ChunkMode.SECTION:
|
|
25
27
|
return section()
|
|
28
|
+
if self is ChunkMode.GROUPED_PAGES:
|
|
29
|
+
return grouped_pages()
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .extract_config import ExtractConfig
|
|
8
|
+
from .extract_job_create_batch_data_schema_override import ExtractJobCreateBatchDataSchemaOverride
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import pydantic
|
|
12
|
+
if pydantic.__version__.startswith("1."):
|
|
13
|
+
raise ImportError
|
|
14
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
15
|
+
except ImportError:
|
|
16
|
+
import pydantic # type: ignore
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ExtractJobCreateBatch(pydantic.BaseModel):
|
|
20
|
+
"""
|
|
21
|
+
Schema for creating extraction jobs in batch.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
extraction_agent_id: str = pydantic.Field(description="The id of the extraction agent")
|
|
25
|
+
file_ids: typing.List[str] = pydantic.Field(description="The ids of the files")
|
|
26
|
+
data_schema_override: typing.Optional[ExtractJobCreateBatchDataSchemaOverride] = pydantic.Field(
|
|
27
|
+
description="The data schema to override the extraction agent's data schema with"
|
|
28
|
+
)
|
|
29
|
+
config_override: typing.Optional[ExtractConfig]
|
|
30
|
+
|
|
31
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
32
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
|
+
return super().json(**kwargs_with_defaults)
|
|
34
|
+
|
|
35
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
36
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
37
|
+
return super().dict(**kwargs_with_defaults)
|
|
38
|
+
|
|
39
|
+
class Config:
|
|
40
|
+
frozen = True
|
|
41
|
+
smart_union = True
|
|
42
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from .extract_job_create_batch_data_schema_override_zero_value import ExtractJobCreateBatchDataSchemaOverrideZeroValue
|
|
6
|
+
|
|
7
|
+
ExtractJobCreateBatchDataSchemaOverride = typing.Union[
|
|
8
|
+
typing.Dict[str, typing.Optional[ExtractJobCreateBatchDataSchemaOverrideZeroValue]], str
|
|
9
|
+
]
|
|
@@ -26,7 +26,6 @@ class LlamaParseParameters(pydantic.BaseModel):
|
|
|
26
26
|
disable_ocr: typing.Optional[bool]
|
|
27
27
|
annotate_links: typing.Optional[bool]
|
|
28
28
|
adaptive_long_table: typing.Optional[bool]
|
|
29
|
-
compact_markdown_table: typing.Optional[bool]
|
|
30
29
|
disable_reconstruction: typing.Optional[bool]
|
|
31
30
|
disable_image_extraction: typing.Optional[bool]
|
|
32
31
|
invalidate_cache: typing.Optional[bool]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .extract_run import ExtractRun
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import pydantic
|
|
11
|
+
if pydantic.__version__.startswith("1."):
|
|
12
|
+
raise ImportError
|
|
13
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
14
|
+
except ImportError:
|
|
15
|
+
import pydantic # type: ignore
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PaginatedExtractRunsResponse(pydantic.BaseModel):
|
|
19
|
+
"""
|
|
20
|
+
Schema for paginated extraction runs response.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
items: typing.List[ExtractRun] = pydantic.Field(description="The list of extraction runs")
|
|
24
|
+
total: int = pydantic.Field(description="The total number of extraction runs")
|
|
25
|
+
skip: int = pydantic.Field(description="The number of extraction runs skipped")
|
|
26
|
+
limit: int = pydantic.Field(description="The maximum number of extraction runs returned")
|
|
27
|
+
|
|
28
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
29
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
30
|
+
return super().json(**kwargs_with_defaults)
|
|
31
|
+
|
|
32
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
33
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
34
|
+
return super().dict(**kwargs_with_defaults)
|
|
35
|
+
|
|
36
|
+
class Config:
|
|
37
|
+
frozen = True
|
|
38
|
+
smart_union = True
|
|
39
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
llama_cloud/types/usage.py
CHANGED
|
@@ -18,7 +18,7 @@ except ImportError:
|
|
|
18
18
|
|
|
19
19
|
class Usage(pydantic.BaseModel):
|
|
20
20
|
"""
|
|
21
|
-
Response model
|
|
21
|
+
Response model
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
24
|
active_free_credits_usage: typing.Optional[typing.List[FreeCreditsUsage]]
|
|
@@ -27,6 +27,7 @@ class Usage(pydantic.BaseModel):
|
|
|
27
27
|
total_indexed_pages: typing.Optional[int]
|
|
28
28
|
active_alerts: typing.Optional[typing.List[UsageActiveAlertsItem]]
|
|
29
29
|
current_invoice_total_usd_cents: typing.Optional[int]
|
|
30
|
+
total_extraction_agents: typing.Optional[int]
|
|
30
31
|
|
|
31
32
|
def json(self, **kwargs: typing.Any) -> str:
|
|
32
33
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
llama_cloud/__init__.py,sha256=
|
|
1
|
+
llama_cloud/__init__.py,sha256=tJjIj-iumXdTiBOzpqXtfOwVkNBkXJ3Kel0aR6a8bw0,23193
|
|
2
2
|
llama_cloud/client.py,sha256=0fK6iRBCA77eSs0zFrYQj-zD0BLy6Dr2Ss0ETJ4WaOY,5555
|
|
3
3
|
llama_cloud/core/__init__.py,sha256=QJS3CJ2TYP2E1Tge0CS6Z7r8LTNzJHQVX1hD3558eP0,519
|
|
4
4
|
llama_cloud/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
|
@@ -38,11 +38,11 @@ llama_cloud/resources/files/types/file_create_resource_info_value.py,sha256=R7Y-
|
|
|
38
38
|
llama_cloud/resources/jobs/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
39
39
|
llama_cloud/resources/jobs/client.py,sha256=mN9uOzys9aZkhOJkApUy0yhfNeK8X09xQxT34ZPptNY,5386
|
|
40
40
|
llama_cloud/resources/llama_extract/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
41
|
-
llama_cloud/resources/llama_extract/client.py,sha256=
|
|
41
|
+
llama_cloud/resources/llama_extract/client.py,sha256=xEezIrVQcLW7bTle3gNi2bXVDm3trjXsUJpJtChXHVo,53044
|
|
42
42
|
llama_cloud/resources/organizations/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
43
43
|
llama_cloud/resources/organizations/client.py,sha256=OGSVpkfY5wu8-22IFWVmtbYSDiy0-KqA3Lc1E_jNHvg,55889
|
|
44
44
|
llama_cloud/resources/parsing/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
45
|
-
llama_cloud/resources/parsing/client.py,sha256=
|
|
45
|
+
llama_cloud/resources/parsing/client.py,sha256=cdEEqjb5pRvb-Vq9VXjgh1107emTzYh5VP-Uu4aV3XI,74026
|
|
46
46
|
llama_cloud/resources/pipelines/__init__.py,sha256=Mx7p3jDZRLMltsfywSufam_4AnHvmAfsxtMHVI72e-8,1083
|
|
47
47
|
llama_cloud/resources/pipelines/client.py,sha256=-Oveo6XSfCZva-ylJp7DikV26KxkJsDr6xNFZ8FIqkQ,139274
|
|
48
48
|
llama_cloud/resources/pipelines/types/__init__.py,sha256=jjaMc0V3K1HZLMYZ6WT4ydMtBCVy-oF5koqTCovbDws,1202
|
|
@@ -57,7 +57,7 @@ llama_cloud/resources/reports/types/__init__.py,sha256=LfwDYrI4RcQu-o42iAe7HkcwH
|
|
|
57
57
|
llama_cloud/resources/reports/types/update_report_plan_api_v_1_reports_report_id_plan_patch_request_action.py,sha256=Qh-MSeRvDBfNb5hoLELivv1pLtrYVf52WVoP7G8V34A,807
|
|
58
58
|
llama_cloud/resources/retrievers/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
59
59
|
llama_cloud/resources/retrievers/client.py,sha256=ASDdqnwXX4qj0sCAkWO7RKFnQ1oiLzBLIQ2bwqnMOKs,24905
|
|
60
|
-
llama_cloud/types/__init__.py,sha256=
|
|
60
|
+
llama_cloud/types/__init__.py,sha256=xw0pso0-CRFjj7Z27CtiUU7AbKzPfaDi59BRVPoeBbU,28758
|
|
61
61
|
llama_cloud/types/advanced_mode_transform_config.py,sha256=4xCXye0_cPmVS1F8aNTx81sIaEPjQH9kiCCAIoqUzlI,1502
|
|
62
62
|
llama_cloud/types/advanced_mode_transform_config_chunking_config.py,sha256=wYbJnWLpeQDfhmDZz-wJfYzD1iGT5Jcxb9ga3mzUuvk,1983
|
|
63
63
|
llama_cloud/types/advanced_mode_transform_config_segmentation_config.py,sha256=anNGq0F5-IlbIW3kpC8OilzLJnUq5tdIcWHnRnmlYsg,1303
|
|
@@ -79,7 +79,7 @@ llama_cloud/types/character_splitter.py,sha256=Jm6ie7c9JmMqIqLfAN-96sYvNUaIyLzCP
|
|
|
79
79
|
llama_cloud/types/chat_app.py,sha256=fLuzYkXLq51C_Y23hoLwfmG-OiT7jlyHt2JGe6-f1IA,1795
|
|
80
80
|
llama_cloud/types/chat_app_response.py,sha256=WSKr1KI9_pGTSstr3I53kZ8qb3y87Q4ulh8fR0C7sSU,1784
|
|
81
81
|
llama_cloud/types/chat_data.py,sha256=ZYqVtjXF6qPGajU4IWZu3InpU54TXJwBFiqxBepylP0,1197
|
|
82
|
-
llama_cloud/types/chunk_mode.py,sha256=
|
|
82
|
+
llama_cloud/types/chunk_mode.py,sha256=J4vqAQfQG6PWsIv1Fe_99nVsAfDbv_P81_KVsJ9AkU4,790
|
|
83
83
|
llama_cloud/types/cloud_az_storage_blob_data_source.py,sha256=NT4cYsD1M868_bSJxKM9cvTMtjQtQxKloE4vRv8_lwg,1534
|
|
84
84
|
llama_cloud/types/cloud_azure_ai_search_vector_store.py,sha256=9GTaft7BaKsR9RJQp5dlpbslXUlTMA1AcDdKV1ApfqI,1513
|
|
85
85
|
llama_cloud/types/cloud_box_data_source.py,sha256=9bffCaKGvctSsk9OdTpzzP__O1NDpb9wdvKY2uwjpwY,1470
|
|
@@ -151,6 +151,9 @@ llama_cloud/types/extract_agent_update_data_schema_zero_value.py,sha256=Nvd892EF
|
|
|
151
151
|
llama_cloud/types/extract_config.py,sha256=s0f8Yzfuzl0P_xV91SNj0Cbp77I_FMXCxL5lEJyXR6I,1505
|
|
152
152
|
llama_cloud/types/extract_job.py,sha256=Yx4fDdCdylAji2LPTwqflVpz1o9slpj9tTLS93-1tzU,1431
|
|
153
153
|
llama_cloud/types/extract_job_create.py,sha256=UK1mBIKyflo7e6m1MxMN95pLscj67jH_yvs8EvmBXqU,1545
|
|
154
|
+
llama_cloud/types/extract_job_create_batch.py,sha256=64BAproProYtPk7vAPGvFoxvlgg7ZLb1LSg3ChIf7AM,1589
|
|
155
|
+
llama_cloud/types/extract_job_create_batch_data_schema_override.py,sha256=GykJ1BBecRtWYD3ZPi1YINqrr-me_pyr2w_4Ei4QOZQ,351
|
|
156
|
+
llama_cloud/types/extract_job_create_batch_data_schema_override_zero_value.py,sha256=7zXOgTYUwVAeyYeqWvX69m-7mhvK0V9cBRvgqVSd0X0,228
|
|
154
157
|
llama_cloud/types/extract_job_create_data_schema_override.py,sha256=vuiJ2lGJjbXEnvFKzVnKyvgwhMXPg1Pb5GZne2DrB60,330
|
|
155
158
|
llama_cloud/types/extract_job_create_data_schema_override_zero_value.py,sha256=HHEYxOSQXXyBYOiUQg_qwfQtXFj-OtThMwbUDBIgZU0,223
|
|
156
159
|
llama_cloud/types/extract_mode.py,sha256=Xu8TvYHXYs-EcELV0hXbkcPuMyK1BLBQPKIBuHeUSnY,457
|
|
@@ -194,7 +197,7 @@ llama_cloud/types/job_record_with_usage_metrics.py,sha256=iNV2do5TB_0e3PoOz_DJyA
|
|
|
194
197
|
llama_cloud/types/llama_extract_settings.py,sha256=Yh9Ah9W0X4l-znjYm4oNIh8-LCBc99JEQmGU87bUzWs,2225
|
|
195
198
|
llama_cloud/types/llama_index_core_base_llms_types_chat_message.py,sha256=NelHo-T-ebVMhRKsqE_xV8AJW4c7o6lS0uEQnPsmTwg,1365
|
|
196
199
|
llama_cloud/types/llama_index_core_base_llms_types_chat_message_blocks_item.py,sha256=tTglUqrSUaVc2Wsi4uIt5MU-80_oxZzTnhf8ziilVGY,874
|
|
197
|
-
llama_cloud/types/llama_parse_parameters.py,sha256=
|
|
200
|
+
llama_cloud/types/llama_parse_parameters.py,sha256=TMKaebSDi_6B4qsalE2zyYCJirj_HW_x5MhSIimGPJ8,5234
|
|
198
201
|
llama_cloud/types/llama_parse_supported_file_extensions.py,sha256=B_0N3f8Aq59W9FbsH50mGBUiyWTIXQjHFl739uAyaQw,11207
|
|
199
202
|
llama_cloud/types/llm.py,sha256=7iIItVPjURp4u5xxJDAFIefUdhUKwIuA245WXilJPXE,2234
|
|
200
203
|
llama_cloud/types/llm_model_data.py,sha256=6rrycqGwlK3LZ2S-WtgmeomithdLhDCgwBBZQ5KLaso,1300
|
|
@@ -227,6 +230,7 @@ llama_cloud/types/page_screenshot_metadata.py,sha256=lobrq0AsOr8sDwMgA9ytop8lRmR
|
|
|
227
230
|
llama_cloud/types/page_screenshot_node_with_score.py,sha256=EdqoXbmARCz1DV14E2saCPshIeII709uM4cLwxw_mkM,1232
|
|
228
231
|
llama_cloud/types/page_segmentation_config.py,sha256=VH8uuxnubnJak1gSpS64OoMueHidhsDB-2eq2tVHbag,998
|
|
229
232
|
llama_cloud/types/page_splitter_node_parser.py,sha256=rQgS1CDk18UKA0r9OPvjdtM570jzFArdLCTxYAtZny8,1424
|
|
233
|
+
llama_cloud/types/paginated_extract_runs_response.py,sha256=NNeVcgBm0mYTAsumwQBO_YrxvkgUqwsvZo3xs8QjVCc,1423
|
|
230
234
|
llama_cloud/types/paginated_jobs_history_with_metrics.py,sha256=Bxy6N0x0FARJhgwNKKPkNpXx8YLRHvth23G14f5Fuk4,1136
|
|
231
235
|
llama_cloud/types/paginated_list_cloud_documents_response.py,sha256=MsjS0SWlT0syELDck4x2sxxR3_NC1e6QTdepgVmK9aY,1341
|
|
232
236
|
llama_cloud/types/paginated_list_pipeline_files_response.py,sha256=2TKR2oHSQRyLMqWz1qQBSIvz-ZJb8U_94367lwOJ2S4,1317
|
|
@@ -317,7 +321,7 @@ llama_cloud/types/text_node_with_score.py,sha256=k-KYWO_mgJBvO6xUfOD5W6v1Ku9E586
|
|
|
317
321
|
llama_cloud/types/token_chunking_config.py,sha256=XNvnTsNd--YOMQ_Ad8hoqhYgQftqkBHKVn6i7nJnMqs,1067
|
|
318
322
|
llama_cloud/types/token_text_splitter.py,sha256=iTT3x9yO021v757B2r-0Z-WFQiIESLqEJUCmUUwPQ_o,1899
|
|
319
323
|
llama_cloud/types/transformation_category_names.py,sha256=Wb7NBB0f-tEtfEZQis-iKy71SUKmmHFcXf6XLn6g0XU,545
|
|
320
|
-
llama_cloud/types/usage.py,sha256
|
|
324
|
+
llama_cloud/types/usage.py,sha256=LT4Jr4kiQiug2A_cNmGSxWV7UZmseYzxACXo7dTQIBQ,1466
|
|
321
325
|
llama_cloud/types/usage_active_alerts_item.py,sha256=YZkSH_Vd3hu5f-Nv0LKKj9slVTa3GsOcbSPhttKcVqQ,964
|
|
322
326
|
llama_cloud/types/usage_and_plan.py,sha256=DsQVkOkh6yiDY9FsGR34DcTocj53loO2lU55P45XnWY,1040
|
|
323
327
|
llama_cloud/types/usage_metric_response.py,sha256=ukvtNZLeLacv-5F0-GQ5wTBZOPUPEjAeurgYPc4s7nA,1047
|
|
@@ -331,7 +335,7 @@ llama_cloud/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPX
|
|
|
331
335
|
llama_cloud/types/vertex_ai_embedding_config.py,sha256=DvQk2xMJFmo54MEXTzoM4KSADyhGm_ygmFyx6wIcQdw,1159
|
|
332
336
|
llama_cloud/types/vertex_embedding_mode.py,sha256=yY23FjuWU_DkXjBb3JoKV4SCMqel2BaIMltDqGnIowU,1217
|
|
333
337
|
llama_cloud/types/vertex_text_embedding.py,sha256=-C4fNCYfFl36ATdBMGFVPpiHIKxjk0KB1ERA2Ec20aU,1932
|
|
334
|
-
llama_cloud-0.1.
|
|
335
|
-
llama_cloud-0.1.
|
|
336
|
-
llama_cloud-0.1.
|
|
337
|
-
llama_cloud-0.1.
|
|
338
|
+
llama_cloud-0.1.15.dist-info/LICENSE,sha256=_iNqtPcw1Ue7dZKwOwgPtbegMUkWVy15hC7bffAdNmY,1067
|
|
339
|
+
llama_cloud-0.1.15.dist-info/METADATA,sha256=uPM6KdBc0u-od5x-l5Ef221lWETrhsnIkdVvdbL1PX8,902
|
|
340
|
+
llama_cloud-0.1.15.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
341
|
+
llama_cloud-0.1.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|