llama-cloud 0.1.17__py3-none-any.whl → 0.1.19__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.

Files changed (55) hide show
  1. llama_cloud/__init__.py +36 -18
  2. llama_cloud/client.py +3 -0
  3. llama_cloud/resources/__init__.py +20 -0
  4. llama_cloud/resources/beta/__init__.py +2 -0
  5. llama_cloud/resources/beta/client.py +371 -0
  6. llama_cloud/resources/chat_apps/client.py +4 -4
  7. llama_cloud/resources/embedding_model_configs/client.py +82 -22
  8. llama_cloud/resources/llama_extract/__init__.py +21 -0
  9. llama_cloud/resources/llama_extract/client.py +223 -114
  10. llama_cloud/resources/llama_extract/types/__init__.py +21 -0
  11. llama_cloud/resources/parsing/client.py +83 -29
  12. llama_cloud/resources/pipelines/client.py +107 -2
  13. llama_cloud/resources/projects/client.py +70 -0
  14. llama_cloud/types/__init__.py +26 -26
  15. llama_cloud/types/{parsing_usage.py → audio_block.py} +5 -3
  16. llama_cloud/types/batch.py +47 -0
  17. llama_cloud/types/batch_item.py +40 -0
  18. llama_cloud/types/{extract_agent_update.py → batch_paginated_list.py} +6 -9
  19. llama_cloud/types/{extract_schema_validate_request.py → batch_public_output.py} +7 -3
  20. llama_cloud/types/cloud_confluence_data_source.py +1 -0
  21. llama_cloud/types/cloud_postgres_vector_store.py +2 -0
  22. llama_cloud/types/cloud_sharepoint_data_source.py +1 -0
  23. llama_cloud/types/extract_config.py +2 -0
  24. llama_cloud/types/fail_page_mode.py +29 -0
  25. llama_cloud/types/{extract_agent_create.py → file_count_by_status_response.py} +8 -10
  26. llama_cloud/types/file_parse_public.py +36 -0
  27. llama_cloud/types/job_names.py +8 -12
  28. llama_cloud/types/llama_extract_settings.py +2 -2
  29. llama_cloud/types/llama_index_core_base_llms_types_chat_message_blocks_item.py +13 -1
  30. llama_cloud/types/llama_parse_parameters.py +10 -2
  31. llama_cloud/types/markdown_node_parser.py +4 -0
  32. llama_cloud/types/message_role.py +4 -0
  33. llama_cloud/types/pg_vector_distance_method.py +43 -0
  34. llama_cloud/types/{extract_job_create_batch.py → pg_vector_hnsw_settings.py} +12 -9
  35. llama_cloud/types/pg_vector_vector_type.py +35 -0
  36. llama_cloud/types/pipeline_create.py +1 -0
  37. llama_cloud/types/pipeline_data_source.py +3 -0
  38. llama_cloud/types/pipeline_data_source_status.py +33 -0
  39. llama_cloud/types/pipeline_file.py +1 -0
  40. llama_cloud/types/prompt_conf.py +3 -0
  41. llama_cloud/types/struct_parse_conf.py +4 -1
  42. llama_cloud/types/supported_llm_model_names.py +0 -12
  43. llama_cloud/types/token_text_splitter.py +3 -0
  44. {llama_cloud-0.1.17.dist-info → llama_cloud-0.1.19.dist-info}/METADATA +1 -1
  45. {llama_cloud-0.1.17.dist-info → llama_cloud-0.1.19.dist-info}/RECORD +55 -45
  46. /llama_cloud/{types → resources/llama_extract/types}/extract_agent_create_data_schema.py +0 -0
  47. /llama_cloud/{types → resources/llama_extract/types}/extract_agent_create_data_schema_zero_value.py +0 -0
  48. /llama_cloud/{types → resources/llama_extract/types}/extract_agent_update_data_schema.py +0 -0
  49. /llama_cloud/{types → resources/llama_extract/types}/extract_agent_update_data_schema_zero_value.py +0 -0
  50. /llama_cloud/{types → resources/llama_extract/types}/extract_job_create_batch_data_schema_override.py +0 -0
  51. /llama_cloud/{types → resources/llama_extract/types}/extract_job_create_batch_data_schema_override_zero_value.py +0 -0
  52. /llama_cloud/{types → resources/llama_extract/types}/extract_schema_validate_request_data_schema.py +0 -0
  53. /llama_cloud/{types → resources/llama_extract/types}/extract_schema_validate_request_data_schema_zero_value.py +0 -0
  54. {llama_cloud-0.1.17.dist-info → llama_cloud-0.1.19.dist-info}/LICENSE +0 -0
  55. {llama_cloud-0.1.17.dist-info → llama_cloud-0.1.19.dist-info}/WHEEL +0 -0
@@ -9,6 +9,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
9
  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
+ from ...types.fail_page_mode import FailPageMode
12
13
  from ...types.http_validation_error import HttpValidationError
13
14
  from ...types.llama_parse_supported_file_extensions import LlamaParseSupportedFileExtensions
14
15
  from ...types.parser_languages import ParserLanguages
@@ -19,7 +20,6 @@ from ...types.parsing_job_markdown_result import ParsingJobMarkdownResult
19
20
  from ...types.parsing_job_structured_result import ParsingJobStructuredResult
20
21
  from ...types.parsing_job_text_result import ParsingJobTextResult
21
22
  from ...types.parsing_mode import ParsingMode
22
- from ...types.parsing_usage import ParsingUsage
23
23
  from ...types.presigned_url import PresignedUrl
24
24
 
25
25
  try:
@@ -212,6 +212,7 @@ class ParsingClient:
212
212
  bbox_left: float,
213
213
  bbox_right: float,
214
214
  bbox_top: float,
215
+ compact_markdown_table: bool,
215
216
  disable_ocr: bool,
216
217
  disable_reconstruction: bool,
217
218
  disable_image_extraction: bool,
@@ -250,6 +251,10 @@ class ParsingClient:
250
251
  webhook_url: str,
251
252
  preset: str,
252
253
  parse_mode: typing.Optional[ParsingMode] = OMIT,
254
+ page_error_tolerance: float,
255
+ replace_failed_page_mode: typing.Optional[FailPageMode] = OMIT,
256
+ replace_failed_page_with_error_message_prefix: str,
257
+ replace_failed_page_with_error_message_suffix: str,
253
258
  system_prompt: str,
254
259
  system_prompt_append: str,
255
260
  user_prompt: str,
@@ -259,8 +264,10 @@ class ParsingClient:
259
264
  strict_mode_image_ocr: bool,
260
265
  strict_mode_reconstruction: bool,
261
266
  strict_mode_buggy_font: bool,
267
+ save_images: bool,
262
268
  ignore_document_elements_for_layout_detection: bool,
263
269
  output_tables_as_html: bool,
270
+ markdown_table_multiline_header_separator: str,
264
271
  use_vendor_multimodal_model: bool,
265
272
  bounding_box: str,
266
273
  gpt_4_o_mode: bool,
@@ -275,8 +282,6 @@ class ParsingClient:
275
282
  formatting_instruction: str,
276
283
  ) -> ParsingJob:
277
284
  """
278
- Upload a file to s3 and create a job. return a job id
279
-
280
285
  Parameters:
281
286
  - organization_id: typing.Optional[str].
282
287
 
@@ -314,6 +319,8 @@ class ParsingClient:
314
319
 
315
320
  - bbox_top: float.
316
321
 
322
+ - compact_markdown_table: bool.
323
+
317
324
  - disable_ocr: bool.
318
325
 
319
326
  - disable_reconstruction: bool.
@@ -390,6 +397,14 @@ class ParsingClient:
390
397
 
391
398
  - parse_mode: typing.Optional[ParsingMode].
392
399
 
400
+ - page_error_tolerance: float.
401
+
402
+ - replace_failed_page_mode: typing.Optional[FailPageMode].
403
+
404
+ - replace_failed_page_with_error_message_prefix: str.
405
+
406
+ - replace_failed_page_with_error_message_suffix: str.
407
+
393
408
  - system_prompt: str.
394
409
 
395
410
  - system_prompt_append: str.
@@ -408,10 +423,14 @@ class ParsingClient:
408
423
 
409
424
  - strict_mode_buggy_font: bool.
410
425
 
426
+ - save_images: bool.
427
+
411
428
  - ignore_document_elements_for_layout_detection: bool.
412
429
 
413
430
  - output_tables_as_html: bool.
414
431
 
432
+ - markdown_table_multiline_header_separator: str.
433
+
415
434
  - use_vendor_multimodal_model: bool.
416
435
 
417
436
  - bounding_box: str.
@@ -452,6 +471,7 @@ class ParsingClient:
452
471
  "bbox_left": bbox_left,
453
472
  "bbox_right": bbox_right,
454
473
  "bbox_top": bbox_top,
474
+ "compact_markdown_table": compact_markdown_table,
455
475
  "disable_ocr": disable_ocr,
456
476
  "disable_reconstruction": disable_reconstruction,
457
477
  "disable_image_extraction": disable_image_extraction,
@@ -488,6 +508,9 @@ class ParsingClient:
488
508
  "model": model,
489
509
  "webhook_url": webhook_url,
490
510
  "preset": preset,
511
+ "page_error_tolerance": page_error_tolerance,
512
+ "replace_failed_page_with_error_message_prefix": replace_failed_page_with_error_message_prefix,
513
+ "replace_failed_page_with_error_message_suffix": replace_failed_page_with_error_message_suffix,
491
514
  "system_prompt": system_prompt,
492
515
  "system_prompt_append": system_prompt_append,
493
516
  "user_prompt": user_prompt,
@@ -497,8 +520,10 @@ class ParsingClient:
497
520
  "strict_mode_image_ocr": strict_mode_image_ocr,
498
521
  "strict_mode_reconstruction": strict_mode_reconstruction,
499
522
  "strict_mode_buggy_font": strict_mode_buggy_font,
523
+ "save_images": save_images,
500
524
  "ignore_document_elements_for_layout_detection": ignore_document_elements_for_layout_detection,
501
525
  "output_tables_as_HTML": output_tables_as_html,
526
+ "markdown_table_multiline_header_separator": markdown_table_multiline_header_separator,
502
527
  "use_vendor_multimodal_model": use_vendor_multimodal_model,
503
528
  "bounding_box": bounding_box,
504
529
  "gpt4o_mode": gpt_4_o_mode,
@@ -518,6 +543,8 @@ class ParsingClient:
518
543
  _request["max_pages"] = max_pages
519
544
  if parse_mode is not OMIT:
520
545
  _request["parse_mode"] = parse_mode
546
+ if replace_failed_page_mode is not OMIT:
547
+ _request["replace_failed_page_mode"] = replace_failed_page_mode
521
548
  _response = self._client_wrapper.httpx_client.request(
522
549
  "POST",
523
550
  urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/upload"),
@@ -536,30 +563,30 @@ class ParsingClient:
536
563
  raise ApiError(status_code=_response.status_code, body=_response.text)
537
564
  raise ApiError(status_code=_response.status_code, body=_response_json)
538
565
 
539
- def usage(self, *, organization_id: typing.Optional[str] = None) -> ParsingUsage:
566
+ def get_job(self, job_id: str) -> ParsingJob:
540
567
  """
541
- DEPRECATED: use either /organizations/{organization_id}/usage or /projects/{project_id}/usage instead
542
- Get parsing usage for user
568
+ Get a job by id
543
569
 
544
570
  Parameters:
545
- - organization_id: typing.Optional[str].
571
+ - job_id: str.
546
572
  ---
547
573
  from llama_cloud.client import LlamaCloud
548
574
 
549
575
  client = LlamaCloud(
550
576
  token="YOUR_TOKEN",
551
577
  )
552
- client.parsing.usage()
578
+ client.parsing.get_job(
579
+ job_id="string",
580
+ )
553
581
  """
554
582
  _response = self._client_wrapper.httpx_client.request(
555
583
  "GET",
556
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/usage"),
557
- params=remove_none_from_dict({"organization_id": organization_id}),
584
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
558
585
  headers=self._client_wrapper.get_headers(),
559
586
  timeout=60,
560
587
  )
561
588
  if 200 <= _response.status_code < 300:
562
- return pydantic.parse_obj_as(ParsingUsage, _response.json()) # type: ignore
589
+ return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
563
590
  if _response.status_code == 422:
564
591
  raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
565
592
  try:
@@ -568,7 +595,7 @@ class ParsingClient:
568
595
  raise ApiError(status_code=_response.status_code, body=_response.text)
569
596
  raise ApiError(status_code=_response.status_code, body=_response_json)
570
597
 
571
- def get_job(self, job_id: str) -> ParsingJob:
598
+ def get_job_parameters(self, job_id: str) -> typing.Any:
572
599
  """
573
600
  Get a job by id
574
601
 
@@ -580,18 +607,18 @@ class ParsingClient:
580
607
  client = LlamaCloud(
581
608
  token="YOUR_TOKEN",
582
609
  )
583
- client.parsing.get_job(
610
+ client.parsing.get_job_parameters(
584
611
  job_id="string",
585
612
  )
586
613
  """
587
614
  _response = self._client_wrapper.httpx_client.request(
588
615
  "GET",
589
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
616
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/parameters"),
590
617
  headers=self._client_wrapper.get_headers(),
591
618
  timeout=60,
592
619
  )
593
620
  if 200 <= _response.status_code < 300:
594
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
621
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
595
622
  if _response.status_code == 422:
596
623
  raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
597
624
  try:
@@ -1192,6 +1219,7 @@ class AsyncParsingClient:
1192
1219
  bbox_left: float,
1193
1220
  bbox_right: float,
1194
1221
  bbox_top: float,
1222
+ compact_markdown_table: bool,
1195
1223
  disable_ocr: bool,
1196
1224
  disable_reconstruction: bool,
1197
1225
  disable_image_extraction: bool,
@@ -1230,6 +1258,10 @@ class AsyncParsingClient:
1230
1258
  webhook_url: str,
1231
1259
  preset: str,
1232
1260
  parse_mode: typing.Optional[ParsingMode] = OMIT,
1261
+ page_error_tolerance: float,
1262
+ replace_failed_page_mode: typing.Optional[FailPageMode] = OMIT,
1263
+ replace_failed_page_with_error_message_prefix: str,
1264
+ replace_failed_page_with_error_message_suffix: str,
1233
1265
  system_prompt: str,
1234
1266
  system_prompt_append: str,
1235
1267
  user_prompt: str,
@@ -1239,8 +1271,10 @@ class AsyncParsingClient:
1239
1271
  strict_mode_image_ocr: bool,
1240
1272
  strict_mode_reconstruction: bool,
1241
1273
  strict_mode_buggy_font: bool,
1274
+ save_images: bool,
1242
1275
  ignore_document_elements_for_layout_detection: bool,
1243
1276
  output_tables_as_html: bool,
1277
+ markdown_table_multiline_header_separator: str,
1244
1278
  use_vendor_multimodal_model: bool,
1245
1279
  bounding_box: str,
1246
1280
  gpt_4_o_mode: bool,
@@ -1255,8 +1289,6 @@ class AsyncParsingClient:
1255
1289
  formatting_instruction: str,
1256
1290
  ) -> ParsingJob:
1257
1291
  """
1258
- Upload a file to s3 and create a job. return a job id
1259
-
1260
1292
  Parameters:
1261
1293
  - organization_id: typing.Optional[str].
1262
1294
 
@@ -1294,6 +1326,8 @@ class AsyncParsingClient:
1294
1326
 
1295
1327
  - bbox_top: float.
1296
1328
 
1329
+ - compact_markdown_table: bool.
1330
+
1297
1331
  - disable_ocr: bool.
1298
1332
 
1299
1333
  - disable_reconstruction: bool.
@@ -1370,6 +1404,14 @@ class AsyncParsingClient:
1370
1404
 
1371
1405
  - parse_mode: typing.Optional[ParsingMode].
1372
1406
 
1407
+ - page_error_tolerance: float.
1408
+
1409
+ - replace_failed_page_mode: typing.Optional[FailPageMode].
1410
+
1411
+ - replace_failed_page_with_error_message_prefix: str.
1412
+
1413
+ - replace_failed_page_with_error_message_suffix: str.
1414
+
1373
1415
  - system_prompt: str.
1374
1416
 
1375
1417
  - system_prompt_append: str.
@@ -1388,10 +1430,14 @@ class AsyncParsingClient:
1388
1430
 
1389
1431
  - strict_mode_buggy_font: bool.
1390
1432
 
1433
+ - save_images: bool.
1434
+
1391
1435
  - ignore_document_elements_for_layout_detection: bool.
1392
1436
 
1393
1437
  - output_tables_as_html: bool.
1394
1438
 
1439
+ - markdown_table_multiline_header_separator: str.
1440
+
1395
1441
  - use_vendor_multimodal_model: bool.
1396
1442
 
1397
1443
  - bounding_box: str.
@@ -1432,6 +1478,7 @@ class AsyncParsingClient:
1432
1478
  "bbox_left": bbox_left,
1433
1479
  "bbox_right": bbox_right,
1434
1480
  "bbox_top": bbox_top,
1481
+ "compact_markdown_table": compact_markdown_table,
1435
1482
  "disable_ocr": disable_ocr,
1436
1483
  "disable_reconstruction": disable_reconstruction,
1437
1484
  "disable_image_extraction": disable_image_extraction,
@@ -1468,6 +1515,9 @@ class AsyncParsingClient:
1468
1515
  "model": model,
1469
1516
  "webhook_url": webhook_url,
1470
1517
  "preset": preset,
1518
+ "page_error_tolerance": page_error_tolerance,
1519
+ "replace_failed_page_with_error_message_prefix": replace_failed_page_with_error_message_prefix,
1520
+ "replace_failed_page_with_error_message_suffix": replace_failed_page_with_error_message_suffix,
1471
1521
  "system_prompt": system_prompt,
1472
1522
  "system_prompt_append": system_prompt_append,
1473
1523
  "user_prompt": user_prompt,
@@ -1477,8 +1527,10 @@ class AsyncParsingClient:
1477
1527
  "strict_mode_image_ocr": strict_mode_image_ocr,
1478
1528
  "strict_mode_reconstruction": strict_mode_reconstruction,
1479
1529
  "strict_mode_buggy_font": strict_mode_buggy_font,
1530
+ "save_images": save_images,
1480
1531
  "ignore_document_elements_for_layout_detection": ignore_document_elements_for_layout_detection,
1481
1532
  "output_tables_as_HTML": output_tables_as_html,
1533
+ "markdown_table_multiline_header_separator": markdown_table_multiline_header_separator,
1482
1534
  "use_vendor_multimodal_model": use_vendor_multimodal_model,
1483
1535
  "bounding_box": bounding_box,
1484
1536
  "gpt4o_mode": gpt_4_o_mode,
@@ -1498,6 +1550,8 @@ class AsyncParsingClient:
1498
1550
  _request["max_pages"] = max_pages
1499
1551
  if parse_mode is not OMIT:
1500
1552
  _request["parse_mode"] = parse_mode
1553
+ if replace_failed_page_mode is not OMIT:
1554
+ _request["replace_failed_page_mode"] = replace_failed_page_mode
1501
1555
  _response = await self._client_wrapper.httpx_client.request(
1502
1556
  "POST",
1503
1557
  urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/upload"),
@@ -1516,30 +1570,30 @@ class AsyncParsingClient:
1516
1570
  raise ApiError(status_code=_response.status_code, body=_response.text)
1517
1571
  raise ApiError(status_code=_response.status_code, body=_response_json)
1518
1572
 
1519
- async def usage(self, *, organization_id: typing.Optional[str] = None) -> ParsingUsage:
1573
+ async def get_job(self, job_id: str) -> ParsingJob:
1520
1574
  """
1521
- DEPRECATED: use either /organizations/{organization_id}/usage or /projects/{project_id}/usage instead
1522
- Get parsing usage for user
1575
+ Get a job by id
1523
1576
 
1524
1577
  Parameters:
1525
- - organization_id: typing.Optional[str].
1578
+ - job_id: str.
1526
1579
  ---
1527
1580
  from llama_cloud.client import AsyncLlamaCloud
1528
1581
 
1529
1582
  client = AsyncLlamaCloud(
1530
1583
  token="YOUR_TOKEN",
1531
1584
  )
1532
- await client.parsing.usage()
1585
+ await client.parsing.get_job(
1586
+ job_id="string",
1587
+ )
1533
1588
  """
1534
1589
  _response = await self._client_wrapper.httpx_client.request(
1535
1590
  "GET",
1536
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/parsing/usage"),
1537
- params=remove_none_from_dict({"organization_id": organization_id}),
1591
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
1538
1592
  headers=self._client_wrapper.get_headers(),
1539
1593
  timeout=60,
1540
1594
  )
1541
1595
  if 200 <= _response.status_code < 300:
1542
- return pydantic.parse_obj_as(ParsingUsage, _response.json()) # type: ignore
1596
+ return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
1543
1597
  if _response.status_code == 422:
1544
1598
  raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1545
1599
  try:
@@ -1548,7 +1602,7 @@ class AsyncParsingClient:
1548
1602
  raise ApiError(status_code=_response.status_code, body=_response.text)
1549
1603
  raise ApiError(status_code=_response.status_code, body=_response_json)
1550
1604
 
1551
- async def get_job(self, job_id: str) -> ParsingJob:
1605
+ async def get_job_parameters(self, job_id: str) -> typing.Any:
1552
1606
  """
1553
1607
  Get a job by id
1554
1608
 
@@ -1560,18 +1614,18 @@ class AsyncParsingClient:
1560
1614
  client = AsyncLlamaCloud(
1561
1615
  token="YOUR_TOKEN",
1562
1616
  )
1563
- await client.parsing.get_job(
1617
+ await client.parsing.get_job_parameters(
1564
1618
  job_id="string",
1565
1619
  )
1566
1620
  """
1567
1621
  _response = await self._client_wrapper.httpx_client.request(
1568
1622
  "GET",
1569
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}"),
1623
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/parsing/job/{job_id}/parameters"),
1570
1624
  headers=self._client_wrapper.get_headers(),
1571
1625
  timeout=60,
1572
1626
  )
1573
1627
  if 200 <= _response.status_code < 300:
1574
- return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
1628
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
1575
1629
  if _response.status_code == 422:
1576
1630
  raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
1577
1631
  try:
@@ -15,6 +15,7 @@ from ...types.cloud_document_create import CloudDocumentCreate
15
15
  from ...types.configured_transformation_item import ConfiguredTransformationItem
16
16
  from ...types.data_sink_create import DataSinkCreate
17
17
  from ...types.eval_execution_params import EvalExecutionParams
18
+ from ...types.file_count_by_status_response import FileCountByStatusResponse
18
19
  from ...types.http_validation_error import HttpValidationError
19
20
  from ...types.input_message import InputMessage
20
21
  from ...types.llama_parse_parameters import LlamaParseParameters
@@ -216,6 +217,7 @@ class PipelinesClient:
216
217
  preset_retrieval_parameters: typing.Optional[PresetRetrievalParams] = OMIT,
217
218
  eval_parameters: typing.Optional[EvalExecutionParams] = OMIT,
218
219
  llama_parse_parameters: typing.Optional[LlamaParseParameters] = OMIT,
220
+ status: typing.Optional[str] = OMIT,
219
221
  name: typing.Optional[str] = OMIT,
220
222
  managed_pipeline_id: typing.Optional[str] = OMIT,
221
223
  ) -> Pipeline:
@@ -243,6 +245,8 @@ class PipelinesClient:
243
245
 
244
246
  - llama_parse_parameters: typing.Optional[LlamaParseParameters].
245
247
 
248
+ - status: typing.Optional[str].
249
+
246
250
  - name: typing.Optional[str].
247
251
 
248
252
  - managed_pipeline_id: typing.Optional[str].
@@ -266,6 +270,8 @@ class PipelinesClient:
266
270
  _request["eval_parameters"] = eval_parameters
267
271
  if llama_parse_parameters is not OMIT:
268
272
  _request["llama_parse_parameters"] = llama_parse_parameters
273
+ if status is not OMIT:
274
+ _request["status"] = status
269
275
  if name is not OMIT:
270
276
  _request["name"] = name
271
277
  if managed_pipeline_id is not OMIT:
@@ -559,6 +565,53 @@ class PipelinesClient:
559
565
  raise ApiError(status_code=_response.status_code, body=_response.text)
560
566
  raise ApiError(status_code=_response.status_code, body=_response_json)
561
567
 
568
+ def get_pipeline_file_status_counts(
569
+ self,
570
+ pipeline_id: str,
571
+ *,
572
+ data_source_id: typing.Optional[str] = None,
573
+ only_manually_uploaded: typing.Optional[bool] = None,
574
+ ) -> FileCountByStatusResponse:
575
+ """
576
+ Get files for a pipeline.
577
+
578
+ Parameters:
579
+ - pipeline_id: str.
580
+
581
+ - data_source_id: typing.Optional[str].
582
+
583
+ - only_manually_uploaded: typing.Optional[bool].
584
+ ---
585
+ from llama_cloud.client import LlamaCloud
586
+
587
+ client = LlamaCloud(
588
+ token="YOUR_TOKEN",
589
+ )
590
+ client.pipelines.get_pipeline_file_status_counts(
591
+ pipeline_id="string",
592
+ )
593
+ """
594
+ _response = self._client_wrapper.httpx_client.request(
595
+ "GET",
596
+ urllib.parse.urljoin(
597
+ f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/files/status-counts"
598
+ ),
599
+ params=remove_none_from_dict(
600
+ {"data_source_id": data_source_id, "only_manually_uploaded": only_manually_uploaded}
601
+ ),
602
+ headers=self._client_wrapper.get_headers(),
603
+ timeout=60,
604
+ )
605
+ if 200 <= _response.status_code < 300:
606
+ return pydantic.parse_obj_as(FileCountByStatusResponse, _response.json()) # type: ignore
607
+ if _response.status_code == 422:
608
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
609
+ try:
610
+ _response_json = _response.json()
611
+ except JSONDecodeError:
612
+ raise ApiError(status_code=_response.status_code, body=_response.text)
613
+ raise ApiError(status_code=_response.status_code, body=_response_json)
614
+
562
615
  def get_pipeline_file_status(self, file_id: str, pipeline_id: str) -> ManagedIngestionStatusResponse:
563
616
  """
564
617
  Get status of a file for a pipeline.
@@ -1218,7 +1271,7 @@ class PipelinesClient:
1218
1271
  retrieval_mode=RetrievalMode.CHUNKS,
1219
1272
  ),
1220
1273
  llm_parameters=LlmParameters(
1221
- model_name=SupportedLlmModelNames.GPT_3_5_TURBO,
1274
+ model_name=SupportedLlmModelNames.GPT_4_O,
1222
1275
  ),
1223
1276
  ),
1224
1277
  )
@@ -1771,6 +1824,7 @@ class AsyncPipelinesClient:
1771
1824
  preset_retrieval_parameters: typing.Optional[PresetRetrievalParams] = OMIT,
1772
1825
  eval_parameters: typing.Optional[EvalExecutionParams] = OMIT,
1773
1826
  llama_parse_parameters: typing.Optional[LlamaParseParameters] = OMIT,
1827
+ status: typing.Optional[str] = OMIT,
1774
1828
  name: typing.Optional[str] = OMIT,
1775
1829
  managed_pipeline_id: typing.Optional[str] = OMIT,
1776
1830
  ) -> Pipeline:
@@ -1798,6 +1852,8 @@ class AsyncPipelinesClient:
1798
1852
 
1799
1853
  - llama_parse_parameters: typing.Optional[LlamaParseParameters].
1800
1854
 
1855
+ - status: typing.Optional[str].
1856
+
1801
1857
  - name: typing.Optional[str].
1802
1858
 
1803
1859
  - managed_pipeline_id: typing.Optional[str].
@@ -1821,6 +1877,8 @@ class AsyncPipelinesClient:
1821
1877
  _request["eval_parameters"] = eval_parameters
1822
1878
  if llama_parse_parameters is not OMIT:
1823
1879
  _request["llama_parse_parameters"] = llama_parse_parameters
1880
+ if status is not OMIT:
1881
+ _request["status"] = status
1824
1882
  if name is not OMIT:
1825
1883
  _request["name"] = name
1826
1884
  if managed_pipeline_id is not OMIT:
@@ -2114,6 +2172,53 @@ class AsyncPipelinesClient:
2114
2172
  raise ApiError(status_code=_response.status_code, body=_response.text)
2115
2173
  raise ApiError(status_code=_response.status_code, body=_response_json)
2116
2174
 
2175
+ async def get_pipeline_file_status_counts(
2176
+ self,
2177
+ pipeline_id: str,
2178
+ *,
2179
+ data_source_id: typing.Optional[str] = None,
2180
+ only_manually_uploaded: typing.Optional[bool] = None,
2181
+ ) -> FileCountByStatusResponse:
2182
+ """
2183
+ Get files for a pipeline.
2184
+
2185
+ Parameters:
2186
+ - pipeline_id: str.
2187
+
2188
+ - data_source_id: typing.Optional[str].
2189
+
2190
+ - only_manually_uploaded: typing.Optional[bool].
2191
+ ---
2192
+ from llama_cloud.client import AsyncLlamaCloud
2193
+
2194
+ client = AsyncLlamaCloud(
2195
+ token="YOUR_TOKEN",
2196
+ )
2197
+ await client.pipelines.get_pipeline_file_status_counts(
2198
+ pipeline_id="string",
2199
+ )
2200
+ """
2201
+ _response = await self._client_wrapper.httpx_client.request(
2202
+ "GET",
2203
+ urllib.parse.urljoin(
2204
+ f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/files/status-counts"
2205
+ ),
2206
+ params=remove_none_from_dict(
2207
+ {"data_source_id": data_source_id, "only_manually_uploaded": only_manually_uploaded}
2208
+ ),
2209
+ headers=self._client_wrapper.get_headers(),
2210
+ timeout=60,
2211
+ )
2212
+ if 200 <= _response.status_code < 300:
2213
+ return pydantic.parse_obj_as(FileCountByStatusResponse, _response.json()) # type: ignore
2214
+ if _response.status_code == 422:
2215
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
2216
+ try:
2217
+ _response_json = _response.json()
2218
+ except JSONDecodeError:
2219
+ raise ApiError(status_code=_response.status_code, body=_response.text)
2220
+ raise ApiError(status_code=_response.status_code, body=_response_json)
2221
+
2117
2222
  async def get_pipeline_file_status(self, file_id: str, pipeline_id: str) -> ManagedIngestionStatusResponse:
2118
2223
  """
2119
2224
  Get status of a file for a pipeline.
@@ -2775,7 +2880,7 @@ class AsyncPipelinesClient:
2775
2880
  retrieval_mode=RetrievalMode.CHUNKS,
2776
2881
  ),
2777
2882
  llm_parameters=LlmParameters(
2778
- model_name=SupportedLlmModelNames.GPT_3_5_TURBO,
2883
+ model_name=SupportedLlmModelNames.GPT_4_O,
2779
2884
  ),
2780
2885
  ),
2781
2886
  )
@@ -250,6 +250,41 @@ class ProjectsClient:
250
250
  raise ApiError(status_code=_response.status_code, body=_response.text)
251
251
  raise ApiError(status_code=_response.status_code, body=_response_json)
252
252
 
253
+ def get_current_project(
254
+ self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
255
+ ) -> Project:
256
+ """
257
+ Get the current project.
258
+
259
+ Parameters:
260
+ - project_id: typing.Optional[str].
261
+
262
+ - organization_id: typing.Optional[str].
263
+ ---
264
+ from llama_cloud.client import LlamaCloud
265
+
266
+ client = LlamaCloud(
267
+ token="YOUR_TOKEN",
268
+ )
269
+ client.projects.get_current_project()
270
+ """
271
+ _response = self._client_wrapper.httpx_client.request(
272
+ "GET",
273
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/projects/current"),
274
+ params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
275
+ headers=self._client_wrapper.get_headers(),
276
+ timeout=60,
277
+ )
278
+ if 200 <= _response.status_code < 300:
279
+ return pydantic.parse_obj_as(Project, _response.json()) # type: ignore
280
+ if _response.status_code == 422:
281
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
282
+ try:
283
+ _response_json = _response.json()
284
+ except JSONDecodeError:
285
+ raise ApiError(status_code=_response.status_code, body=_response.text)
286
+ raise ApiError(status_code=_response.status_code, body=_response_json)
287
+
253
288
  def get_project_usage(
254
289
  self,
255
290
  project_id: typing.Optional[str],
@@ -522,6 +557,41 @@ class AsyncProjectsClient:
522
557
  raise ApiError(status_code=_response.status_code, body=_response.text)
523
558
  raise ApiError(status_code=_response.status_code, body=_response_json)
524
559
 
560
+ async def get_current_project(
561
+ self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
562
+ ) -> Project:
563
+ """
564
+ Get the current project.
565
+
566
+ Parameters:
567
+ - project_id: typing.Optional[str].
568
+
569
+ - organization_id: typing.Optional[str].
570
+ ---
571
+ from llama_cloud.client import AsyncLlamaCloud
572
+
573
+ client = AsyncLlamaCloud(
574
+ token="YOUR_TOKEN",
575
+ )
576
+ await client.projects.get_current_project()
577
+ """
578
+ _response = await self._client_wrapper.httpx_client.request(
579
+ "GET",
580
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/projects/current"),
581
+ params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
582
+ headers=self._client_wrapper.get_headers(),
583
+ timeout=60,
584
+ )
585
+ if 200 <= _response.status_code < 300:
586
+ return pydantic.parse_obj_as(Project, _response.json()) # type: ignore
587
+ if _response.status_code == 422:
588
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
589
+ try:
590
+ _response_json = _response.json()
591
+ except JSONDecodeError:
592
+ raise ApiError(status_code=_response.status_code, body=_response.text)
593
+ raise ApiError(status_code=_response.status_code, body=_response_json)
594
+
525
595
  async def get_project_usage(
526
596
  self,
527
597
  project_id: typing.Optional[str],