llama-cloud 0.1.36__py3-none-any.whl → 0.1.38__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 +20 -4
- llama_cloud/client.py +3 -0
- llama_cloud/resources/__init__.py +3 -3
- llama_cloud/resources/admin/client.py +57 -0
- llama_cloud/resources/alpha/__init__.py +2 -0
- llama_cloud/resources/alpha/client.py +118 -0
- llama_cloud/resources/beta/client.py +576 -20
- llama_cloud/resources/chat_apps/client.py +32 -8
- llama_cloud/resources/classifier/client.py +139 -11
- llama_cloud/resources/data_sinks/client.py +32 -8
- llama_cloud/resources/data_sources/client.py +32 -8
- llama_cloud/resources/data_sources/types/data_source_update_component.py +2 -0
- llama_cloud/resources/embedding_model_configs/client.py +48 -12
- llama_cloud/resources/files/__init__.py +2 -2
- llama_cloud/resources/files/client.py +189 -113
- llama_cloud/resources/files/types/__init__.py +1 -3
- llama_cloud/resources/jobs/client.py +12 -6
- llama_cloud/resources/llama_extract/client.py +138 -32
- llama_cloud/resources/organizations/client.py +18 -4
- llama_cloud/resources/parsing/client.py +16 -4
- llama_cloud/resources/pipelines/client.py +32 -8
- llama_cloud/resources/projects/client.py +78 -18
- llama_cloud/resources/reports/client.py +126 -30
- llama_cloud/resources/retrievers/client.py +48 -12
- llama_cloud/types/__init__.py +20 -2
- llama_cloud/types/agent_deployment_summary.py +1 -0
- llama_cloud/types/classify_job.py +2 -0
- llama_cloud/types/cloud_jira_data_source_v_2.py +52 -0
- llama_cloud/types/cloud_jira_data_source_v_2_api_version.py +21 -0
- llama_cloud/types/configurable_data_source_names.py +4 -0
- llama_cloud/types/data_source_component.py +2 -0
- llama_cloud/types/data_source_create_component.py +2 -0
- llama_cloud/types/data_source_reader_version_metadata_reader_version.py +9 -1
- llama_cloud/types/file_create.py +41 -0
- llama_cloud/types/{classify_job_with_status.py → file_filter.py} +8 -15
- llama_cloud/types/file_query_response.py +38 -0
- llama_cloud/types/llama_extract_mode_availability.py +37 -0
- llama_cloud/types/llama_extract_mode_availability_status.py +17 -0
- llama_cloud/types/paginated_response_classify_job.py +34 -0
- llama_cloud/types/pipeline_data_source_component.py +2 -0
- llama_cloud/types/usage_response_active_alerts_item.py +4 -0
- {llama_cloud-0.1.36.dist-info → llama_cloud-0.1.38.dist-info}/METADATA +2 -1
- {llama_cloud-0.1.36.dist-info → llama_cloud-0.1.38.dist-info}/RECORD +47 -38
- {llama_cloud-0.1.36.dist-info → llama_cloud-0.1.38.dist-info}/WHEEL +1 -1
- /llama_cloud/{resources/files/types → types}/file_create_permission_info_value.py +0 -0
- /llama_cloud/{resources/files/types → types}/file_create_resource_info_value.py +0 -0
- {llama_cloud-0.1.36.dist-info → llama_cloud-0.1.38.dist-info}/LICENSE +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
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
|
|
5
|
-
from .file_create_resource_info_value import FileCreateResourceInfoValue
|
|
6
4
|
|
|
7
|
-
__all__ = ["FileCreateFromUrlResourceInfoValue"
|
|
5
|
+
__all__ = ["FileCreateFromUrlResourceInfoValue"]
|
|
@@ -24,7 +24,7 @@ class JobsClient:
|
|
|
24
24
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
25
25
|
self._client_wrapper = client_wrapper
|
|
26
26
|
|
|
27
|
-
def
|
|
27
|
+
def get_jobs(
|
|
28
28
|
self,
|
|
29
29
|
*,
|
|
30
30
|
job_name: typing.Optional[str] = None,
|
|
@@ -34,6 +34,7 @@ class JobsClient:
|
|
|
34
34
|
include_usage_metrics: typing.Optional[bool] = None,
|
|
35
35
|
project_id: typing.Optional[str] = None,
|
|
36
36
|
organization_id: typing.Optional[str] = None,
|
|
37
|
+
project_id: typing.Optional[str] = None,
|
|
37
38
|
) -> PaginatedJobsHistoryWithMetrics:
|
|
38
39
|
"""
|
|
39
40
|
Get jobs for a project.
|
|
@@ -56,13 +57,15 @@ class JobsClient:
|
|
|
56
57
|
- project_id: typing.Optional[str].
|
|
57
58
|
|
|
58
59
|
- organization_id: typing.Optional[str].
|
|
60
|
+
|
|
61
|
+
- project_id: typing.Optional[str].
|
|
59
62
|
---
|
|
60
63
|
from llama_cloud.client import LlamaCloud
|
|
61
64
|
|
|
62
65
|
client = LlamaCloud(
|
|
63
66
|
token="YOUR_TOKEN",
|
|
64
67
|
)
|
|
65
|
-
client.jobs.
|
|
68
|
+
client.jobs.get_jobs()
|
|
66
69
|
"""
|
|
67
70
|
_response = self._client_wrapper.httpx_client.request(
|
|
68
71
|
"GET",
|
|
@@ -78,7 +81,7 @@ class JobsClient:
|
|
|
78
81
|
"organization_id": organization_id,
|
|
79
82
|
}
|
|
80
83
|
),
|
|
81
|
-
headers=self._client_wrapper.get_headers(),
|
|
84
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
82
85
|
timeout=60,
|
|
83
86
|
)
|
|
84
87
|
if 200 <= _response.status_code < 300:
|
|
@@ -96,7 +99,7 @@ class AsyncJobsClient:
|
|
|
96
99
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
97
100
|
self._client_wrapper = client_wrapper
|
|
98
101
|
|
|
99
|
-
async def
|
|
102
|
+
async def get_jobs(
|
|
100
103
|
self,
|
|
101
104
|
*,
|
|
102
105
|
job_name: typing.Optional[str] = None,
|
|
@@ -106,6 +109,7 @@ class AsyncJobsClient:
|
|
|
106
109
|
include_usage_metrics: typing.Optional[bool] = None,
|
|
107
110
|
project_id: typing.Optional[str] = None,
|
|
108
111
|
organization_id: typing.Optional[str] = None,
|
|
112
|
+
project_id: typing.Optional[str] = None,
|
|
109
113
|
) -> PaginatedJobsHistoryWithMetrics:
|
|
110
114
|
"""
|
|
111
115
|
Get jobs for a project.
|
|
@@ -128,13 +132,15 @@ class AsyncJobsClient:
|
|
|
128
132
|
- project_id: typing.Optional[str].
|
|
129
133
|
|
|
130
134
|
- organization_id: typing.Optional[str].
|
|
135
|
+
|
|
136
|
+
- project_id: typing.Optional[str].
|
|
131
137
|
---
|
|
132
138
|
from llama_cloud.client import AsyncLlamaCloud
|
|
133
139
|
|
|
134
140
|
client = AsyncLlamaCloud(
|
|
135
141
|
token="YOUR_TOKEN",
|
|
136
142
|
)
|
|
137
|
-
await client.jobs.
|
|
143
|
+
await client.jobs.get_jobs()
|
|
138
144
|
"""
|
|
139
145
|
_response = await self._client_wrapper.httpx_client.request(
|
|
140
146
|
"GET",
|
|
@@ -150,7 +156,7 @@ class AsyncJobsClient:
|
|
|
150
156
|
"organization_id": organization_id,
|
|
151
157
|
}
|
|
152
158
|
),
|
|
153
|
-
headers=self._client_wrapper.get_headers(),
|
|
159
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
154
160
|
timeout=60,
|
|
155
161
|
)
|
|
156
162
|
if 200 <= _response.status_code < 300:
|
|
@@ -50,6 +50,7 @@ class LlamaExtractClient:
|
|
|
50
50
|
include_default: typing.Optional[bool] = None,
|
|
51
51
|
project_id: typing.Optional[str] = None,
|
|
52
52
|
organization_id: typing.Optional[str] = None,
|
|
53
|
+
project_id: typing.Optional[str] = None,
|
|
53
54
|
) -> typing.List[ExtractAgent]:
|
|
54
55
|
"""
|
|
55
56
|
Parameters:
|
|
@@ -58,6 +59,8 @@ class LlamaExtractClient:
|
|
|
58
59
|
- project_id: typing.Optional[str].
|
|
59
60
|
|
|
60
61
|
- organization_id: typing.Optional[str].
|
|
62
|
+
|
|
63
|
+
- project_id: typing.Optional[str].
|
|
61
64
|
---
|
|
62
65
|
from llama_cloud.client import LlamaCloud
|
|
63
66
|
|
|
@@ -72,7 +75,7 @@ class LlamaExtractClient:
|
|
|
72
75
|
params=remove_none_from_dict(
|
|
73
76
|
{"include_default": include_default, "project_id": project_id, "organization_id": organization_id}
|
|
74
77
|
),
|
|
75
|
-
headers=self._client_wrapper.get_headers(),
|
|
78
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
76
79
|
timeout=60,
|
|
77
80
|
)
|
|
78
81
|
if 200 <= _response.status_code < 300:
|
|
@@ -93,6 +96,7 @@ class LlamaExtractClient:
|
|
|
93
96
|
name: str,
|
|
94
97
|
data_schema: ExtractAgentCreateDataSchema,
|
|
95
98
|
config: ExtractConfig,
|
|
99
|
+
project_id: typing.Optional[str] = None,
|
|
96
100
|
) -> ExtractAgent:
|
|
97
101
|
"""
|
|
98
102
|
Parameters:
|
|
@@ -105,6 +109,8 @@ class LlamaExtractClient:
|
|
|
105
109
|
- data_schema: ExtractAgentCreateDataSchema. The schema of the data.
|
|
106
110
|
|
|
107
111
|
- config: ExtractConfig. The configuration parameters for the extraction agent.
|
|
112
|
+
|
|
113
|
+
- project_id: typing.Optional[str].
|
|
108
114
|
---
|
|
109
115
|
from llama_cloud import (
|
|
110
116
|
DocumentChunkMode,
|
|
@@ -133,7 +139,7 @@ class LlamaExtractClient:
|
|
|
133
139
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents"),
|
|
134
140
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
135
141
|
json=jsonable_encoder({"name": name, "data_schema": data_schema, "config": config}),
|
|
136
|
-
headers=self._client_wrapper.get_headers(),
|
|
142
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
137
143
|
timeout=60,
|
|
138
144
|
)
|
|
139
145
|
if 200 <= _response.status_code < 300:
|
|
@@ -189,6 +195,7 @@ class LlamaExtractClient:
|
|
|
189
195
|
organization_id: typing.Optional[str] = None,
|
|
190
196
|
prompt: typing.Optional[str] = OMIT,
|
|
191
197
|
file_id: typing.Optional[str] = OMIT,
|
|
198
|
+
project_id: typing.Optional[str] = None,
|
|
192
199
|
) -> ExtractSchemaGenerateResponse:
|
|
193
200
|
"""
|
|
194
201
|
Generates an extraction agent's schema definition from a file and/or natural language prompt.
|
|
@@ -201,6 +208,8 @@ class LlamaExtractClient:
|
|
|
201
208
|
- prompt: typing.Optional[str].
|
|
202
209
|
|
|
203
210
|
- file_id: typing.Optional[str].
|
|
211
|
+
|
|
212
|
+
- project_id: typing.Optional[str].
|
|
204
213
|
---
|
|
205
214
|
from llama_cloud.client import LlamaCloud
|
|
206
215
|
|
|
@@ -221,7 +230,7 @@ class LlamaExtractClient:
|
|
|
221
230
|
),
|
|
222
231
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
223
232
|
json=jsonable_encoder(_request),
|
|
224
|
-
headers=self._client_wrapper.get_headers(),
|
|
233
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
225
234
|
timeout=60,
|
|
226
235
|
)
|
|
227
236
|
if 200 <= _response.status_code < 300:
|
|
@@ -235,7 +244,12 @@ class LlamaExtractClient:
|
|
|
235
244
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
236
245
|
|
|
237
246
|
def get_extraction_agent_by_name(
|
|
238
|
-
self,
|
|
247
|
+
self,
|
|
248
|
+
name: str,
|
|
249
|
+
*,
|
|
250
|
+
project_id: typing.Optional[str] = None,
|
|
251
|
+
organization_id: typing.Optional[str] = None,
|
|
252
|
+
project_id: typing.Optional[str] = None,
|
|
239
253
|
) -> ExtractAgent:
|
|
240
254
|
"""
|
|
241
255
|
Parameters:
|
|
@@ -244,6 +258,8 @@ class LlamaExtractClient:
|
|
|
244
258
|
- project_id: typing.Optional[str].
|
|
245
259
|
|
|
246
260
|
- organization_id: typing.Optional[str].
|
|
261
|
+
|
|
262
|
+
- project_id: typing.Optional[str].
|
|
247
263
|
---
|
|
248
264
|
from llama_cloud.client import LlamaCloud
|
|
249
265
|
|
|
@@ -260,7 +276,7 @@ class LlamaExtractClient:
|
|
|
260
276
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/extraction-agents/by-name/{name}"
|
|
261
277
|
),
|
|
262
278
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
263
|
-
headers=self._client_wrapper.get_headers(),
|
|
279
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
264
280
|
timeout=60,
|
|
265
281
|
)
|
|
266
282
|
if 200 <= _response.status_code < 300:
|
|
@@ -274,7 +290,11 @@ class LlamaExtractClient:
|
|
|
274
290
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
275
291
|
|
|
276
292
|
def get_or_create_default_extraction_agent(
|
|
277
|
-
self,
|
|
293
|
+
self,
|
|
294
|
+
*,
|
|
295
|
+
project_id: typing.Optional[str] = None,
|
|
296
|
+
organization_id: typing.Optional[str] = None,
|
|
297
|
+
project_id: typing.Optional[str] = None,
|
|
278
298
|
) -> ExtractAgent:
|
|
279
299
|
"""
|
|
280
300
|
Get or create a default extraction agent for the current project.
|
|
@@ -284,6 +304,8 @@ class LlamaExtractClient:
|
|
|
284
304
|
- project_id: typing.Optional[str].
|
|
285
305
|
|
|
286
306
|
- organization_id: typing.Optional[str].
|
|
307
|
+
|
|
308
|
+
- project_id: typing.Optional[str].
|
|
287
309
|
---
|
|
288
310
|
from llama_cloud.client import LlamaCloud
|
|
289
311
|
|
|
@@ -298,7 +320,7 @@ class LlamaExtractClient:
|
|
|
298
320
|
f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents/default"
|
|
299
321
|
),
|
|
300
322
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
301
|
-
headers=self._client_wrapper.get_headers(),
|
|
323
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
302
324
|
timeout=60,
|
|
303
325
|
)
|
|
304
326
|
if 200 <= _response.status_code < 300:
|
|
@@ -731,7 +753,12 @@ class LlamaExtractClient:
|
|
|
731
753
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
732
754
|
|
|
733
755
|
def get_job_result(
|
|
734
|
-
self,
|
|
756
|
+
self,
|
|
757
|
+
job_id: str,
|
|
758
|
+
*,
|
|
759
|
+
project_id: typing.Optional[str] = None,
|
|
760
|
+
organization_id: typing.Optional[str] = None,
|
|
761
|
+
project_id: typing.Optional[str] = None,
|
|
735
762
|
) -> ExtractResultset:
|
|
736
763
|
"""
|
|
737
764
|
Parameters:
|
|
@@ -740,6 +767,8 @@ class LlamaExtractClient:
|
|
|
740
767
|
- project_id: typing.Optional[str].
|
|
741
768
|
|
|
742
769
|
- organization_id: typing.Optional[str].
|
|
770
|
+
|
|
771
|
+
- project_id: typing.Optional[str].
|
|
743
772
|
---
|
|
744
773
|
from llama_cloud.client import LlamaCloud
|
|
745
774
|
|
|
@@ -754,7 +783,7 @@ class LlamaExtractClient:
|
|
|
754
783
|
"GET",
|
|
755
784
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/jobs/{job_id}/result"),
|
|
756
785
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
757
|
-
headers=self._client_wrapper.get_headers(),
|
|
786
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
758
787
|
timeout=60,
|
|
759
788
|
)
|
|
760
789
|
if 200 <= _response.status_code < 300:
|
|
@@ -836,7 +865,12 @@ class LlamaExtractClient:
|
|
|
836
865
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
837
866
|
|
|
838
867
|
def get_run_by_job_id(
|
|
839
|
-
self,
|
|
868
|
+
self,
|
|
869
|
+
job_id: str,
|
|
870
|
+
*,
|
|
871
|
+
project_id: typing.Optional[str] = None,
|
|
872
|
+
organization_id: typing.Optional[str] = None,
|
|
873
|
+
project_id: typing.Optional[str] = None,
|
|
840
874
|
) -> ExtractRun:
|
|
841
875
|
"""
|
|
842
876
|
Parameters:
|
|
@@ -845,6 +879,8 @@ class LlamaExtractClient:
|
|
|
845
879
|
- project_id: typing.Optional[str].
|
|
846
880
|
|
|
847
881
|
- organization_id: typing.Optional[str].
|
|
882
|
+
|
|
883
|
+
- project_id: typing.Optional[str].
|
|
848
884
|
---
|
|
849
885
|
from llama_cloud.client import LlamaCloud
|
|
850
886
|
|
|
@@ -859,7 +895,7 @@ class LlamaExtractClient:
|
|
|
859
895
|
"GET",
|
|
860
896
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/by-job/{job_id}"),
|
|
861
897
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
862
|
-
headers=self._client_wrapper.get_headers(),
|
|
898
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
863
899
|
timeout=60,
|
|
864
900
|
)
|
|
865
901
|
if 200 <= _response.status_code < 300:
|
|
@@ -873,7 +909,12 @@ class LlamaExtractClient:
|
|
|
873
909
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
874
910
|
|
|
875
911
|
def get_run(
|
|
876
|
-
self,
|
|
912
|
+
self,
|
|
913
|
+
run_id: str,
|
|
914
|
+
*,
|
|
915
|
+
project_id: typing.Optional[str] = None,
|
|
916
|
+
organization_id: typing.Optional[str] = None,
|
|
917
|
+
project_id: typing.Optional[str] = None,
|
|
877
918
|
) -> ExtractRun:
|
|
878
919
|
"""
|
|
879
920
|
Parameters:
|
|
@@ -882,6 +923,8 @@ class LlamaExtractClient:
|
|
|
882
923
|
- project_id: typing.Optional[str].
|
|
883
924
|
|
|
884
925
|
- organization_id: typing.Optional[str].
|
|
926
|
+
|
|
927
|
+
- project_id: typing.Optional[str].
|
|
885
928
|
---
|
|
886
929
|
from llama_cloud.client import LlamaCloud
|
|
887
930
|
|
|
@@ -896,7 +939,7 @@ class LlamaExtractClient:
|
|
|
896
939
|
"GET",
|
|
897
940
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
898
941
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
899
|
-
headers=self._client_wrapper.get_headers(),
|
|
942
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
900
943
|
timeout=60,
|
|
901
944
|
)
|
|
902
945
|
if 200 <= _response.status_code < 300:
|
|
@@ -910,7 +953,12 @@ class LlamaExtractClient:
|
|
|
910
953
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
911
954
|
|
|
912
955
|
def delete_extraction_run(
|
|
913
|
-
self,
|
|
956
|
+
self,
|
|
957
|
+
run_id: str,
|
|
958
|
+
*,
|
|
959
|
+
project_id: typing.Optional[str] = None,
|
|
960
|
+
organization_id: typing.Optional[str] = None,
|
|
961
|
+
project_id: typing.Optional[str] = None,
|
|
914
962
|
) -> typing.Any:
|
|
915
963
|
"""
|
|
916
964
|
Parameters:
|
|
@@ -919,6 +967,8 @@ class LlamaExtractClient:
|
|
|
919
967
|
- project_id: typing.Optional[str].
|
|
920
968
|
|
|
921
969
|
- organization_id: typing.Optional[str].
|
|
970
|
+
|
|
971
|
+
- project_id: typing.Optional[str].
|
|
922
972
|
---
|
|
923
973
|
from llama_cloud.client import LlamaCloud
|
|
924
974
|
|
|
@@ -933,7 +983,7 @@ class LlamaExtractClient:
|
|
|
933
983
|
"DELETE",
|
|
934
984
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
935
985
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
936
|
-
headers=self._client_wrapper.get_headers(),
|
|
986
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
937
987
|
timeout=60,
|
|
938
988
|
)
|
|
939
989
|
if 200 <= _response.status_code < 300:
|
|
@@ -957,6 +1007,7 @@ class LlamaExtractClient:
|
|
|
957
1007
|
file_id: typing.Optional[str] = OMIT,
|
|
958
1008
|
text: typing.Optional[str] = OMIT,
|
|
959
1009
|
file: typing.Optional[FileData] = OMIT,
|
|
1010
|
+
project_id: typing.Optional[str] = None,
|
|
960
1011
|
) -> ExtractJob:
|
|
961
1012
|
"""
|
|
962
1013
|
Stateless extraction endpoint that uses a default extraction agent in the user's default project.
|
|
@@ -978,6 +1029,8 @@ class LlamaExtractClient:
|
|
|
978
1029
|
- text: typing.Optional[str].
|
|
979
1030
|
|
|
980
1031
|
- file: typing.Optional[FileData].
|
|
1032
|
+
|
|
1033
|
+
- project_id: typing.Optional[str].
|
|
981
1034
|
---
|
|
982
1035
|
from llama_cloud import (
|
|
983
1036
|
DocumentChunkMode,
|
|
@@ -1019,7 +1072,7 @@ class LlamaExtractClient:
|
|
|
1019
1072
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/run"),
|
|
1020
1073
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1021
1074
|
json=jsonable_encoder(_request),
|
|
1022
|
-
headers=self._client_wrapper.get_headers(),
|
|
1075
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1023
1076
|
timeout=60,
|
|
1024
1077
|
)
|
|
1025
1078
|
if 200 <= _response.status_code < 300:
|
|
@@ -1043,6 +1096,7 @@ class AsyncLlamaExtractClient:
|
|
|
1043
1096
|
include_default: typing.Optional[bool] = None,
|
|
1044
1097
|
project_id: typing.Optional[str] = None,
|
|
1045
1098
|
organization_id: typing.Optional[str] = None,
|
|
1099
|
+
project_id: typing.Optional[str] = None,
|
|
1046
1100
|
) -> typing.List[ExtractAgent]:
|
|
1047
1101
|
"""
|
|
1048
1102
|
Parameters:
|
|
@@ -1051,6 +1105,8 @@ class AsyncLlamaExtractClient:
|
|
|
1051
1105
|
- project_id: typing.Optional[str].
|
|
1052
1106
|
|
|
1053
1107
|
- organization_id: typing.Optional[str].
|
|
1108
|
+
|
|
1109
|
+
- project_id: typing.Optional[str].
|
|
1054
1110
|
---
|
|
1055
1111
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1056
1112
|
|
|
@@ -1065,7 +1121,7 @@ class AsyncLlamaExtractClient:
|
|
|
1065
1121
|
params=remove_none_from_dict(
|
|
1066
1122
|
{"include_default": include_default, "project_id": project_id, "organization_id": organization_id}
|
|
1067
1123
|
),
|
|
1068
|
-
headers=self._client_wrapper.get_headers(),
|
|
1124
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1069
1125
|
timeout=60,
|
|
1070
1126
|
)
|
|
1071
1127
|
if 200 <= _response.status_code < 300:
|
|
@@ -1086,6 +1142,7 @@ class AsyncLlamaExtractClient:
|
|
|
1086
1142
|
name: str,
|
|
1087
1143
|
data_schema: ExtractAgentCreateDataSchema,
|
|
1088
1144
|
config: ExtractConfig,
|
|
1145
|
+
project_id: typing.Optional[str] = None,
|
|
1089
1146
|
) -> ExtractAgent:
|
|
1090
1147
|
"""
|
|
1091
1148
|
Parameters:
|
|
@@ -1098,6 +1155,8 @@ class AsyncLlamaExtractClient:
|
|
|
1098
1155
|
- data_schema: ExtractAgentCreateDataSchema. The schema of the data.
|
|
1099
1156
|
|
|
1100
1157
|
- config: ExtractConfig. The configuration parameters for the extraction agent.
|
|
1158
|
+
|
|
1159
|
+
- project_id: typing.Optional[str].
|
|
1101
1160
|
---
|
|
1102
1161
|
from llama_cloud import (
|
|
1103
1162
|
DocumentChunkMode,
|
|
@@ -1126,7 +1185,7 @@ class AsyncLlamaExtractClient:
|
|
|
1126
1185
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents"),
|
|
1127
1186
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1128
1187
|
json=jsonable_encoder({"name": name, "data_schema": data_schema, "config": config}),
|
|
1129
|
-
headers=self._client_wrapper.get_headers(),
|
|
1188
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1130
1189
|
timeout=60,
|
|
1131
1190
|
)
|
|
1132
1191
|
if 200 <= _response.status_code < 300:
|
|
@@ -1182,6 +1241,7 @@ class AsyncLlamaExtractClient:
|
|
|
1182
1241
|
organization_id: typing.Optional[str] = None,
|
|
1183
1242
|
prompt: typing.Optional[str] = OMIT,
|
|
1184
1243
|
file_id: typing.Optional[str] = OMIT,
|
|
1244
|
+
project_id: typing.Optional[str] = None,
|
|
1185
1245
|
) -> ExtractSchemaGenerateResponse:
|
|
1186
1246
|
"""
|
|
1187
1247
|
Generates an extraction agent's schema definition from a file and/or natural language prompt.
|
|
@@ -1194,6 +1254,8 @@ class AsyncLlamaExtractClient:
|
|
|
1194
1254
|
- prompt: typing.Optional[str].
|
|
1195
1255
|
|
|
1196
1256
|
- file_id: typing.Optional[str].
|
|
1257
|
+
|
|
1258
|
+
- project_id: typing.Optional[str].
|
|
1197
1259
|
---
|
|
1198
1260
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1199
1261
|
|
|
@@ -1214,7 +1276,7 @@ class AsyncLlamaExtractClient:
|
|
|
1214
1276
|
),
|
|
1215
1277
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1216
1278
|
json=jsonable_encoder(_request),
|
|
1217
|
-
headers=self._client_wrapper.get_headers(),
|
|
1279
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1218
1280
|
timeout=60,
|
|
1219
1281
|
)
|
|
1220
1282
|
if 200 <= _response.status_code < 300:
|
|
@@ -1228,7 +1290,12 @@ class AsyncLlamaExtractClient:
|
|
|
1228
1290
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1229
1291
|
|
|
1230
1292
|
async def get_extraction_agent_by_name(
|
|
1231
|
-
self,
|
|
1293
|
+
self,
|
|
1294
|
+
name: str,
|
|
1295
|
+
*,
|
|
1296
|
+
project_id: typing.Optional[str] = None,
|
|
1297
|
+
organization_id: typing.Optional[str] = None,
|
|
1298
|
+
project_id: typing.Optional[str] = None,
|
|
1232
1299
|
) -> ExtractAgent:
|
|
1233
1300
|
"""
|
|
1234
1301
|
Parameters:
|
|
@@ -1237,6 +1304,8 @@ class AsyncLlamaExtractClient:
|
|
|
1237
1304
|
- project_id: typing.Optional[str].
|
|
1238
1305
|
|
|
1239
1306
|
- organization_id: typing.Optional[str].
|
|
1307
|
+
|
|
1308
|
+
- project_id: typing.Optional[str].
|
|
1240
1309
|
---
|
|
1241
1310
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1242
1311
|
|
|
@@ -1253,7 +1322,7 @@ class AsyncLlamaExtractClient:
|
|
|
1253
1322
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/extraction-agents/by-name/{name}"
|
|
1254
1323
|
),
|
|
1255
1324
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1256
|
-
headers=self._client_wrapper.get_headers(),
|
|
1325
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1257
1326
|
timeout=60,
|
|
1258
1327
|
)
|
|
1259
1328
|
if 200 <= _response.status_code < 300:
|
|
@@ -1267,7 +1336,11 @@ class AsyncLlamaExtractClient:
|
|
|
1267
1336
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1268
1337
|
|
|
1269
1338
|
async def get_or_create_default_extraction_agent(
|
|
1270
|
-
self,
|
|
1339
|
+
self,
|
|
1340
|
+
*,
|
|
1341
|
+
project_id: typing.Optional[str] = None,
|
|
1342
|
+
organization_id: typing.Optional[str] = None,
|
|
1343
|
+
project_id: typing.Optional[str] = None,
|
|
1271
1344
|
) -> ExtractAgent:
|
|
1272
1345
|
"""
|
|
1273
1346
|
Get or create a default extraction agent for the current project.
|
|
@@ -1277,6 +1350,8 @@ class AsyncLlamaExtractClient:
|
|
|
1277
1350
|
- project_id: typing.Optional[str].
|
|
1278
1351
|
|
|
1279
1352
|
- organization_id: typing.Optional[str].
|
|
1353
|
+
|
|
1354
|
+
- project_id: typing.Optional[str].
|
|
1280
1355
|
---
|
|
1281
1356
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1282
1357
|
|
|
@@ -1291,7 +1366,7 @@ class AsyncLlamaExtractClient:
|
|
|
1291
1366
|
f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents/default"
|
|
1292
1367
|
),
|
|
1293
1368
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1294
|
-
headers=self._client_wrapper.get_headers(),
|
|
1369
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1295
1370
|
timeout=60,
|
|
1296
1371
|
)
|
|
1297
1372
|
if 200 <= _response.status_code < 300:
|
|
@@ -1724,7 +1799,12 @@ class AsyncLlamaExtractClient:
|
|
|
1724
1799
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1725
1800
|
|
|
1726
1801
|
async def get_job_result(
|
|
1727
|
-
self,
|
|
1802
|
+
self,
|
|
1803
|
+
job_id: str,
|
|
1804
|
+
*,
|
|
1805
|
+
project_id: typing.Optional[str] = None,
|
|
1806
|
+
organization_id: typing.Optional[str] = None,
|
|
1807
|
+
project_id: typing.Optional[str] = None,
|
|
1728
1808
|
) -> ExtractResultset:
|
|
1729
1809
|
"""
|
|
1730
1810
|
Parameters:
|
|
@@ -1733,6 +1813,8 @@ class AsyncLlamaExtractClient:
|
|
|
1733
1813
|
- project_id: typing.Optional[str].
|
|
1734
1814
|
|
|
1735
1815
|
- organization_id: typing.Optional[str].
|
|
1816
|
+
|
|
1817
|
+
- project_id: typing.Optional[str].
|
|
1736
1818
|
---
|
|
1737
1819
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1738
1820
|
|
|
@@ -1747,7 +1829,7 @@ class AsyncLlamaExtractClient:
|
|
|
1747
1829
|
"GET",
|
|
1748
1830
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/jobs/{job_id}/result"),
|
|
1749
1831
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1750
|
-
headers=self._client_wrapper.get_headers(),
|
|
1832
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1751
1833
|
timeout=60,
|
|
1752
1834
|
)
|
|
1753
1835
|
if 200 <= _response.status_code < 300:
|
|
@@ -1829,7 +1911,12 @@ class AsyncLlamaExtractClient:
|
|
|
1829
1911
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1830
1912
|
|
|
1831
1913
|
async def get_run_by_job_id(
|
|
1832
|
-
self,
|
|
1914
|
+
self,
|
|
1915
|
+
job_id: str,
|
|
1916
|
+
*,
|
|
1917
|
+
project_id: typing.Optional[str] = None,
|
|
1918
|
+
organization_id: typing.Optional[str] = None,
|
|
1919
|
+
project_id: typing.Optional[str] = None,
|
|
1833
1920
|
) -> ExtractRun:
|
|
1834
1921
|
"""
|
|
1835
1922
|
Parameters:
|
|
@@ -1838,6 +1925,8 @@ class AsyncLlamaExtractClient:
|
|
|
1838
1925
|
- project_id: typing.Optional[str].
|
|
1839
1926
|
|
|
1840
1927
|
- organization_id: typing.Optional[str].
|
|
1928
|
+
|
|
1929
|
+
- project_id: typing.Optional[str].
|
|
1841
1930
|
---
|
|
1842
1931
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1843
1932
|
|
|
@@ -1852,7 +1941,7 @@ class AsyncLlamaExtractClient:
|
|
|
1852
1941
|
"GET",
|
|
1853
1942
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/by-job/{job_id}"),
|
|
1854
1943
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1855
|
-
headers=self._client_wrapper.get_headers(),
|
|
1944
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1856
1945
|
timeout=60,
|
|
1857
1946
|
)
|
|
1858
1947
|
if 200 <= _response.status_code < 300:
|
|
@@ -1866,7 +1955,12 @@ class AsyncLlamaExtractClient:
|
|
|
1866
1955
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1867
1956
|
|
|
1868
1957
|
async def get_run(
|
|
1869
|
-
self,
|
|
1958
|
+
self,
|
|
1959
|
+
run_id: str,
|
|
1960
|
+
*,
|
|
1961
|
+
project_id: typing.Optional[str] = None,
|
|
1962
|
+
organization_id: typing.Optional[str] = None,
|
|
1963
|
+
project_id: typing.Optional[str] = None,
|
|
1870
1964
|
) -> ExtractRun:
|
|
1871
1965
|
"""
|
|
1872
1966
|
Parameters:
|
|
@@ -1875,6 +1969,8 @@ class AsyncLlamaExtractClient:
|
|
|
1875
1969
|
- project_id: typing.Optional[str].
|
|
1876
1970
|
|
|
1877
1971
|
- organization_id: typing.Optional[str].
|
|
1972
|
+
|
|
1973
|
+
- project_id: typing.Optional[str].
|
|
1878
1974
|
---
|
|
1879
1975
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1880
1976
|
|
|
@@ -1889,7 +1985,7 @@ class AsyncLlamaExtractClient:
|
|
|
1889
1985
|
"GET",
|
|
1890
1986
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
1891
1987
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1892
|
-
headers=self._client_wrapper.get_headers(),
|
|
1988
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1893
1989
|
timeout=60,
|
|
1894
1990
|
)
|
|
1895
1991
|
if 200 <= _response.status_code < 300:
|
|
@@ -1903,7 +1999,12 @@ class AsyncLlamaExtractClient:
|
|
|
1903
1999
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1904
2000
|
|
|
1905
2001
|
async def delete_extraction_run(
|
|
1906
|
-
self,
|
|
2002
|
+
self,
|
|
2003
|
+
run_id: str,
|
|
2004
|
+
*,
|
|
2005
|
+
project_id: typing.Optional[str] = None,
|
|
2006
|
+
organization_id: typing.Optional[str] = None,
|
|
2007
|
+
project_id: typing.Optional[str] = None,
|
|
1907
2008
|
) -> typing.Any:
|
|
1908
2009
|
"""
|
|
1909
2010
|
Parameters:
|
|
@@ -1912,6 +2013,8 @@ class AsyncLlamaExtractClient:
|
|
|
1912
2013
|
- project_id: typing.Optional[str].
|
|
1913
2014
|
|
|
1914
2015
|
- organization_id: typing.Optional[str].
|
|
2016
|
+
|
|
2017
|
+
- project_id: typing.Optional[str].
|
|
1915
2018
|
---
|
|
1916
2019
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1917
2020
|
|
|
@@ -1926,7 +2029,7 @@ class AsyncLlamaExtractClient:
|
|
|
1926
2029
|
"DELETE",
|
|
1927
2030
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
1928
2031
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1929
|
-
headers=self._client_wrapper.get_headers(),
|
|
2032
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
1930
2033
|
timeout=60,
|
|
1931
2034
|
)
|
|
1932
2035
|
if 200 <= _response.status_code < 300:
|
|
@@ -1950,6 +2053,7 @@ class AsyncLlamaExtractClient:
|
|
|
1950
2053
|
file_id: typing.Optional[str] = OMIT,
|
|
1951
2054
|
text: typing.Optional[str] = OMIT,
|
|
1952
2055
|
file: typing.Optional[FileData] = OMIT,
|
|
2056
|
+
project_id: typing.Optional[str] = None,
|
|
1953
2057
|
) -> ExtractJob:
|
|
1954
2058
|
"""
|
|
1955
2059
|
Stateless extraction endpoint that uses a default extraction agent in the user's default project.
|
|
@@ -1971,6 +2075,8 @@ class AsyncLlamaExtractClient:
|
|
|
1971
2075
|
- text: typing.Optional[str].
|
|
1972
2076
|
|
|
1973
2077
|
- file: typing.Optional[FileData].
|
|
2078
|
+
|
|
2079
|
+
- project_id: typing.Optional[str].
|
|
1974
2080
|
---
|
|
1975
2081
|
from llama_cloud import (
|
|
1976
2082
|
DocumentChunkMode,
|
|
@@ -2012,7 +2118,7 @@ class AsyncLlamaExtractClient:
|
|
|
2012
2118
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/run"),
|
|
2013
2119
|
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
2014
2120
|
json=jsonable_encoder(_request),
|
|
2015
|
-
headers=self._client_wrapper.get_headers(),
|
|
2121
|
+
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
|
|
2016
2122
|
timeout=60,
|
|
2017
2123
|
)
|
|
2018
2124
|
if 200 <= _response.status_code < 300:
|