llama-cloud 0.0.1__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 (173) hide show
  1. llama_cloud/__init__.py +295 -0
  2. llama_cloud/client.py +72 -0
  3. llama_cloud/core/__init__.py +17 -0
  4. llama_cloud/core/api_error.py +15 -0
  5. llama_cloud/core/client_wrapper.py +51 -0
  6. llama_cloud/core/datetime_utils.py +28 -0
  7. llama_cloud/core/jsonable_encoder.py +103 -0
  8. llama_cloud/core/remove_none_from_dict.py +11 -0
  9. llama_cloud/errors/__init__.py +5 -0
  10. llama_cloud/errors/unprocessable_entity_error.py +9 -0
  11. llama_cloud/resources/__init__.py +40 -0
  12. llama_cloud/resources/api_keys/__init__.py +2 -0
  13. llama_cloud/resources/api_keys/client.py +302 -0
  14. llama_cloud/resources/billing/__init__.py +2 -0
  15. llama_cloud/resources/billing/client.py +234 -0
  16. llama_cloud/resources/component_definitions/__init__.py +2 -0
  17. llama_cloud/resources/component_definitions/client.py +192 -0
  18. llama_cloud/resources/data_sinks/__init__.py +5 -0
  19. llama_cloud/resources/data_sinks/client.py +506 -0
  20. llama_cloud/resources/data_sinks/types/__init__.py +6 -0
  21. llama_cloud/resources/data_sinks/types/data_sink_update_component.py +7 -0
  22. llama_cloud/resources/data_sinks/types/data_sink_update_component_one.py +17 -0
  23. llama_cloud/resources/data_sources/__init__.py +5 -0
  24. llama_cloud/resources/data_sources/client.py +521 -0
  25. llama_cloud/resources/data_sources/types/__init__.py +7 -0
  26. llama_cloud/resources/data_sources/types/data_source_update_component.py +7 -0
  27. llama_cloud/resources/data_sources/types/data_source_update_component_one.py +19 -0
  28. llama_cloud/resources/data_sources/types/data_source_update_custom_metadata_value.py +7 -0
  29. llama_cloud/resources/deprecated/__init__.py +2 -0
  30. llama_cloud/resources/deprecated/client.py +982 -0
  31. llama_cloud/resources/evals/__init__.py +2 -0
  32. llama_cloud/resources/evals/client.py +745 -0
  33. llama_cloud/resources/files/__init__.py +5 -0
  34. llama_cloud/resources/files/client.py +560 -0
  35. llama_cloud/resources/files/types/__init__.py +5 -0
  36. llama_cloud/resources/files/types/file_create_resource_info_value.py +5 -0
  37. llama_cloud/resources/parsing/__init__.py +2 -0
  38. llama_cloud/resources/parsing/client.py +982 -0
  39. llama_cloud/resources/pipelines/__init__.py +5 -0
  40. llama_cloud/resources/pipelines/client.py +2599 -0
  41. llama_cloud/resources/pipelines/types/__init__.py +5 -0
  42. llama_cloud/resources/pipelines/types/pipeline_file_update_custom_metadata_value.py +7 -0
  43. llama_cloud/resources/projects/__init__.py +2 -0
  44. llama_cloud/resources/projects/client.py +1231 -0
  45. llama_cloud/types/__init__.py +253 -0
  46. llama_cloud/types/api_key.py +37 -0
  47. llama_cloud/types/azure_open_ai_embedding.py +75 -0
  48. llama_cloud/types/base.py +26 -0
  49. llama_cloud/types/base_prompt_template.py +44 -0
  50. llama_cloud/types/bedrock_embedding.py +56 -0
  51. llama_cloud/types/chat_message.py +35 -0
  52. llama_cloud/types/cloud_az_storage_blob_data_source.py +40 -0
  53. llama_cloud/types/cloud_chroma_vector_store.py +40 -0
  54. llama_cloud/types/cloud_document.py +36 -0
  55. llama_cloud/types/cloud_document_create.py +36 -0
  56. llama_cloud/types/cloud_gcs_data_source.py +37 -0
  57. llama_cloud/types/cloud_google_drive_data_source.py +36 -0
  58. llama_cloud/types/cloud_one_drive_data_source.py +38 -0
  59. llama_cloud/types/cloud_pinecone_vector_store.py +46 -0
  60. llama_cloud/types/cloud_postgres_vector_store.py +44 -0
  61. llama_cloud/types/cloud_qdrant_vector_store.py +48 -0
  62. llama_cloud/types/cloud_s_3_data_source.py +42 -0
  63. llama_cloud/types/cloud_sharepoint_data_source.py +38 -0
  64. llama_cloud/types/cloud_weaviate_vector_store.py +38 -0
  65. llama_cloud/types/code_splitter.py +46 -0
  66. llama_cloud/types/cohere_embedding.py +46 -0
  67. llama_cloud/types/configurable_data_sink_names.py +37 -0
  68. llama_cloud/types/configurable_data_source_names.py +41 -0
  69. llama_cloud/types/configurable_transformation_definition.py +45 -0
  70. llama_cloud/types/configurable_transformation_names.py +73 -0
  71. llama_cloud/types/configured_transformation_item.py +43 -0
  72. llama_cloud/types/configured_transformation_item_component.py +9 -0
  73. llama_cloud/types/configured_transformation_item_component_one.py +35 -0
  74. llama_cloud/types/data_sink.py +40 -0
  75. llama_cloud/types/data_sink_component.py +7 -0
  76. llama_cloud/types/data_sink_component_one.py +17 -0
  77. llama_cloud/types/data_sink_create.py +36 -0
  78. llama_cloud/types/data_sink_create_component.py +7 -0
  79. llama_cloud/types/data_sink_create_component_one.py +17 -0
  80. llama_cloud/types/data_sink_definition.py +41 -0
  81. llama_cloud/types/data_source.py +44 -0
  82. llama_cloud/types/data_source_component.py +7 -0
  83. llama_cloud/types/data_source_component_one.py +19 -0
  84. llama_cloud/types/data_source_create.py +40 -0
  85. llama_cloud/types/data_source_create_component.py +7 -0
  86. llama_cloud/types/data_source_create_component_one.py +19 -0
  87. llama_cloud/types/data_source_create_custom_metadata_value.py +7 -0
  88. llama_cloud/types/data_source_custom_metadata_value.py +7 -0
  89. llama_cloud/types/data_source_definition.py +41 -0
  90. llama_cloud/types/eval_dataset.py +37 -0
  91. llama_cloud/types/eval_dataset_job_params.py +36 -0
  92. llama_cloud/types/eval_dataset_job_record.py +59 -0
  93. llama_cloud/types/eval_execution_params.py +38 -0
  94. llama_cloud/types/eval_execution_params_override.py +38 -0
  95. llama_cloud/types/eval_llm_model_data.py +33 -0
  96. llama_cloud/types/eval_question.py +39 -0
  97. llama_cloud/types/eval_question_create.py +28 -0
  98. llama_cloud/types/eval_question_result.py +49 -0
  99. llama_cloud/types/file.py +46 -0
  100. llama_cloud/types/file_resource_info_value.py +5 -0
  101. llama_cloud/types/filter_condition.py +21 -0
  102. llama_cloud/types/filter_operator.py +65 -0
  103. llama_cloud/types/gemini_embedding.py +51 -0
  104. llama_cloud/types/html_node_parser.py +44 -0
  105. llama_cloud/types/http_validation_error.py +29 -0
  106. llama_cloud/types/hugging_face_inference_api_embedding.py +68 -0
  107. llama_cloud/types/hugging_face_inference_api_embedding_token.py +5 -0
  108. llama_cloud/types/json_node_parser.py +43 -0
  109. llama_cloud/types/llama_parse_supported_file_extensions.py +161 -0
  110. llama_cloud/types/llm.py +55 -0
  111. llama_cloud/types/local_eval.py +46 -0
  112. llama_cloud/types/local_eval_results.py +37 -0
  113. llama_cloud/types/local_eval_sets.py +30 -0
  114. llama_cloud/types/managed_ingestion_status.py +37 -0
  115. llama_cloud/types/markdown_element_node_parser.py +49 -0
  116. llama_cloud/types/markdown_node_parser.py +43 -0
  117. llama_cloud/types/message_role.py +45 -0
  118. llama_cloud/types/metadata_filter.py +41 -0
  119. llama_cloud/types/metadata_filter_value.py +5 -0
  120. llama_cloud/types/metadata_filters.py +41 -0
  121. llama_cloud/types/metadata_filters_filters_item.py +8 -0
  122. llama_cloud/types/metric_result.py +30 -0
  123. llama_cloud/types/node_parser.py +37 -0
  124. llama_cloud/types/object_type.py +33 -0
  125. llama_cloud/types/open_ai_embedding.py +73 -0
  126. llama_cloud/types/parser_languages.py +361 -0
  127. llama_cloud/types/parsing_history_item.py +36 -0
  128. llama_cloud/types/parsing_job.py +30 -0
  129. llama_cloud/types/parsing_job_json_result.py +29 -0
  130. llama_cloud/types/parsing_job_markdown_result.py +29 -0
  131. llama_cloud/types/parsing_job_text_result.py +29 -0
  132. llama_cloud/types/parsing_usage.py +29 -0
  133. llama_cloud/types/pipeline.py +64 -0
  134. llama_cloud/types/pipeline_create.py +61 -0
  135. llama_cloud/types/pipeline_data_source.py +46 -0
  136. llama_cloud/types/pipeline_data_source_component.py +7 -0
  137. llama_cloud/types/pipeline_data_source_component_one.py +19 -0
  138. llama_cloud/types/pipeline_data_source_create.py +32 -0
  139. llama_cloud/types/pipeline_data_source_custom_metadata_value.py +7 -0
  140. llama_cloud/types/pipeline_deployment.py +38 -0
  141. llama_cloud/types/pipeline_file.py +52 -0
  142. llama_cloud/types/pipeline_file_create.py +36 -0
  143. llama_cloud/types/pipeline_file_create_custom_metadata_value.py +7 -0
  144. llama_cloud/types/pipeline_file_custom_metadata_value.py +7 -0
  145. llama_cloud/types/pipeline_file_resource_info_value.py +7 -0
  146. llama_cloud/types/pipeline_file_status_response.py +35 -0
  147. llama_cloud/types/pipeline_type.py +21 -0
  148. llama_cloud/types/pooling.py +29 -0
  149. llama_cloud/types/preset_retrieval_params.py +40 -0
  150. llama_cloud/types/presigned_url.py +36 -0
  151. llama_cloud/types/project.py +42 -0
  152. llama_cloud/types/project_create.py +32 -0
  153. llama_cloud/types/prompt_mixin_prompts.py +36 -0
  154. llama_cloud/types/prompt_spec.py +35 -0
  155. llama_cloud/types/pydantic_program_mode.py +41 -0
  156. llama_cloud/types/related_node_info.py +37 -0
  157. llama_cloud/types/retrieve_results.py +40 -0
  158. llama_cloud/types/sentence_splitter.py +48 -0
  159. llama_cloud/types/simple_file_node_parser.py +44 -0
  160. llama_cloud/types/status_enum.py +33 -0
  161. llama_cloud/types/supported_eval_llm_model.py +35 -0
  162. llama_cloud/types/supported_eval_llm_model_names.py +29 -0
  163. llama_cloud/types/text_node.py +62 -0
  164. llama_cloud/types/text_node_relationships_value.py +7 -0
  165. llama_cloud/types/text_node_with_score.py +36 -0
  166. llama_cloud/types/token_text_splitter.py +43 -0
  167. llama_cloud/types/transformation_category_names.py +21 -0
  168. llama_cloud/types/validation_error.py +31 -0
  169. llama_cloud/types/validation_error_loc_item.py +5 -0
  170. llama_cloud-0.0.1.dist-info/LICENSE +21 -0
  171. llama_cloud-0.0.1.dist-info/METADATA +25 -0
  172. llama_cloud-0.0.1.dist-info/RECORD +173 -0
  173. llama_cloud-0.0.1.dist-info/WHEEL +4 -0
@@ -0,0 +1,192 @@
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 ...types.configurable_transformation_definition import ConfigurableTransformationDefinition
10
+ from ...types.data_sink_definition import DataSinkDefinition
11
+ from ...types.data_source_definition import DataSourceDefinition
12
+
13
+ try:
14
+ import pydantic.v1 as pydantic # type: ignore
15
+ except ImportError:
16
+ import pydantic # type: ignore
17
+
18
+
19
+ class ComponentDefinitionsClient:
20
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
21
+ self._client_wrapper = client_wrapper
22
+
23
+ def get_all_transformation_definitions(self) -> typing.List[ConfigurableTransformationDefinition]:
24
+ """
25
+ Get all configurable transformation component definitions.
26
+
27
+ ---
28
+ from platform.client import PlatformApi
29
+
30
+ client = PlatformApi(
31
+ token="YOUR_TOKEN",
32
+ base_url="https://yourhost.com/path/to/api",
33
+ )
34
+ client.component_definitions.get_all_transformation_definitions()
35
+ """
36
+ _response = self._client_wrapper.httpx_client.request(
37
+ "GET",
38
+ urllib.parse.urljoin(
39
+ f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/configurable-transformations"
40
+ ),
41
+ headers=self._client_wrapper.get_headers(),
42
+ timeout=60,
43
+ )
44
+ if 200 <= _response.status_code < 300:
45
+ return pydantic.parse_obj_as(typing.List[ConfigurableTransformationDefinition], _response.json()) # type: ignore
46
+ try:
47
+ _response_json = _response.json()
48
+ except JSONDecodeError:
49
+ raise ApiError(status_code=_response.status_code, body=_response.text)
50
+ raise ApiError(status_code=_response.status_code, body=_response_json)
51
+
52
+ def get_all_data_source_definitions(self) -> typing.List[DataSourceDefinition]:
53
+ """
54
+ Get all data source component definitions.
55
+
56
+ ---
57
+ from platform.client import PlatformApi
58
+
59
+ client = PlatformApi(
60
+ token="YOUR_TOKEN",
61
+ base_url="https://yourhost.com/path/to/api",
62
+ )
63
+ client.component_definitions.get_all_data_source_definitions()
64
+ """
65
+ _response = self._client_wrapper.httpx_client.request(
66
+ "GET",
67
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/data-sources"),
68
+ headers=self._client_wrapper.get_headers(),
69
+ timeout=60,
70
+ )
71
+ if 200 <= _response.status_code < 300:
72
+ return pydantic.parse_obj_as(typing.List[DataSourceDefinition], _response.json()) # type: ignore
73
+ try:
74
+ _response_json = _response.json()
75
+ except JSONDecodeError:
76
+ raise ApiError(status_code=_response.status_code, body=_response.text)
77
+ raise ApiError(status_code=_response.status_code, body=_response_json)
78
+
79
+ def get_all_data_sink_definitions(self) -> typing.List[DataSinkDefinition]:
80
+ """
81
+ Get all data sink component definitions.
82
+
83
+ ---
84
+ from platform.client import PlatformApi
85
+
86
+ client = PlatformApi(
87
+ token="YOUR_TOKEN",
88
+ base_url="https://yourhost.com/path/to/api",
89
+ )
90
+ client.component_definitions.get_all_data_sink_definitions()
91
+ """
92
+ _response = self._client_wrapper.httpx_client.request(
93
+ "GET",
94
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/data-sinks"),
95
+ headers=self._client_wrapper.get_headers(),
96
+ timeout=60,
97
+ )
98
+ if 200 <= _response.status_code < 300:
99
+ return pydantic.parse_obj_as(typing.List[DataSinkDefinition], _response.json()) # type: ignore
100
+ try:
101
+ _response_json = _response.json()
102
+ except JSONDecodeError:
103
+ raise ApiError(status_code=_response.status_code, body=_response.text)
104
+ raise ApiError(status_code=_response.status_code, body=_response_json)
105
+
106
+
107
+ class AsyncComponentDefinitionsClient:
108
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
109
+ self._client_wrapper = client_wrapper
110
+
111
+ async def get_all_transformation_definitions(self) -> typing.List[ConfigurableTransformationDefinition]:
112
+ """
113
+ Get all configurable transformation component definitions.
114
+
115
+ ---
116
+ from platform.client import AsyncPlatformApi
117
+
118
+ client = AsyncPlatformApi(
119
+ token="YOUR_TOKEN",
120
+ base_url="https://yourhost.com/path/to/api",
121
+ )
122
+ await client.component_definitions.get_all_transformation_definitions()
123
+ """
124
+ _response = await self._client_wrapper.httpx_client.request(
125
+ "GET",
126
+ urllib.parse.urljoin(
127
+ f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/configurable-transformations"
128
+ ),
129
+ headers=self._client_wrapper.get_headers(),
130
+ timeout=60,
131
+ )
132
+ if 200 <= _response.status_code < 300:
133
+ return pydantic.parse_obj_as(typing.List[ConfigurableTransformationDefinition], _response.json()) # type: ignore
134
+ try:
135
+ _response_json = _response.json()
136
+ except JSONDecodeError:
137
+ raise ApiError(status_code=_response.status_code, body=_response.text)
138
+ raise ApiError(status_code=_response.status_code, body=_response_json)
139
+
140
+ async def get_all_data_source_definitions(self) -> typing.List[DataSourceDefinition]:
141
+ """
142
+ Get all data source component definitions.
143
+
144
+ ---
145
+ from platform.client import AsyncPlatformApi
146
+
147
+ client = AsyncPlatformApi(
148
+ token="YOUR_TOKEN",
149
+ base_url="https://yourhost.com/path/to/api",
150
+ )
151
+ await client.component_definitions.get_all_data_source_definitions()
152
+ """
153
+ _response = await self._client_wrapper.httpx_client.request(
154
+ "GET",
155
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/data-sources"),
156
+ headers=self._client_wrapper.get_headers(),
157
+ timeout=60,
158
+ )
159
+ if 200 <= _response.status_code < 300:
160
+ return pydantic.parse_obj_as(typing.List[DataSourceDefinition], _response.json()) # type: ignore
161
+ try:
162
+ _response_json = _response.json()
163
+ except JSONDecodeError:
164
+ raise ApiError(status_code=_response.status_code, body=_response.text)
165
+ raise ApiError(status_code=_response.status_code, body=_response_json)
166
+
167
+ async def get_all_data_sink_definitions(self) -> typing.List[DataSinkDefinition]:
168
+ """
169
+ Get all data sink component definitions.
170
+
171
+ ---
172
+ from platform.client import AsyncPlatformApi
173
+
174
+ client = AsyncPlatformApi(
175
+ token="YOUR_TOKEN",
176
+ base_url="https://yourhost.com/path/to/api",
177
+ )
178
+ await client.component_definitions.get_all_data_sink_definitions()
179
+ """
180
+ _response = await self._client_wrapper.httpx_client.request(
181
+ "GET",
182
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/component-definition/data-sinks"),
183
+ headers=self._client_wrapper.get_headers(),
184
+ timeout=60,
185
+ )
186
+ if 200 <= _response.status_code < 300:
187
+ return pydantic.parse_obj_as(typing.List[DataSinkDefinition], _response.json()) # type: ignore
188
+ try:
189
+ _response_json = _response.json()
190
+ except JSONDecodeError:
191
+ raise ApiError(status_code=_response.status_code, body=_response.text)
192
+ 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 DataSinkUpdateComponent, DataSinkUpdateComponentOne
4
+
5
+ __all__ = ["DataSinkUpdateComponent", "DataSinkUpdateComponentOne"]