llama-cloud 0.1.5__py3-none-any.whl → 0.1.7a1__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 (129) hide show
  1. llama_cloud/__init__.py +138 -2
  2. llama_cloud/client.py +15 -0
  3. llama_cloud/resources/__init__.py +17 -1
  4. llama_cloud/resources/chat_apps/__init__.py +2 -0
  5. llama_cloud/resources/chat_apps/client.py +620 -0
  6. llama_cloud/resources/data_sinks/client.py +2 -2
  7. llama_cloud/resources/data_sources/client.py +2 -2
  8. llama_cloud/resources/embedding_model_configs/client.py +4 -4
  9. llama_cloud/resources/files/__init__.py +2 -2
  10. llama_cloud/resources/files/client.py +21 -0
  11. llama_cloud/resources/files/types/__init__.py +2 -1
  12. llama_cloud/resources/files/types/file_create_permission_info_value.py +7 -0
  13. llama_cloud/resources/jobs/__init__.py +2 -0
  14. llama_cloud/resources/jobs/client.py +148 -0
  15. llama_cloud/resources/llama_extract/__init__.py +5 -0
  16. llama_cloud/resources/llama_extract/client.py +1038 -0
  17. llama_cloud/resources/llama_extract/types/__init__.py +6 -0
  18. llama_cloud/resources/llama_extract/types/extract_agent_create_data_schema_value.py +7 -0
  19. llama_cloud/resources/llama_extract/types/extract_agent_update_data_schema_value.py +7 -0
  20. llama_cloud/resources/organizations/client.py +14 -14
  21. llama_cloud/resources/parsing/client.py +480 -229
  22. llama_cloud/resources/pipelines/client.py +182 -126
  23. llama_cloud/resources/projects/client.py +210 -102
  24. llama_cloud/resources/reports/__init__.py +5 -0
  25. llama_cloud/resources/reports/client.py +1198 -0
  26. llama_cloud/resources/reports/types/__init__.py +7 -0
  27. llama_cloud/resources/reports/types/update_report_plan_api_v_1_reports_report_id_plan_patch_request_action.py +25 -0
  28. llama_cloud/resources/retrievers/__init__.py +2 -0
  29. llama_cloud/resources/retrievers/client.py +654 -0
  30. llama_cloud/types/__init__.py +124 -2
  31. llama_cloud/types/{chat_message.py → app_schema_chat_chat_message.py} +2 -2
  32. llama_cloud/types/chat_app.py +44 -0
  33. llama_cloud/types/chat_app_response.py +41 -0
  34. llama_cloud/types/cloud_az_storage_blob_data_source.py +1 -0
  35. llama_cloud/types/cloud_box_data_source.py +1 -0
  36. llama_cloud/types/cloud_confluence_data_source.py +1 -0
  37. llama_cloud/types/cloud_google_drive_data_source.py +1 -0
  38. llama_cloud/types/cloud_jira_data_source.py +1 -0
  39. llama_cloud/types/cloud_notion_page_data_source.py +1 -0
  40. llama_cloud/types/cloud_one_drive_data_source.py +1 -0
  41. llama_cloud/types/cloud_postgres_vector_store.py +1 -0
  42. llama_cloud/types/cloud_s_3_data_source.py +1 -0
  43. llama_cloud/types/cloud_sharepoint_data_source.py +1 -0
  44. llama_cloud/types/cloud_slack_data_source.py +1 -0
  45. llama_cloud/types/composite_retrieval_mode.py +21 -0
  46. llama_cloud/types/composite_retrieval_result.py +38 -0
  47. llama_cloud/types/composite_retrieved_text_node.py +42 -0
  48. llama_cloud/types/data_sink.py +1 -1
  49. llama_cloud/types/data_sink_create.py +1 -1
  50. llama_cloud/types/data_source.py +1 -1
  51. llama_cloud/types/data_source_create.py +1 -1
  52. llama_cloud/types/edit_suggestion.py +39 -0
  53. llama_cloud/types/eval_dataset_job_record.py +1 -0
  54. llama_cloud/types/extract_agent.py +45 -0
  55. llama_cloud/types/extract_agent_data_schema_value.py +5 -0
  56. llama_cloud/types/extract_config.py +40 -0
  57. llama_cloud/types/extract_job.py +35 -0
  58. llama_cloud/types/extract_job_create.py +40 -0
  59. llama_cloud/types/extract_job_create_data_schema_override_value.py +7 -0
  60. llama_cloud/types/extract_mode.py +17 -0
  61. llama_cloud/types/extract_resultset.py +46 -0
  62. llama_cloud/types/extract_resultset_data.py +11 -0
  63. llama_cloud/types/extract_resultset_data_item_value.py +7 -0
  64. llama_cloud/types/extract_resultset_data_zero_value.py +7 -0
  65. llama_cloud/types/extract_resultset_extraction_metadata_value.py +7 -0
  66. llama_cloud/types/file.py +3 -0
  67. llama_cloud/types/file_permission_info_value.py +5 -0
  68. llama_cloud/types/filter_condition.py +9 -1
  69. llama_cloud/types/filter_operator.py +4 -0
  70. llama_cloud/types/image_block.py +35 -0
  71. llama_cloud/types/input_message.py +1 -1
  72. llama_cloud/types/job_name_mapping.py +4 -0
  73. llama_cloud/types/job_names.py +89 -0
  74. llama_cloud/types/job_record.py +57 -0
  75. llama_cloud/types/job_record_with_usage_metrics.py +36 -0
  76. llama_cloud/types/llama_index_core_base_llms_types_chat_message.py +39 -0
  77. llama_cloud/types/llama_index_core_base_llms_types_chat_message_blocks_item.py +33 -0
  78. llama_cloud/types/llama_parse_parameters.py +15 -0
  79. llama_cloud/types/llm.py +1 -0
  80. llama_cloud/types/llm_model_data.py +1 -0
  81. llama_cloud/types/llm_parameters.py +1 -0
  82. llama_cloud/types/managed_ingestion_status.py +4 -0
  83. llama_cloud/types/managed_ingestion_status_response.py +1 -0
  84. llama_cloud/types/object_type.py +4 -0
  85. llama_cloud/types/organization.py +5 -0
  86. llama_cloud/types/paginated_jobs_history_with_metrics.py +35 -0
  87. llama_cloud/types/paginated_report_response.py +35 -0
  88. llama_cloud/types/parse_plan_level.py +21 -0
  89. llama_cloud/types/parsing_job_structured_result.py +32 -0
  90. llama_cloud/types/pipeline_create.py +3 -1
  91. llama_cloud/types/pipeline_data_source.py +1 -1
  92. llama_cloud/types/pipeline_file.py +3 -0
  93. llama_cloud/types/pipeline_file_permission_info_value.py +7 -0
  94. llama_cloud/types/playground_session.py +2 -2
  95. llama_cloud/types/preset_retrieval_params.py +1 -0
  96. llama_cloud/types/progress_event.py +44 -0
  97. llama_cloud/types/progress_event_status.py +33 -0
  98. llama_cloud/types/prompt_spec.py +2 -2
  99. llama_cloud/types/related_node_info.py +2 -2
  100. llama_cloud/types/related_node_info_node_type.py +7 -0
  101. llama_cloud/types/report.py +33 -0
  102. llama_cloud/types/report_block.py +34 -0
  103. llama_cloud/types/report_block_dependency.py +29 -0
  104. llama_cloud/types/report_create_response.py +31 -0
  105. llama_cloud/types/report_event_item.py +40 -0
  106. llama_cloud/types/report_event_item_event_data.py +45 -0
  107. llama_cloud/types/report_event_type.py +37 -0
  108. llama_cloud/types/report_metadata.py +39 -0
  109. llama_cloud/types/report_plan.py +36 -0
  110. llama_cloud/types/report_plan_block.py +36 -0
  111. llama_cloud/types/report_query.py +33 -0
  112. llama_cloud/types/report_response.py +41 -0
  113. llama_cloud/types/report_state.py +37 -0
  114. llama_cloud/types/report_state_event.py +38 -0
  115. llama_cloud/types/report_update_event.py +38 -0
  116. llama_cloud/types/retrieve_results.py +1 -1
  117. llama_cloud/types/retriever.py +45 -0
  118. llama_cloud/types/retriever_create.py +37 -0
  119. llama_cloud/types/retriever_pipeline.py +37 -0
  120. llama_cloud/types/status_enum.py +4 -0
  121. llama_cloud/types/supported_llm_model_names.py +4 -0
  122. llama_cloud/types/text_block.py +31 -0
  123. llama_cloud/types/text_node.py +13 -6
  124. llama_cloud/types/usage_metric_response.py +34 -0
  125. llama_cloud/types/user_job_record.py +32 -0
  126. {llama_cloud-0.1.5.dist-info → llama_cloud-0.1.7a1.dist-info}/METADATA +3 -1
  127. {llama_cloud-0.1.5.dist-info → llama_cloud-0.1.7a1.dist-info}/RECORD +129 -59
  128. {llama_cloud-0.1.5.dist-info → llama_cloud-0.1.7a1.dist-info}/WHEEL +1 -1
  129. {llama_cloud-0.1.5.dist-info → llama_cloud-0.1.7a1.dist-info}/LICENSE +0 -0
@@ -1,5 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from .types import FileCreateFromUrlResourceInfoValue, FileCreateResourceInfoValue
3
+ from .types import FileCreateFromUrlResourceInfoValue, FileCreatePermissionInfoValue, FileCreateResourceInfoValue
4
4
 
5
- __all__ = ["FileCreateFromUrlResourceInfoValue", "FileCreateResourceInfoValue"]
5
+ __all__ = ["FileCreateFromUrlResourceInfoValue", "FileCreatePermissionInfoValue", "FileCreateResourceInfoValue"]
@@ -15,6 +15,7 @@ from ...types.http_validation_error import HttpValidationError
15
15
  from ...types.page_screenshot_metadata import PageScreenshotMetadata
16
16
  from ...types.presigned_url import PresignedUrl
17
17
  from .types.file_create_from_url_resource_info_value import FileCreateFromUrlResourceInfoValue
18
+ from .types.file_create_permission_info_value import FileCreatePermissionInfoValue
18
19
  from .types.file_create_resource_info_value import FileCreateResourceInfoValue
19
20
 
20
21
  try:
@@ -188,9 +189,11 @@ class FilesClient:
188
189
  project_id: typing.Optional[str] = None,
189
190
  organization_id: typing.Optional[str] = None,
190
191
  name: str,
192
+ external_file_id: typing.Optional[str] = OMIT,
191
193
  file_size: typing.Optional[int] = OMIT,
192
194
  last_modified_at: typing.Optional[dt.datetime] = OMIT,
193
195
  resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]] = OMIT,
196
+ permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]] = OMIT,
194
197
  data_source_id: typing.Optional[str] = OMIT,
195
198
  ) -> PresignedUrl:
196
199
  """
@@ -203,12 +206,16 @@ class FilesClient:
203
206
 
204
207
  - name: str.
205
208
 
209
+ - external_file_id: typing.Optional[str].
210
+
206
211
  - file_size: typing.Optional[int].
207
212
 
208
213
  - last_modified_at: typing.Optional[dt.datetime].
209
214
 
210
215
  - resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]].
211
216
 
217
+ - permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]].
218
+
212
219
  - data_source_id: typing.Optional[str].
213
220
  ---
214
221
  from llama_cloud.client import LlamaCloud
@@ -221,12 +228,16 @@ class FilesClient:
221
228
  )
222
229
  """
223
230
  _request: typing.Dict[str, typing.Any] = {"name": name}
231
+ if external_file_id is not OMIT:
232
+ _request["external_file_id"] = external_file_id
224
233
  if file_size is not OMIT:
225
234
  _request["file_size"] = file_size
226
235
  if last_modified_at is not OMIT:
227
236
  _request["last_modified_at"] = last_modified_at
228
237
  if resource_info is not OMIT:
229
238
  _request["resource_info"] = resource_info
239
+ if permission_info is not OMIT:
240
+ _request["permission_info"] = permission_info
230
241
  if data_source_id is not OMIT:
231
242
  _request["data_source_id"] = data_source_id
232
243
  _response = self._client_wrapper.httpx_client.request(
@@ -644,9 +655,11 @@ class AsyncFilesClient:
644
655
  project_id: typing.Optional[str] = None,
645
656
  organization_id: typing.Optional[str] = None,
646
657
  name: str,
658
+ external_file_id: typing.Optional[str] = OMIT,
647
659
  file_size: typing.Optional[int] = OMIT,
648
660
  last_modified_at: typing.Optional[dt.datetime] = OMIT,
649
661
  resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]] = OMIT,
662
+ permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]] = OMIT,
650
663
  data_source_id: typing.Optional[str] = OMIT,
651
664
  ) -> PresignedUrl:
652
665
  """
@@ -659,12 +672,16 @@ class AsyncFilesClient:
659
672
 
660
673
  - name: str.
661
674
 
675
+ - external_file_id: typing.Optional[str].
676
+
662
677
  - file_size: typing.Optional[int].
663
678
 
664
679
  - last_modified_at: typing.Optional[dt.datetime].
665
680
 
666
681
  - resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]].
667
682
 
683
+ - permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]].
684
+
668
685
  - data_source_id: typing.Optional[str].
669
686
  ---
670
687
  from llama_cloud.client import AsyncLlamaCloud
@@ -677,12 +694,16 @@ class AsyncFilesClient:
677
694
  )
678
695
  """
679
696
  _request: typing.Dict[str, typing.Any] = {"name": name}
697
+ if external_file_id is not OMIT:
698
+ _request["external_file_id"] = external_file_id
680
699
  if file_size is not OMIT:
681
700
  _request["file_size"] = file_size
682
701
  if last_modified_at is not OMIT:
683
702
  _request["last_modified_at"] = last_modified_at
684
703
  if resource_info is not OMIT:
685
704
  _request["resource_info"] = resource_info
705
+ if permission_info is not OMIT:
706
+ _request["permission_info"] = permission_info
686
707
  if data_source_id is not OMIT:
687
708
  _request["data_source_id"] = data_source_id
688
709
  _response = await self._client_wrapper.httpx_client.request(
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from .file_create_from_url_resource_info_value import FileCreateFromUrlResourceInfoValue
4
+ from .file_create_permission_info_value import FileCreatePermissionInfoValue
4
5
  from .file_create_resource_info_value import FileCreateResourceInfoValue
5
6
 
6
- __all__ = ["FileCreateFromUrlResourceInfoValue", "FileCreateResourceInfoValue"]
7
+ __all__ = ["FileCreateFromUrlResourceInfoValue", "FileCreatePermissionInfoValue", "FileCreateResourceInfoValue"]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FileCreatePermissionInfoValue = typing.Union[
6
+ typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool
7
+ ]
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,148 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ import urllib.parse
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.remove_none_from_dict import remove_none_from_dict
10
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
11
+ from ...types.http_validation_error import HttpValidationError
12
+ from ...types.paginated_jobs_history_with_metrics import PaginatedJobsHistoryWithMetrics
13
+
14
+ try:
15
+ import pydantic
16
+ if pydantic.__version__.startswith("1."):
17
+ raise ImportError
18
+ import pydantic.v1 as pydantic # type: ignore
19
+ except ImportError:
20
+ import pydantic # type: ignore
21
+
22
+
23
+ class JobsClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def get_jobs_api_v_1_jobs_get(
28
+ self,
29
+ *,
30
+ job_name: typing.Optional[str] = None,
31
+ limit: typing.Optional[int] = None,
32
+ offset: typing.Optional[int] = None,
33
+ include_usage_metrics: typing.Optional[bool] = None,
34
+ project_id: typing.Optional[str] = None,
35
+ organization_id: typing.Optional[str] = None,
36
+ ) -> PaginatedJobsHistoryWithMetrics:
37
+ """
38
+ Get jobs for a project.
39
+
40
+ Parameters:
41
+ - job_name: typing.Optional[str].
42
+
43
+ - limit: typing.Optional[int].
44
+
45
+ - offset: typing.Optional[int].
46
+
47
+ - include_usage_metrics: typing.Optional[bool].
48
+
49
+ - project_id: typing.Optional[str].
50
+
51
+ - organization_id: typing.Optional[str].
52
+ ---
53
+ from llama_cloud.client import LlamaCloud
54
+
55
+ client = LlamaCloud(
56
+ token="YOUR_TOKEN",
57
+ )
58
+ client.jobs.get_jobs_api_v_1_jobs_get()
59
+ """
60
+ _response = self._client_wrapper.httpx_client.request(
61
+ "GET",
62
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/jobs"),
63
+ params=remove_none_from_dict(
64
+ {
65
+ "job_name": job_name,
66
+ "limit": limit,
67
+ "offset": offset,
68
+ "include_usage_metrics": include_usage_metrics,
69
+ "project_id": project_id,
70
+ "organization_id": organization_id,
71
+ }
72
+ ),
73
+ headers=self._client_wrapper.get_headers(),
74
+ timeout=60,
75
+ )
76
+ if 200 <= _response.status_code < 300:
77
+ return pydantic.parse_obj_as(PaginatedJobsHistoryWithMetrics, _response.json()) # type: ignore
78
+ if _response.status_code == 422:
79
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
80
+ try:
81
+ _response_json = _response.json()
82
+ except JSONDecodeError:
83
+ raise ApiError(status_code=_response.status_code, body=_response.text)
84
+ raise ApiError(status_code=_response.status_code, body=_response_json)
85
+
86
+
87
+ class AsyncJobsClient:
88
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
89
+ self._client_wrapper = client_wrapper
90
+
91
+ async def get_jobs_api_v_1_jobs_get(
92
+ self,
93
+ *,
94
+ job_name: typing.Optional[str] = None,
95
+ limit: typing.Optional[int] = None,
96
+ offset: typing.Optional[int] = None,
97
+ include_usage_metrics: typing.Optional[bool] = None,
98
+ project_id: typing.Optional[str] = None,
99
+ organization_id: typing.Optional[str] = None,
100
+ ) -> PaginatedJobsHistoryWithMetrics:
101
+ """
102
+ Get jobs for a project.
103
+
104
+ Parameters:
105
+ - job_name: typing.Optional[str].
106
+
107
+ - limit: typing.Optional[int].
108
+
109
+ - offset: typing.Optional[int].
110
+
111
+ - include_usage_metrics: typing.Optional[bool].
112
+
113
+ - project_id: typing.Optional[str].
114
+
115
+ - organization_id: typing.Optional[str].
116
+ ---
117
+ from llama_cloud.client import AsyncLlamaCloud
118
+
119
+ client = AsyncLlamaCloud(
120
+ token="YOUR_TOKEN",
121
+ )
122
+ await client.jobs.get_jobs_api_v_1_jobs_get()
123
+ """
124
+ _response = await self._client_wrapper.httpx_client.request(
125
+ "GET",
126
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/jobs"),
127
+ params=remove_none_from_dict(
128
+ {
129
+ "job_name": job_name,
130
+ "limit": limit,
131
+ "offset": offset,
132
+ "include_usage_metrics": include_usage_metrics,
133
+ "project_id": project_id,
134
+ "organization_id": organization_id,
135
+ }
136
+ ),
137
+ headers=self._client_wrapper.get_headers(),
138
+ timeout=60,
139
+ )
140
+ if 200 <= _response.status_code < 300:
141
+ return pydantic.parse_obj_as(PaginatedJobsHistoryWithMetrics, _response.json()) # type: ignore
142
+ if _response.status_code == 422:
143
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
144
+ try:
145
+ _response_json = _response.json()
146
+ except JSONDecodeError:
147
+ raise ApiError(status_code=_response.status_code, body=_response.text)
148
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import ExtractAgentCreateDataSchemaValue, ExtractAgentUpdateDataSchemaValue
4
+
5
+ __all__ = ["ExtractAgentCreateDataSchemaValue", "ExtractAgentUpdateDataSchemaValue"]