llama-cloud 0.1.13__py3-none-any.whl → 0.1.14__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 +36 -10
- llama_cloud/resources/__init__.py +0 -14
- llama_cloud/resources/llama_extract/__init__.py +0 -17
- llama_cloud/resources/llama_extract/client.py +105 -318
- llama_cloud/resources/organizations/client.py +15 -5
- llama_cloud/resources/parsing/client.py +24 -0
- llama_cloud/resources/pipelines/client.py +145 -10
- llama_cloud/resources/projects/client.py +25 -9
- llama_cloud/resources/reports/client.py +16 -6
- llama_cloud/types/__init__.py +42 -4
- llama_cloud/types/{plan.py → base_plan.py} +16 -13
- llama_cloud/types/base_plan_metronome_plan_type.py +17 -0
- llama_cloud/types/base_plan_name.py +45 -0
- llama_cloud/types/base_plan_plan_frequency.py +25 -0
- llama_cloud/types/billing_period.py +32 -0
- llama_cloud/types/credit_type.py +32 -0
- llama_cloud/types/data_source.py +1 -0
- llama_cloud/types/extract_agent_create.py +39 -0
- llama_cloud/types/extract_agent_update.py +38 -0
- llama_cloud/types/extract_schema_validate_request.py +32 -0
- llama_cloud/types/free_credits_usage.py +34 -0
- llama_cloud/types/llama_parse_parameters.py +3 -0
- llama_cloud/types/paginated_list_cloud_documents_response.py +35 -0
- llama_cloud/types/pipeline_data_source.py +1 -0
- llama_cloud/types/pipeline_file.py +1 -0
- llama_cloud/types/plan_limits.py +52 -0
- llama_cloud/types/recurring_credit_grant.py +44 -0
- llama_cloud/types/usage.py +5 -4
- llama_cloud/types/usage_active_alerts_item.py +25 -0
- llama_cloud/types/{interval_usage_and_plan.py → usage_and_plan.py} +4 -6
- {llama_cloud-0.1.13.dist-info → llama_cloud-0.1.14.dist-info}/METADATA +3 -1
- {llama_cloud-0.1.13.dist-info → llama_cloud-0.1.14.dist-info}/RECORD +40 -28
- {llama_cloud-0.1.13.dist-info → llama_cloud-0.1.14.dist-info}/WHEEL +1 -1
- llama_cloud/resources/llama_extract/types/__init__.py +0 -17
- /llama_cloud/{resources/llama_extract/types → types}/extract_agent_create_data_schema.py +0 -0
- /llama_cloud/{resources/llama_extract/types → types}/extract_agent_create_data_schema_zero_value.py +0 -0
- /llama_cloud/{resources/llama_extract/types → types}/extract_agent_update_data_schema.py +0 -0
- /llama_cloud/{resources/llama_extract/types → types}/extract_agent_update_data_schema_zero_value.py +0 -0
- /llama_cloud/{resources/llama_extract/types → types}/extract_schema_validate_request_data_schema.py +0 -0
- /llama_cloud/{resources/llama_extract/types → types}/extract_schema_validate_request_data_schema_zero_value.py +0 -0
- {llama_cloud-0.1.13.dist-info → llama_cloud-0.1.14.dist-info}/LICENSE +0 -0
|
@@ -10,11 +10,11 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
|
10
10
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
11
11
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
12
|
from ...types.http_validation_error import HttpValidationError
|
|
13
|
-
from ...types.interval_usage_and_plan import IntervalUsageAndPlan
|
|
14
13
|
from ...types.organization import Organization
|
|
15
14
|
from ...types.organization_create import OrganizationCreate
|
|
16
15
|
from ...types.project import Project
|
|
17
16
|
from ...types.role import Role
|
|
17
|
+
from ...types.usage_and_plan import UsageAndPlan
|
|
18
18
|
from ...types.user_organization import UserOrganization
|
|
19
19
|
from ...types.user_organization_create import UserOrganizationCreate
|
|
20
20
|
from ...types.user_organization_delete import UserOrganizationDelete
|
|
@@ -297,12 +297,16 @@ class OrganizationsClient:
|
|
|
297
297
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
298
298
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
299
299
|
|
|
300
|
-
def get_organization_usage(
|
|
300
|
+
def get_organization_usage(
|
|
301
|
+
self, organization_id: typing.Optional[str], *, get_current_invoice_total: typing.Optional[bool] = None
|
|
302
|
+
) -> UsageAndPlan:
|
|
301
303
|
"""
|
|
302
304
|
Get usage for a project
|
|
303
305
|
|
|
304
306
|
Parameters:
|
|
305
307
|
- organization_id: typing.Optional[str].
|
|
308
|
+
|
|
309
|
+
- get_current_invoice_total: typing.Optional[bool].
|
|
306
310
|
---
|
|
307
311
|
from llama_cloud.client import LlamaCloud
|
|
308
312
|
|
|
@@ -316,11 +320,12 @@ class OrganizationsClient:
|
|
|
316
320
|
urllib.parse.urljoin(
|
|
317
321
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/organizations/{organization_id}/usage"
|
|
318
322
|
),
|
|
323
|
+
params=remove_none_from_dict({"get_current_invoice_total": get_current_invoice_total}),
|
|
319
324
|
headers=self._client_wrapper.get_headers(),
|
|
320
325
|
timeout=60,
|
|
321
326
|
)
|
|
322
327
|
if 200 <= _response.status_code < 300:
|
|
323
|
-
return pydantic.parse_obj_as(
|
|
328
|
+
return pydantic.parse_obj_as(UsageAndPlan, _response.json()) # type: ignore
|
|
324
329
|
if _response.status_code == 422:
|
|
325
330
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
326
331
|
try:
|
|
@@ -988,12 +993,16 @@ class AsyncOrganizationsClient:
|
|
|
988
993
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
989
994
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
990
995
|
|
|
991
|
-
async def get_organization_usage(
|
|
996
|
+
async def get_organization_usage(
|
|
997
|
+
self, organization_id: typing.Optional[str], *, get_current_invoice_total: typing.Optional[bool] = None
|
|
998
|
+
) -> UsageAndPlan:
|
|
992
999
|
"""
|
|
993
1000
|
Get usage for a project
|
|
994
1001
|
|
|
995
1002
|
Parameters:
|
|
996
1003
|
- organization_id: typing.Optional[str].
|
|
1004
|
+
|
|
1005
|
+
- get_current_invoice_total: typing.Optional[bool].
|
|
997
1006
|
---
|
|
998
1007
|
from llama_cloud.client import AsyncLlamaCloud
|
|
999
1008
|
|
|
@@ -1007,11 +1016,12 @@ class AsyncOrganizationsClient:
|
|
|
1007
1016
|
urllib.parse.urljoin(
|
|
1008
1017
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/organizations/{organization_id}/usage"
|
|
1009
1018
|
),
|
|
1019
|
+
params=remove_none_from_dict({"get_current_invoice_total": get_current_invoice_total}),
|
|
1010
1020
|
headers=self._client_wrapper.get_headers(),
|
|
1011
1021
|
timeout=60,
|
|
1012
1022
|
)
|
|
1013
1023
|
if 200 <= _response.status_code < 300:
|
|
1014
|
-
return pydantic.parse_obj_as(
|
|
1024
|
+
return pydantic.parse_obj_as(UsageAndPlan, _response.json()) # type: ignore
|
|
1015
1025
|
if _response.status_code == 422:
|
|
1016
1026
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1017
1027
|
try:
|
|
@@ -197,6 +197,7 @@ class ParsingClient:
|
|
|
197
197
|
organization_id: typing.Optional[str] = None,
|
|
198
198
|
project_id: typing.Optional[str] = None,
|
|
199
199
|
file: typing.Optional[str] = OMIT,
|
|
200
|
+
adaptive_long_table: bool,
|
|
200
201
|
annotate_links: bool,
|
|
201
202
|
auto_mode: bool,
|
|
202
203
|
auto_mode_trigger_on_image_in_page: bool,
|
|
@@ -211,6 +212,7 @@ class ParsingClient:
|
|
|
211
212
|
bbox_left: float,
|
|
212
213
|
bbox_right: float,
|
|
213
214
|
bbox_top: float,
|
|
215
|
+
compact_markdown_table: bool,
|
|
214
216
|
disable_ocr: bool,
|
|
215
217
|
disable_reconstruction: bool,
|
|
216
218
|
disable_image_extraction: bool,
|
|
@@ -245,6 +247,7 @@ class ParsingClient:
|
|
|
245
247
|
target_pages: str,
|
|
246
248
|
vendor_multimodal_api_key: str,
|
|
247
249
|
vendor_multimodal_model_name: str,
|
|
250
|
+
model: str,
|
|
248
251
|
webhook_url: str,
|
|
249
252
|
parse_mode: typing.Optional[ParsingMode] = OMIT,
|
|
250
253
|
system_prompt: str,
|
|
@@ -281,6 +284,8 @@ class ParsingClient:
|
|
|
281
284
|
|
|
282
285
|
- file: typing.Optional[str].
|
|
283
286
|
|
|
287
|
+
- adaptive_long_table: bool.
|
|
288
|
+
|
|
284
289
|
- annotate_links: bool.
|
|
285
290
|
|
|
286
291
|
- auto_mode: bool.
|
|
@@ -309,6 +314,8 @@ class ParsingClient:
|
|
|
309
314
|
|
|
310
315
|
- bbox_top: float.
|
|
311
316
|
|
|
317
|
+
- compact_markdown_table: bool.
|
|
318
|
+
|
|
312
319
|
- disable_ocr: bool.
|
|
313
320
|
|
|
314
321
|
- disable_reconstruction: bool.
|
|
@@ -377,6 +384,8 @@ class ParsingClient:
|
|
|
377
384
|
|
|
378
385
|
- vendor_multimodal_model_name: str.
|
|
379
386
|
|
|
387
|
+
- model: str.
|
|
388
|
+
|
|
380
389
|
- webhook_url: str.
|
|
381
390
|
|
|
382
391
|
- parse_mode: typing.Optional[ParsingMode].
|
|
@@ -428,6 +437,7 @@ class ParsingClient:
|
|
|
428
437
|
- formatting_instruction: str.
|
|
429
438
|
"""
|
|
430
439
|
_request: typing.Dict[str, typing.Any] = {
|
|
440
|
+
"adaptive_long_table": adaptive_long_table,
|
|
431
441
|
"annotate_links": annotate_links,
|
|
432
442
|
"auto_mode": auto_mode,
|
|
433
443
|
"auto_mode_trigger_on_image_in_page": auto_mode_trigger_on_image_in_page,
|
|
@@ -442,6 +452,7 @@ class ParsingClient:
|
|
|
442
452
|
"bbox_left": bbox_left,
|
|
443
453
|
"bbox_right": bbox_right,
|
|
444
454
|
"bbox_top": bbox_top,
|
|
455
|
+
"compact_markdown_table": compact_markdown_table,
|
|
445
456
|
"disable_ocr": disable_ocr,
|
|
446
457
|
"disable_reconstruction": disable_reconstruction,
|
|
447
458
|
"disable_image_extraction": disable_image_extraction,
|
|
@@ -475,6 +486,7 @@ class ParsingClient:
|
|
|
475
486
|
"target_pages": target_pages,
|
|
476
487
|
"vendor_multimodal_api_key": vendor_multimodal_api_key,
|
|
477
488
|
"vendor_multimodal_model_name": vendor_multimodal_model_name,
|
|
489
|
+
"model": model,
|
|
478
490
|
"webhook_url": webhook_url,
|
|
479
491
|
"system_prompt": system_prompt,
|
|
480
492
|
"system_prompt_append": system_prompt_append,
|
|
@@ -1165,6 +1177,7 @@ class AsyncParsingClient:
|
|
|
1165
1177
|
organization_id: typing.Optional[str] = None,
|
|
1166
1178
|
project_id: typing.Optional[str] = None,
|
|
1167
1179
|
file: typing.Optional[str] = OMIT,
|
|
1180
|
+
adaptive_long_table: bool,
|
|
1168
1181
|
annotate_links: bool,
|
|
1169
1182
|
auto_mode: bool,
|
|
1170
1183
|
auto_mode_trigger_on_image_in_page: bool,
|
|
@@ -1179,6 +1192,7 @@ class AsyncParsingClient:
|
|
|
1179
1192
|
bbox_left: float,
|
|
1180
1193
|
bbox_right: float,
|
|
1181
1194
|
bbox_top: float,
|
|
1195
|
+
compact_markdown_table: bool,
|
|
1182
1196
|
disable_ocr: bool,
|
|
1183
1197
|
disable_reconstruction: bool,
|
|
1184
1198
|
disable_image_extraction: bool,
|
|
@@ -1213,6 +1227,7 @@ class AsyncParsingClient:
|
|
|
1213
1227
|
target_pages: str,
|
|
1214
1228
|
vendor_multimodal_api_key: str,
|
|
1215
1229
|
vendor_multimodal_model_name: str,
|
|
1230
|
+
model: str,
|
|
1216
1231
|
webhook_url: str,
|
|
1217
1232
|
parse_mode: typing.Optional[ParsingMode] = OMIT,
|
|
1218
1233
|
system_prompt: str,
|
|
@@ -1249,6 +1264,8 @@ class AsyncParsingClient:
|
|
|
1249
1264
|
|
|
1250
1265
|
- file: typing.Optional[str].
|
|
1251
1266
|
|
|
1267
|
+
- adaptive_long_table: bool.
|
|
1268
|
+
|
|
1252
1269
|
- annotate_links: bool.
|
|
1253
1270
|
|
|
1254
1271
|
- auto_mode: bool.
|
|
@@ -1277,6 +1294,8 @@ class AsyncParsingClient:
|
|
|
1277
1294
|
|
|
1278
1295
|
- bbox_top: float.
|
|
1279
1296
|
|
|
1297
|
+
- compact_markdown_table: bool.
|
|
1298
|
+
|
|
1280
1299
|
- disable_ocr: bool.
|
|
1281
1300
|
|
|
1282
1301
|
- disable_reconstruction: bool.
|
|
@@ -1345,6 +1364,8 @@ class AsyncParsingClient:
|
|
|
1345
1364
|
|
|
1346
1365
|
- vendor_multimodal_model_name: str.
|
|
1347
1366
|
|
|
1367
|
+
- model: str.
|
|
1368
|
+
|
|
1348
1369
|
- webhook_url: str.
|
|
1349
1370
|
|
|
1350
1371
|
- parse_mode: typing.Optional[ParsingMode].
|
|
@@ -1396,6 +1417,7 @@ class AsyncParsingClient:
|
|
|
1396
1417
|
- formatting_instruction: str.
|
|
1397
1418
|
"""
|
|
1398
1419
|
_request: typing.Dict[str, typing.Any] = {
|
|
1420
|
+
"adaptive_long_table": adaptive_long_table,
|
|
1399
1421
|
"annotate_links": annotate_links,
|
|
1400
1422
|
"auto_mode": auto_mode,
|
|
1401
1423
|
"auto_mode_trigger_on_image_in_page": auto_mode_trigger_on_image_in_page,
|
|
@@ -1410,6 +1432,7 @@ class AsyncParsingClient:
|
|
|
1410
1432
|
"bbox_left": bbox_left,
|
|
1411
1433
|
"bbox_right": bbox_right,
|
|
1412
1434
|
"bbox_top": bbox_top,
|
|
1435
|
+
"compact_markdown_table": compact_markdown_table,
|
|
1413
1436
|
"disable_ocr": disable_ocr,
|
|
1414
1437
|
"disable_reconstruction": disable_reconstruction,
|
|
1415
1438
|
"disable_image_extraction": disable_image_extraction,
|
|
@@ -1443,6 +1466,7 @@ class AsyncParsingClient:
|
|
|
1443
1466
|
"target_pages": target_pages,
|
|
1444
1467
|
"vendor_multimodal_api_key": vendor_multimodal_api_key,
|
|
1445
1468
|
"vendor_multimodal_model_name": vendor_multimodal_model_name,
|
|
1469
|
+
"model": model,
|
|
1446
1470
|
"webhook_url": webhook_url,
|
|
1447
1471
|
"system_prompt": system_prompt,
|
|
1448
1472
|
"system_prompt_append": system_prompt_append,
|
|
@@ -23,6 +23,7 @@ from ...types.input_message import InputMessage
|
|
|
23
23
|
from ...types.llama_parse_parameters import LlamaParseParameters
|
|
24
24
|
from ...types.managed_ingestion_status_response import ManagedIngestionStatusResponse
|
|
25
25
|
from ...types.metadata_filters import MetadataFilters
|
|
26
|
+
from ...types.paginated_list_cloud_documents_response import PaginatedListCloudDocumentsResponse
|
|
26
27
|
from ...types.paginated_list_pipeline_files_response import PaginatedListPipelineFilesResponse
|
|
27
28
|
from ...types.pipeline import Pipeline
|
|
28
29
|
from ...types.pipeline_create import PipelineCreate
|
|
@@ -64,7 +65,6 @@ class PipelinesClient:
|
|
|
64
65
|
project_name: typing.Optional[str] = None,
|
|
65
66
|
pipeline_name: typing.Optional[str] = None,
|
|
66
67
|
pipeline_type: typing.Optional[PipelineType] = None,
|
|
67
|
-
organization_id: typing.Optional[str] = None,
|
|
68
68
|
) -> typing.List[Pipeline]:
|
|
69
69
|
"""
|
|
70
70
|
Search for pipelines by various parameters.
|
|
@@ -77,8 +77,6 @@ class PipelinesClient:
|
|
|
77
77
|
- pipeline_name: typing.Optional[str].
|
|
78
78
|
|
|
79
79
|
- pipeline_type: typing.Optional[PipelineType].
|
|
80
|
-
|
|
81
|
-
- organization_id: typing.Optional[str].
|
|
82
80
|
---
|
|
83
81
|
from llama_cloud import PipelineType
|
|
84
82
|
from llama_cloud.client import LlamaCloud
|
|
@@ -99,7 +97,6 @@ class PipelinesClient:
|
|
|
99
97
|
"project_name": project_name,
|
|
100
98
|
"pipeline_name": pipeline_name,
|
|
101
99
|
"pipeline_type": pipeline_type,
|
|
102
|
-
"organization_id": organization_id,
|
|
103
100
|
}
|
|
104
101
|
),
|
|
105
102
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -1443,6 +1440,7 @@ class PipelinesClient:
|
|
|
1443
1440
|
limit: typing.Optional[int] = None,
|
|
1444
1441
|
file_id: typing.Optional[str] = None,
|
|
1445
1442
|
only_direct_upload: typing.Optional[bool] = None,
|
|
1443
|
+
only_api_data_source_documents: typing.Optional[bool] = None,
|
|
1446
1444
|
) -> typing.List[CloudDocument]:
|
|
1447
1445
|
"""
|
|
1448
1446
|
Return a list of documents for a pipeline.
|
|
@@ -1457,6 +1455,8 @@ class PipelinesClient:
|
|
|
1457
1455
|
- file_id: typing.Optional[str].
|
|
1458
1456
|
|
|
1459
1457
|
- only_direct_upload: typing.Optional[bool].
|
|
1458
|
+
|
|
1459
|
+
- only_api_data_source_documents: typing.Optional[bool].
|
|
1460
1460
|
---
|
|
1461
1461
|
from llama_cloud.client import LlamaCloud
|
|
1462
1462
|
|
|
@@ -1473,7 +1473,13 @@ class PipelinesClient:
|
|
|
1473
1473
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/documents"
|
|
1474
1474
|
),
|
|
1475
1475
|
params=remove_none_from_dict(
|
|
1476
|
-
{
|
|
1476
|
+
{
|
|
1477
|
+
"skip": skip,
|
|
1478
|
+
"limit": limit,
|
|
1479
|
+
"file_id": file_id,
|
|
1480
|
+
"only_direct_upload": only_direct_upload,
|
|
1481
|
+
"only_api_data_source_documents": only_api_data_source_documents,
|
|
1482
|
+
}
|
|
1477
1483
|
),
|
|
1478
1484
|
headers=self._client_wrapper.get_headers(),
|
|
1479
1485
|
timeout=60,
|
|
@@ -1568,6 +1574,68 @@ class PipelinesClient:
|
|
|
1568
1574
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1569
1575
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1570
1576
|
|
|
1577
|
+
def paginated_list_pipeline_documents(
|
|
1578
|
+
self,
|
|
1579
|
+
pipeline_id: str,
|
|
1580
|
+
*,
|
|
1581
|
+
skip: typing.Optional[int] = None,
|
|
1582
|
+
limit: typing.Optional[int] = None,
|
|
1583
|
+
file_id: typing.Optional[str] = None,
|
|
1584
|
+
only_direct_upload: typing.Optional[bool] = None,
|
|
1585
|
+
only_api_data_source_documents: typing.Optional[bool] = None,
|
|
1586
|
+
) -> PaginatedListCloudDocumentsResponse:
|
|
1587
|
+
"""
|
|
1588
|
+
Return a list of documents for a pipeline.
|
|
1589
|
+
|
|
1590
|
+
Parameters:
|
|
1591
|
+
- pipeline_id: str.
|
|
1592
|
+
|
|
1593
|
+
- skip: typing.Optional[int].
|
|
1594
|
+
|
|
1595
|
+
- limit: typing.Optional[int].
|
|
1596
|
+
|
|
1597
|
+
- file_id: typing.Optional[str].
|
|
1598
|
+
|
|
1599
|
+
- only_direct_upload: typing.Optional[bool].
|
|
1600
|
+
|
|
1601
|
+
- only_api_data_source_documents: typing.Optional[bool].
|
|
1602
|
+
---
|
|
1603
|
+
from llama_cloud.client import LlamaCloud
|
|
1604
|
+
|
|
1605
|
+
client = LlamaCloud(
|
|
1606
|
+
token="YOUR_TOKEN",
|
|
1607
|
+
)
|
|
1608
|
+
client.pipelines.paginated_list_pipeline_documents(
|
|
1609
|
+
pipeline_id="string",
|
|
1610
|
+
)
|
|
1611
|
+
"""
|
|
1612
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1613
|
+
"GET",
|
|
1614
|
+
urllib.parse.urljoin(
|
|
1615
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/documents/paginated"
|
|
1616
|
+
),
|
|
1617
|
+
params=remove_none_from_dict(
|
|
1618
|
+
{
|
|
1619
|
+
"skip": skip,
|
|
1620
|
+
"limit": limit,
|
|
1621
|
+
"file_id": file_id,
|
|
1622
|
+
"only_direct_upload": only_direct_upload,
|
|
1623
|
+
"only_api_data_source_documents": only_api_data_source_documents,
|
|
1624
|
+
}
|
|
1625
|
+
),
|
|
1626
|
+
headers=self._client_wrapper.get_headers(),
|
|
1627
|
+
timeout=60,
|
|
1628
|
+
)
|
|
1629
|
+
if 200 <= _response.status_code < 300:
|
|
1630
|
+
return pydantic.parse_obj_as(PaginatedListCloudDocumentsResponse, _response.json()) # type: ignore
|
|
1631
|
+
if _response.status_code == 422:
|
|
1632
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1633
|
+
try:
|
|
1634
|
+
_response_json = _response.json()
|
|
1635
|
+
except JSONDecodeError:
|
|
1636
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1637
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1638
|
+
|
|
1571
1639
|
def get_pipeline_document(self, document_id: str, pipeline_id: str) -> CloudDocument:
|
|
1572
1640
|
"""
|
|
1573
1641
|
Return a single document for a pipeline.
|
|
@@ -1730,7 +1798,6 @@ class AsyncPipelinesClient:
|
|
|
1730
1798
|
project_name: typing.Optional[str] = None,
|
|
1731
1799
|
pipeline_name: typing.Optional[str] = None,
|
|
1732
1800
|
pipeline_type: typing.Optional[PipelineType] = None,
|
|
1733
|
-
organization_id: typing.Optional[str] = None,
|
|
1734
1801
|
) -> typing.List[Pipeline]:
|
|
1735
1802
|
"""
|
|
1736
1803
|
Search for pipelines by various parameters.
|
|
@@ -1743,8 +1810,6 @@ class AsyncPipelinesClient:
|
|
|
1743
1810
|
- pipeline_name: typing.Optional[str].
|
|
1744
1811
|
|
|
1745
1812
|
- pipeline_type: typing.Optional[PipelineType].
|
|
1746
|
-
|
|
1747
|
-
- organization_id: typing.Optional[str].
|
|
1748
1813
|
---
|
|
1749
1814
|
from llama_cloud import PipelineType
|
|
1750
1815
|
from llama_cloud.client import AsyncLlamaCloud
|
|
@@ -1765,7 +1830,6 @@ class AsyncPipelinesClient:
|
|
|
1765
1830
|
"project_name": project_name,
|
|
1766
1831
|
"pipeline_name": pipeline_name,
|
|
1767
1832
|
"pipeline_type": pipeline_type,
|
|
1768
|
-
"organization_id": organization_id,
|
|
1769
1833
|
}
|
|
1770
1834
|
),
|
|
1771
1835
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -3113,6 +3177,7 @@ class AsyncPipelinesClient:
|
|
|
3113
3177
|
limit: typing.Optional[int] = None,
|
|
3114
3178
|
file_id: typing.Optional[str] = None,
|
|
3115
3179
|
only_direct_upload: typing.Optional[bool] = None,
|
|
3180
|
+
only_api_data_source_documents: typing.Optional[bool] = None,
|
|
3116
3181
|
) -> typing.List[CloudDocument]:
|
|
3117
3182
|
"""
|
|
3118
3183
|
Return a list of documents for a pipeline.
|
|
@@ -3127,6 +3192,8 @@ class AsyncPipelinesClient:
|
|
|
3127
3192
|
- file_id: typing.Optional[str].
|
|
3128
3193
|
|
|
3129
3194
|
- only_direct_upload: typing.Optional[bool].
|
|
3195
|
+
|
|
3196
|
+
- only_api_data_source_documents: typing.Optional[bool].
|
|
3130
3197
|
---
|
|
3131
3198
|
from llama_cloud.client import AsyncLlamaCloud
|
|
3132
3199
|
|
|
@@ -3143,7 +3210,13 @@ class AsyncPipelinesClient:
|
|
|
3143
3210
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/documents"
|
|
3144
3211
|
),
|
|
3145
3212
|
params=remove_none_from_dict(
|
|
3146
|
-
{
|
|
3213
|
+
{
|
|
3214
|
+
"skip": skip,
|
|
3215
|
+
"limit": limit,
|
|
3216
|
+
"file_id": file_id,
|
|
3217
|
+
"only_direct_upload": only_direct_upload,
|
|
3218
|
+
"only_api_data_source_documents": only_api_data_source_documents,
|
|
3219
|
+
}
|
|
3147
3220
|
),
|
|
3148
3221
|
headers=self._client_wrapper.get_headers(),
|
|
3149
3222
|
timeout=60,
|
|
@@ -3238,6 +3311,68 @@ class AsyncPipelinesClient:
|
|
|
3238
3311
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
3239
3312
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
3240
3313
|
|
|
3314
|
+
async def paginated_list_pipeline_documents(
|
|
3315
|
+
self,
|
|
3316
|
+
pipeline_id: str,
|
|
3317
|
+
*,
|
|
3318
|
+
skip: typing.Optional[int] = None,
|
|
3319
|
+
limit: typing.Optional[int] = None,
|
|
3320
|
+
file_id: typing.Optional[str] = None,
|
|
3321
|
+
only_direct_upload: typing.Optional[bool] = None,
|
|
3322
|
+
only_api_data_source_documents: typing.Optional[bool] = None,
|
|
3323
|
+
) -> PaginatedListCloudDocumentsResponse:
|
|
3324
|
+
"""
|
|
3325
|
+
Return a list of documents for a pipeline.
|
|
3326
|
+
|
|
3327
|
+
Parameters:
|
|
3328
|
+
- pipeline_id: str.
|
|
3329
|
+
|
|
3330
|
+
- skip: typing.Optional[int].
|
|
3331
|
+
|
|
3332
|
+
- limit: typing.Optional[int].
|
|
3333
|
+
|
|
3334
|
+
- file_id: typing.Optional[str].
|
|
3335
|
+
|
|
3336
|
+
- only_direct_upload: typing.Optional[bool].
|
|
3337
|
+
|
|
3338
|
+
- only_api_data_source_documents: typing.Optional[bool].
|
|
3339
|
+
---
|
|
3340
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
3341
|
+
|
|
3342
|
+
client = AsyncLlamaCloud(
|
|
3343
|
+
token="YOUR_TOKEN",
|
|
3344
|
+
)
|
|
3345
|
+
await client.pipelines.paginated_list_pipeline_documents(
|
|
3346
|
+
pipeline_id="string",
|
|
3347
|
+
)
|
|
3348
|
+
"""
|
|
3349
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
3350
|
+
"GET",
|
|
3351
|
+
urllib.parse.urljoin(
|
|
3352
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/documents/paginated"
|
|
3353
|
+
),
|
|
3354
|
+
params=remove_none_from_dict(
|
|
3355
|
+
{
|
|
3356
|
+
"skip": skip,
|
|
3357
|
+
"limit": limit,
|
|
3358
|
+
"file_id": file_id,
|
|
3359
|
+
"only_direct_upload": only_direct_upload,
|
|
3360
|
+
"only_api_data_source_documents": only_api_data_source_documents,
|
|
3361
|
+
}
|
|
3362
|
+
),
|
|
3363
|
+
headers=self._client_wrapper.get_headers(),
|
|
3364
|
+
timeout=60,
|
|
3365
|
+
)
|
|
3366
|
+
if 200 <= _response.status_code < 300:
|
|
3367
|
+
return pydantic.parse_obj_as(PaginatedListCloudDocumentsResponse, _response.json()) # type: ignore
|
|
3368
|
+
if _response.status_code == 422:
|
|
3369
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
3370
|
+
try:
|
|
3371
|
+
_response_json = _response.json()
|
|
3372
|
+
except JSONDecodeError:
|
|
3373
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
3374
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
3375
|
+
|
|
3241
3376
|
async def get_pipeline_document(self, document_id: str, pipeline_id: str) -> CloudDocument:
|
|
3242
3377
|
"""
|
|
3243
3378
|
Return a single document for a pipeline.
|
|
@@ -11,13 +11,13 @@ from ...core.remove_none_from_dict import remove_none_from_dict
|
|
|
11
11
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
12
|
from ...types.eval_dataset import EvalDataset
|
|
13
13
|
from ...types.http_validation_error import HttpValidationError
|
|
14
|
-
from ...types.interval_usage_and_plan import IntervalUsageAndPlan
|
|
15
14
|
from ...types.local_eval import LocalEval
|
|
16
15
|
from ...types.local_eval_results import LocalEvalResults
|
|
17
16
|
from ...types.local_eval_sets import LocalEvalSets
|
|
18
17
|
from ...types.project import Project
|
|
19
18
|
from ...types.project_create import ProjectCreate
|
|
20
19
|
from ...types.prompt_mixin_prompts import PromptMixinPrompts
|
|
20
|
+
from ...types.usage_and_plan import UsageAndPlan
|
|
21
21
|
|
|
22
22
|
try:
|
|
23
23
|
import pydantic
|
|
@@ -256,14 +256,20 @@ class ProjectsClient:
|
|
|
256
256
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
257
257
|
|
|
258
258
|
def get_project_usage(
|
|
259
|
-
self,
|
|
260
|
-
|
|
259
|
+
self,
|
|
260
|
+
project_id: typing.Optional[str],
|
|
261
|
+
*,
|
|
262
|
+
get_current_invoice_total: typing.Optional[bool] = None,
|
|
263
|
+
organization_id: typing.Optional[str] = None,
|
|
264
|
+
) -> UsageAndPlan:
|
|
261
265
|
"""
|
|
262
266
|
Get usage for a project
|
|
263
267
|
|
|
264
268
|
Parameters:
|
|
265
269
|
- project_id: typing.Optional[str].
|
|
266
270
|
|
|
271
|
+
- get_current_invoice_total: typing.Optional[bool].
|
|
272
|
+
|
|
267
273
|
- organization_id: typing.Optional[str].
|
|
268
274
|
---
|
|
269
275
|
from llama_cloud.client import LlamaCloud
|
|
@@ -276,12 +282,14 @@ class ProjectsClient:
|
|
|
276
282
|
_response = self._client_wrapper.httpx_client.request(
|
|
277
283
|
"GET",
|
|
278
284
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/projects/{project_id}/usage"),
|
|
279
|
-
params=remove_none_from_dict(
|
|
285
|
+
params=remove_none_from_dict(
|
|
286
|
+
{"get_current_invoice_total": get_current_invoice_total, "organization_id": organization_id}
|
|
287
|
+
),
|
|
280
288
|
headers=self._client_wrapper.get_headers(),
|
|
281
289
|
timeout=60,
|
|
282
290
|
)
|
|
283
291
|
if 200 <= _response.status_code < 300:
|
|
284
|
-
return pydantic.parse_obj_as(
|
|
292
|
+
return pydantic.parse_obj_as(UsageAndPlan, _response.json()) # type: ignore
|
|
285
293
|
if _response.status_code == 422:
|
|
286
294
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
287
295
|
try:
|
|
@@ -943,14 +951,20 @@ class AsyncProjectsClient:
|
|
|
943
951
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
944
952
|
|
|
945
953
|
async def get_project_usage(
|
|
946
|
-
self,
|
|
947
|
-
|
|
954
|
+
self,
|
|
955
|
+
project_id: typing.Optional[str],
|
|
956
|
+
*,
|
|
957
|
+
get_current_invoice_total: typing.Optional[bool] = None,
|
|
958
|
+
organization_id: typing.Optional[str] = None,
|
|
959
|
+
) -> UsageAndPlan:
|
|
948
960
|
"""
|
|
949
961
|
Get usage for a project
|
|
950
962
|
|
|
951
963
|
Parameters:
|
|
952
964
|
- project_id: typing.Optional[str].
|
|
953
965
|
|
|
966
|
+
- get_current_invoice_total: typing.Optional[bool].
|
|
967
|
+
|
|
954
968
|
- organization_id: typing.Optional[str].
|
|
955
969
|
---
|
|
956
970
|
from llama_cloud.client import AsyncLlamaCloud
|
|
@@ -963,12 +977,14 @@ class AsyncProjectsClient:
|
|
|
963
977
|
_response = await self._client_wrapper.httpx_client.request(
|
|
964
978
|
"GET",
|
|
965
979
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/projects/{project_id}/usage"),
|
|
966
|
-
params=remove_none_from_dict(
|
|
980
|
+
params=remove_none_from_dict(
|
|
981
|
+
{"get_current_invoice_total": get_current_invoice_total, "organization_id": organization_id}
|
|
982
|
+
),
|
|
967
983
|
headers=self._client_wrapper.get_headers(),
|
|
968
984
|
timeout=60,
|
|
969
985
|
)
|
|
970
986
|
if 200 <= _response.status_code < 300:
|
|
971
|
-
return pydantic.parse_obj_as(
|
|
987
|
+
return pydantic.parse_obj_as(UsageAndPlan, _response.json()) # type: ignore
|
|
972
988
|
if _response.status_code == 422:
|
|
973
989
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
974
990
|
try:
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
5
|
import urllib.parse
|
|
5
6
|
from json.decoder import JSONDecodeError
|
|
6
7
|
|
|
7
8
|
from ...core.api_error import ApiError
|
|
8
9
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
|
+
from ...core.datetime_utils import serialize_datetime
|
|
9
11
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
10
12
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
11
13
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
@@ -451,7 +453,7 @@ class ReportsClient:
|
|
|
451
453
|
self,
|
|
452
454
|
report_id: str,
|
|
453
455
|
*,
|
|
454
|
-
|
|
456
|
+
after: typing.Optional[dt.datetime] = None,
|
|
455
457
|
project_id: typing.Optional[str] = None,
|
|
456
458
|
organization_id: typing.Optional[str] = None,
|
|
457
459
|
) -> typing.List[ReportEventItem]:
|
|
@@ -461,7 +463,7 @@ class ReportsClient:
|
|
|
461
463
|
Parameters:
|
|
462
464
|
- report_id: str.
|
|
463
465
|
|
|
464
|
-
-
|
|
466
|
+
- after: typing.Optional[dt.datetime].
|
|
465
467
|
|
|
466
468
|
- project_id: typing.Optional[str].
|
|
467
469
|
|
|
@@ -480,7 +482,11 @@ class ReportsClient:
|
|
|
480
482
|
"GET",
|
|
481
483
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/reports/{report_id}/events"),
|
|
482
484
|
params=remove_none_from_dict(
|
|
483
|
-
{
|
|
485
|
+
{
|
|
486
|
+
"after": serialize_datetime(after) if after is not None else None,
|
|
487
|
+
"project_id": project_id,
|
|
488
|
+
"organization_id": organization_id,
|
|
489
|
+
}
|
|
484
490
|
),
|
|
485
491
|
headers=self._client_wrapper.get_headers(),
|
|
486
492
|
timeout=60,
|
|
@@ -1043,7 +1049,7 @@ class AsyncReportsClient:
|
|
|
1043
1049
|
self,
|
|
1044
1050
|
report_id: str,
|
|
1045
1051
|
*,
|
|
1046
|
-
|
|
1052
|
+
after: typing.Optional[dt.datetime] = None,
|
|
1047
1053
|
project_id: typing.Optional[str] = None,
|
|
1048
1054
|
organization_id: typing.Optional[str] = None,
|
|
1049
1055
|
) -> typing.List[ReportEventItem]:
|
|
@@ -1053,7 +1059,7 @@ class AsyncReportsClient:
|
|
|
1053
1059
|
Parameters:
|
|
1054
1060
|
- report_id: str.
|
|
1055
1061
|
|
|
1056
|
-
-
|
|
1062
|
+
- after: typing.Optional[dt.datetime].
|
|
1057
1063
|
|
|
1058
1064
|
- project_id: typing.Optional[str].
|
|
1059
1065
|
|
|
@@ -1072,7 +1078,11 @@ class AsyncReportsClient:
|
|
|
1072
1078
|
"GET",
|
|
1073
1079
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/reports/{report_id}/events"),
|
|
1074
1080
|
params=remove_none_from_dict(
|
|
1075
|
-
{
|
|
1081
|
+
{
|
|
1082
|
+
"after": serialize_datetime(after) if after is not None else None,
|
|
1083
|
+
"project_id": project_id,
|
|
1084
|
+
"organization_id": organization_id,
|
|
1085
|
+
}
|
|
1076
1086
|
),
|
|
1077
1087
|
headers=self._client_wrapper.get_headers(),
|
|
1078
1088
|
timeout=60,
|