llama-cloud 0.1.23__py3-none-any.whl → 0.1.25__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 +4 -8
- llama_cloud/client.py +0 -3
- llama_cloud/resources/__init__.py +0 -2
- llama_cloud/resources/files/client.py +5 -4
- llama_cloud/resources/jobs/client.py +8 -0
- llama_cloud/resources/llama_extract/client.py +92 -24
- llama_cloud/resources/organizations/client.py +14 -4
- llama_cloud/resources/parsing/client.py +8 -0
- llama_cloud/resources/pipelines/client.py +20 -0
- llama_cloud/types/__init__.py +4 -6
- llama_cloud/types/composite_retrieval_result.py +5 -1
- llama_cloud/types/extract_config.py +3 -0
- llama_cloud/types/extract_models.py +20 -8
- llama_cloud/types/{llm_config_result.py → file_id_presigned_url.py} +9 -5
- llama_cloud/types/legacy_parse_job_config.py +1 -0
- llama_cloud/types/llama_extract_settings.py +3 -1
- llama_cloud/types/llama_parse_parameters.py +1 -0
- llama_cloud/types/page_figure_metadata.py +1 -0
- llama_cloud/types/{llm_configs_response.py → page_figure_node_with_score.py} +9 -4
- llama_cloud/types/parse_job_config.py +1 -0
- llama_cloud/types/preset_retrieval_params.py +6 -0
- llama_cloud/types/retrieve_results.py +5 -1
- llama_cloud/types/supported_llm_model_names.py +12 -4
- llama_cloud/types/user_organization_delete.py +1 -0
- {llama_cloud-0.1.23.dist-info → llama_cloud-0.1.25.dist-info}/METADATA +1 -1
- {llama_cloud-0.1.23.dist-info → llama_cloud-0.1.25.dist-info}/RECORD +28 -31
- llama_cloud/resources/admin/__init__.py +0 -2
- llama_cloud/resources/admin/client.py +0 -78
- llama_cloud/types/llm_config_result_llm_type.py +0 -33
- {llama_cloud-0.1.23.dist-info → llama_cloud-0.1.25.dist-info}/LICENSE +0 -0
- {llama_cloud-0.1.23.dist-info → llama_cloud-0.1.25.dist-info}/WHEEL +0 -0
llama_cloud/__init__.py
CHANGED
|
@@ -125,6 +125,7 @@ from .types import (
|
|
|
125
125
|
FailPageMode,
|
|
126
126
|
File,
|
|
127
127
|
FileCountByStatusResponse,
|
|
128
|
+
FileIdPresignedUrl,
|
|
128
129
|
FileParsePublic,
|
|
129
130
|
FilePermissionInfoValue,
|
|
130
131
|
FileResourceInfoValue,
|
|
@@ -165,9 +166,6 @@ from .types import (
|
|
|
165
166
|
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text,
|
|
166
167
|
LlamaParseParameters,
|
|
167
168
|
LlamaParseSupportedFileExtensions,
|
|
168
|
-
LlmConfigResult,
|
|
169
|
-
LlmConfigResultLlmType,
|
|
170
|
-
LlmConfigsResponse,
|
|
171
169
|
LlmModelData,
|
|
172
170
|
LlmParameters,
|
|
173
171
|
LoadFilesJobConfig,
|
|
@@ -188,6 +186,7 @@ from .types import (
|
|
|
188
186
|
Organization,
|
|
189
187
|
OrganizationCreate,
|
|
190
188
|
PageFigureMetadata,
|
|
189
|
+
PageFigureNodeWithScore,
|
|
191
190
|
PageScreenshotMetadata,
|
|
192
191
|
PageScreenshotNodeWithScore,
|
|
193
192
|
PageSegmentationConfig,
|
|
@@ -359,7 +358,6 @@ from .resources import (
|
|
|
359
358
|
PipelineUpdateTransformConfig,
|
|
360
359
|
RetrievalParamsSearchFiltersInferenceSchemaValue,
|
|
361
360
|
UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction,
|
|
362
|
-
admin,
|
|
363
361
|
beta,
|
|
364
362
|
chat_apps,
|
|
365
363
|
data_sinks,
|
|
@@ -525,6 +523,7 @@ __all__ = [
|
|
|
525
523
|
"FileCreateFromUrlResourceInfoValue",
|
|
526
524
|
"FileCreatePermissionInfoValue",
|
|
527
525
|
"FileCreateResourceInfoValue",
|
|
526
|
+
"FileIdPresignedUrl",
|
|
528
527
|
"FileParsePublic",
|
|
529
528
|
"FilePermissionInfoValue",
|
|
530
529
|
"FileResourceInfoValue",
|
|
@@ -566,9 +565,6 @@ __all__ = [
|
|
|
566
565
|
"LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text",
|
|
567
566
|
"LlamaParseParameters",
|
|
568
567
|
"LlamaParseSupportedFileExtensions",
|
|
569
|
-
"LlmConfigResult",
|
|
570
|
-
"LlmConfigResultLlmType",
|
|
571
|
-
"LlmConfigsResponse",
|
|
572
568
|
"LlmModelData",
|
|
573
569
|
"LlmParameters",
|
|
574
570
|
"LoadFilesJobConfig",
|
|
@@ -589,6 +585,7 @@ __all__ = [
|
|
|
589
585
|
"Organization",
|
|
590
586
|
"OrganizationCreate",
|
|
591
587
|
"PageFigureMetadata",
|
|
588
|
+
"PageFigureNodeWithScore",
|
|
592
589
|
"PageScreenshotMetadata",
|
|
593
590
|
"PageScreenshotNodeWithScore",
|
|
594
591
|
"PageSegmentationConfig",
|
|
@@ -736,7 +733,6 @@ __all__ = [
|
|
|
736
733
|
"VertexAiEmbeddingConfig",
|
|
737
734
|
"VertexEmbeddingMode",
|
|
738
735
|
"VertexTextEmbedding",
|
|
739
|
-
"admin",
|
|
740
736
|
"beta",
|
|
741
737
|
"chat_apps",
|
|
742
738
|
"data_sinks",
|
llama_cloud/client.py
CHANGED
|
@@ -6,7 +6,6 @@ import httpx
|
|
|
6
6
|
|
|
7
7
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
8
|
from .environment import LlamaCloudEnvironment
|
|
9
|
-
from .resources.admin.client import AdminClient, AsyncAdminClient
|
|
10
9
|
from .resources.beta.client import AsyncBetaClient, BetaClient
|
|
11
10
|
from .resources.chat_apps.client import AsyncChatAppsClient, ChatAppsClient
|
|
12
11
|
from .resources.data_sinks.client import AsyncDataSinksClient, DataSinksClient
|
|
@@ -51,7 +50,6 @@ class LlamaCloud:
|
|
|
51
50
|
self.evals = EvalsClient(client_wrapper=self._client_wrapper)
|
|
52
51
|
self.parsing = ParsingClient(client_wrapper=self._client_wrapper)
|
|
53
52
|
self.chat_apps = ChatAppsClient(client_wrapper=self._client_wrapper)
|
|
54
|
-
self.admin = AdminClient(client_wrapper=self._client_wrapper)
|
|
55
53
|
self.llama_extract = LlamaExtractClient(client_wrapper=self._client_wrapper)
|
|
56
54
|
self.reports = ReportsClient(client_wrapper=self._client_wrapper)
|
|
57
55
|
self.beta = BetaClient(client_wrapper=self._client_wrapper)
|
|
@@ -84,7 +82,6 @@ class AsyncLlamaCloud:
|
|
|
84
82
|
self.evals = AsyncEvalsClient(client_wrapper=self._client_wrapper)
|
|
85
83
|
self.parsing = AsyncParsingClient(client_wrapper=self._client_wrapper)
|
|
86
84
|
self.chat_apps = AsyncChatAppsClient(client_wrapper=self._client_wrapper)
|
|
87
|
-
self.admin = AsyncAdminClient(client_wrapper=self._client_wrapper)
|
|
88
85
|
self.llama_extract = AsyncLlamaExtractClient(client_wrapper=self._client_wrapper)
|
|
89
86
|
self.reports = AsyncReportsClient(client_wrapper=self._client_wrapper)
|
|
90
87
|
self.beta = AsyncBetaClient(client_wrapper=self._client_wrapper)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from . import (
|
|
4
|
-
admin,
|
|
5
4
|
beta,
|
|
6
5
|
chat_apps,
|
|
7
6
|
data_sinks,
|
|
@@ -91,7 +90,6 @@ __all__ = [
|
|
|
91
90
|
"PipelineUpdateTransformConfig",
|
|
92
91
|
"RetrievalParamsSearchFiltersInferenceSchemaValue",
|
|
93
92
|
"UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction",
|
|
94
|
-
"admin",
|
|
95
93
|
"beta",
|
|
96
94
|
"chat_apps",
|
|
97
95
|
"data_sinks",
|
|
@@ -11,6 +11,7 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
|
11
11
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
12
12
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
13
|
from ...types.file import File
|
|
14
|
+
from ...types.file_id_presigned_url import FileIdPresignedUrl
|
|
14
15
|
from ...types.http_validation_error import HttpValidationError
|
|
15
16
|
from ...types.page_figure_metadata import PageFigureMetadata
|
|
16
17
|
from ...types.page_screenshot_metadata import PageScreenshotMetadata
|
|
@@ -202,7 +203,7 @@ class FilesClient:
|
|
|
202
203
|
resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]] = OMIT,
|
|
203
204
|
permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]] = OMIT,
|
|
204
205
|
data_source_id: typing.Optional[str] = OMIT,
|
|
205
|
-
) ->
|
|
206
|
+
) -> FileIdPresignedUrl:
|
|
206
207
|
"""
|
|
207
208
|
Create a presigned url for uploading a file.
|
|
208
209
|
|
|
@@ -260,7 +261,7 @@ class FilesClient:
|
|
|
260
261
|
timeout=60,
|
|
261
262
|
)
|
|
262
263
|
if 200 <= _response.status_code < 300:
|
|
263
|
-
return pydantic.parse_obj_as(
|
|
264
|
+
return pydantic.parse_obj_as(FileIdPresignedUrl, _response.json()) # type: ignore
|
|
264
265
|
if _response.status_code == 422:
|
|
265
266
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
266
267
|
try:
|
|
@@ -829,7 +830,7 @@ class AsyncFilesClient:
|
|
|
829
830
|
resource_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreateResourceInfoValue]]] = OMIT,
|
|
830
831
|
permission_info: typing.Optional[typing.Dict[str, typing.Optional[FileCreatePermissionInfoValue]]] = OMIT,
|
|
831
832
|
data_source_id: typing.Optional[str] = OMIT,
|
|
832
|
-
) ->
|
|
833
|
+
) -> FileIdPresignedUrl:
|
|
833
834
|
"""
|
|
834
835
|
Create a presigned url for uploading a file.
|
|
835
836
|
|
|
@@ -887,7 +888,7 @@ class AsyncFilesClient:
|
|
|
887
888
|
timeout=60,
|
|
888
889
|
)
|
|
889
890
|
if 200 <= _response.status_code < 300:
|
|
890
|
-
return pydantic.parse_obj_as(
|
|
891
|
+
return pydantic.parse_obj_as(FileIdPresignedUrl, _response.json()) # type: ignore
|
|
891
892
|
if _response.status_code == 422:
|
|
892
893
|
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
893
894
|
try:
|
|
@@ -30,6 +30,7 @@ class JobsClient:
|
|
|
30
30
|
job_name: typing.Optional[str] = None,
|
|
31
31
|
limit: typing.Optional[int] = None,
|
|
32
32
|
offset: typing.Optional[int] = None,
|
|
33
|
+
sort: typing.Optional[str] = None,
|
|
33
34
|
include_usage_metrics: typing.Optional[bool] = None,
|
|
34
35
|
project_id: typing.Optional[str] = None,
|
|
35
36
|
organization_id: typing.Optional[str] = None,
|
|
@@ -48,6 +49,8 @@ class JobsClient:
|
|
|
48
49
|
|
|
49
50
|
- offset: typing.Optional[int].
|
|
50
51
|
|
|
52
|
+
- sort: typing.Optional[str].
|
|
53
|
+
|
|
51
54
|
- include_usage_metrics: typing.Optional[bool]. Deprecated: This parameter is no longer supported as we've moved to usage v2. It will be removed in a future version.
|
|
52
55
|
|
|
53
56
|
- project_id: typing.Optional[str].
|
|
@@ -69,6 +72,7 @@ class JobsClient:
|
|
|
69
72
|
"job_name": job_name,
|
|
70
73
|
"limit": limit,
|
|
71
74
|
"offset": offset,
|
|
75
|
+
"sort": sort,
|
|
72
76
|
"include_usage_metrics": include_usage_metrics,
|
|
73
77
|
"project_id": project_id,
|
|
74
78
|
"organization_id": organization_id,
|
|
@@ -98,6 +102,7 @@ class AsyncJobsClient:
|
|
|
98
102
|
job_name: typing.Optional[str] = None,
|
|
99
103
|
limit: typing.Optional[int] = None,
|
|
100
104
|
offset: typing.Optional[int] = None,
|
|
105
|
+
sort: typing.Optional[str] = None,
|
|
101
106
|
include_usage_metrics: typing.Optional[bool] = None,
|
|
102
107
|
project_id: typing.Optional[str] = None,
|
|
103
108
|
organization_id: typing.Optional[str] = None,
|
|
@@ -116,6 +121,8 @@ class AsyncJobsClient:
|
|
|
116
121
|
|
|
117
122
|
- offset: typing.Optional[int].
|
|
118
123
|
|
|
124
|
+
- sort: typing.Optional[str].
|
|
125
|
+
|
|
119
126
|
- include_usage_metrics: typing.Optional[bool]. Deprecated: This parameter is no longer supported as we've moved to usage v2. It will be removed in a future version.
|
|
120
127
|
|
|
121
128
|
- project_id: typing.Optional[str].
|
|
@@ -137,6 +144,7 @@ class AsyncJobsClient:
|
|
|
137
144
|
"job_name": job_name,
|
|
138
145
|
"limit": limit,
|
|
139
146
|
"offset": offset,
|
|
147
|
+
"sort": sort,
|
|
140
148
|
"include_usage_metrics": include_usage_metrics,
|
|
141
149
|
"project_id": project_id,
|
|
142
150
|
"organization_id": organization_id,
|
|
@@ -40,24 +40,26 @@ class LlamaExtractClient:
|
|
|
40
40
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
41
41
|
self._client_wrapper = client_wrapper
|
|
42
42
|
|
|
43
|
-
def list_extraction_agents(
|
|
43
|
+
def list_extraction_agents(
|
|
44
|
+
self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
45
|
+
) -> typing.List[ExtractAgent]:
|
|
44
46
|
"""
|
|
45
47
|
Parameters:
|
|
46
|
-
- project_id: str.
|
|
48
|
+
- project_id: typing.Optional[str].
|
|
49
|
+
|
|
50
|
+
- organization_id: typing.Optional[str].
|
|
47
51
|
---
|
|
48
52
|
from llama_cloud.client import LlamaCloud
|
|
49
53
|
|
|
50
54
|
client = LlamaCloud(
|
|
51
55
|
token="YOUR_TOKEN",
|
|
52
56
|
)
|
|
53
|
-
client.llama_extract.list_extraction_agents(
|
|
54
|
-
project_id="string",
|
|
55
|
-
)
|
|
57
|
+
client.llama_extract.list_extraction_agents()
|
|
56
58
|
"""
|
|
57
59
|
_response = self._client_wrapper.httpx_client.request(
|
|
58
60
|
"GET",
|
|
59
61
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents"),
|
|
60
|
-
params=remove_none_from_dict({"project_id": project_id}),
|
|
62
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
61
63
|
headers=self._client_wrapper.get_headers(),
|
|
62
64
|
timeout=60,
|
|
63
65
|
)
|
|
@@ -166,12 +168,16 @@ class LlamaExtractClient:
|
|
|
166
168
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
167
169
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
168
170
|
|
|
169
|
-
def get_extraction_agent_by_name(
|
|
171
|
+
def get_extraction_agent_by_name(
|
|
172
|
+
self, name: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
173
|
+
) -> ExtractAgent:
|
|
170
174
|
"""
|
|
171
175
|
Parameters:
|
|
172
176
|
- name: str.
|
|
173
177
|
|
|
174
178
|
- project_id: typing.Optional[str].
|
|
179
|
+
|
|
180
|
+
- organization_id: typing.Optional[str].
|
|
175
181
|
---
|
|
176
182
|
from llama_cloud.client import LlamaCloud
|
|
177
183
|
|
|
@@ -187,7 +193,7 @@ class LlamaExtractClient:
|
|
|
187
193
|
urllib.parse.urljoin(
|
|
188
194
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/extraction-agents/by-name/{name}"
|
|
189
195
|
),
|
|
190
|
-
params=remove_none_from_dict({"project_id": project_id}),
|
|
196
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
191
197
|
headers=self._client_wrapper.get_headers(),
|
|
192
198
|
timeout=60,
|
|
193
199
|
)
|
|
@@ -608,10 +614,16 @@ class LlamaExtractClient:
|
|
|
608
614
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
609
615
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
610
616
|
|
|
611
|
-
def get_job_result(
|
|
617
|
+
def get_job_result(
|
|
618
|
+
self, job_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
619
|
+
) -> ExtractResultset:
|
|
612
620
|
"""
|
|
613
621
|
Parameters:
|
|
614
622
|
- job_id: str.
|
|
623
|
+
|
|
624
|
+
- project_id: typing.Optional[str].
|
|
625
|
+
|
|
626
|
+
- organization_id: typing.Optional[str].
|
|
615
627
|
---
|
|
616
628
|
from llama_cloud.client import LlamaCloud
|
|
617
629
|
|
|
@@ -625,6 +637,7 @@ class LlamaExtractClient:
|
|
|
625
637
|
_response = self._client_wrapper.httpx_client.request(
|
|
626
638
|
"GET",
|
|
627
639
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/jobs/{job_id}/result"),
|
|
640
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
628
641
|
headers=self._client_wrapper.get_headers(),
|
|
629
642
|
timeout=60,
|
|
630
643
|
)
|
|
@@ -706,10 +719,16 @@ class LlamaExtractClient:
|
|
|
706
719
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
707
720
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
708
721
|
|
|
709
|
-
def get_run_by_job_id(
|
|
722
|
+
def get_run_by_job_id(
|
|
723
|
+
self, job_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
724
|
+
) -> ExtractRun:
|
|
710
725
|
"""
|
|
711
726
|
Parameters:
|
|
712
727
|
- job_id: str.
|
|
728
|
+
|
|
729
|
+
- project_id: typing.Optional[str].
|
|
730
|
+
|
|
731
|
+
- organization_id: typing.Optional[str].
|
|
713
732
|
---
|
|
714
733
|
from llama_cloud.client import LlamaCloud
|
|
715
734
|
|
|
@@ -723,6 +742,7 @@ class LlamaExtractClient:
|
|
|
723
742
|
_response = self._client_wrapper.httpx_client.request(
|
|
724
743
|
"GET",
|
|
725
744
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/by-job/{job_id}"),
|
|
745
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
726
746
|
headers=self._client_wrapper.get_headers(),
|
|
727
747
|
timeout=60,
|
|
728
748
|
)
|
|
@@ -736,10 +756,16 @@ class LlamaExtractClient:
|
|
|
736
756
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
737
757
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
738
758
|
|
|
739
|
-
def get_run(
|
|
759
|
+
def get_run(
|
|
760
|
+
self, run_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
761
|
+
) -> ExtractRun:
|
|
740
762
|
"""
|
|
741
763
|
Parameters:
|
|
742
764
|
- run_id: str.
|
|
765
|
+
|
|
766
|
+
- project_id: typing.Optional[str].
|
|
767
|
+
|
|
768
|
+
- organization_id: typing.Optional[str].
|
|
743
769
|
---
|
|
744
770
|
from llama_cloud.client import LlamaCloud
|
|
745
771
|
|
|
@@ -753,6 +779,7 @@ class LlamaExtractClient:
|
|
|
753
779
|
_response = self._client_wrapper.httpx_client.request(
|
|
754
780
|
"GET",
|
|
755
781
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
782
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
756
783
|
headers=self._client_wrapper.get_headers(),
|
|
757
784
|
timeout=60,
|
|
758
785
|
)
|
|
@@ -766,10 +793,16 @@ class LlamaExtractClient:
|
|
|
766
793
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
767
794
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
768
795
|
|
|
769
|
-
def delete_extraction_run(
|
|
796
|
+
def delete_extraction_run(
|
|
797
|
+
self, run_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
798
|
+
) -> typing.Any:
|
|
770
799
|
"""
|
|
771
800
|
Parameters:
|
|
772
801
|
- run_id: str.
|
|
802
|
+
|
|
803
|
+
- project_id: typing.Optional[str].
|
|
804
|
+
|
|
805
|
+
- organization_id: typing.Optional[str].
|
|
773
806
|
---
|
|
774
807
|
from llama_cloud.client import LlamaCloud
|
|
775
808
|
|
|
@@ -783,6 +816,7 @@ class LlamaExtractClient:
|
|
|
783
816
|
_response = self._client_wrapper.httpx_client.request(
|
|
784
817
|
"DELETE",
|
|
785
818
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
819
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
786
820
|
headers=self._client_wrapper.get_headers(),
|
|
787
821
|
timeout=60,
|
|
788
822
|
)
|
|
@@ -801,24 +835,26 @@ class AsyncLlamaExtractClient:
|
|
|
801
835
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
802
836
|
self._client_wrapper = client_wrapper
|
|
803
837
|
|
|
804
|
-
async def list_extraction_agents(
|
|
838
|
+
async def list_extraction_agents(
|
|
839
|
+
self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
840
|
+
) -> typing.List[ExtractAgent]:
|
|
805
841
|
"""
|
|
806
842
|
Parameters:
|
|
807
|
-
- project_id: str.
|
|
843
|
+
- project_id: typing.Optional[str].
|
|
844
|
+
|
|
845
|
+
- organization_id: typing.Optional[str].
|
|
808
846
|
---
|
|
809
847
|
from llama_cloud.client import AsyncLlamaCloud
|
|
810
848
|
|
|
811
849
|
client = AsyncLlamaCloud(
|
|
812
850
|
token="YOUR_TOKEN",
|
|
813
851
|
)
|
|
814
|
-
await client.llama_extract.list_extraction_agents(
|
|
815
|
-
project_id="string",
|
|
816
|
-
)
|
|
852
|
+
await client.llama_extract.list_extraction_agents()
|
|
817
853
|
"""
|
|
818
854
|
_response = await self._client_wrapper.httpx_client.request(
|
|
819
855
|
"GET",
|
|
820
856
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/extraction/extraction-agents"),
|
|
821
|
-
params=remove_none_from_dict({"project_id": project_id}),
|
|
857
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
822
858
|
headers=self._client_wrapper.get_headers(),
|
|
823
859
|
timeout=60,
|
|
824
860
|
)
|
|
@@ -927,12 +963,16 @@ class AsyncLlamaExtractClient:
|
|
|
927
963
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
928
964
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
929
965
|
|
|
930
|
-
async def get_extraction_agent_by_name(
|
|
966
|
+
async def get_extraction_agent_by_name(
|
|
967
|
+
self, name: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
968
|
+
) -> ExtractAgent:
|
|
931
969
|
"""
|
|
932
970
|
Parameters:
|
|
933
971
|
- name: str.
|
|
934
972
|
|
|
935
973
|
- project_id: typing.Optional[str].
|
|
974
|
+
|
|
975
|
+
- organization_id: typing.Optional[str].
|
|
936
976
|
---
|
|
937
977
|
from llama_cloud.client import AsyncLlamaCloud
|
|
938
978
|
|
|
@@ -948,7 +988,7 @@ class AsyncLlamaExtractClient:
|
|
|
948
988
|
urllib.parse.urljoin(
|
|
949
989
|
f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/extraction-agents/by-name/{name}"
|
|
950
990
|
),
|
|
951
|
-
params=remove_none_from_dict({"project_id": project_id}),
|
|
991
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
952
992
|
headers=self._client_wrapper.get_headers(),
|
|
953
993
|
timeout=60,
|
|
954
994
|
)
|
|
@@ -1369,10 +1409,16 @@ class AsyncLlamaExtractClient:
|
|
|
1369
1409
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1370
1410
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1371
1411
|
|
|
1372
|
-
async def get_job_result(
|
|
1412
|
+
async def get_job_result(
|
|
1413
|
+
self, job_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
1414
|
+
) -> ExtractResultset:
|
|
1373
1415
|
"""
|
|
1374
1416
|
Parameters:
|
|
1375
1417
|
- job_id: str.
|
|
1418
|
+
|
|
1419
|
+
- project_id: typing.Optional[str].
|
|
1420
|
+
|
|
1421
|
+
- organization_id: typing.Optional[str].
|
|
1376
1422
|
---
|
|
1377
1423
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1378
1424
|
|
|
@@ -1386,6 +1432,7 @@ class AsyncLlamaExtractClient:
|
|
|
1386
1432
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1387
1433
|
"GET",
|
|
1388
1434
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/jobs/{job_id}/result"),
|
|
1435
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1389
1436
|
headers=self._client_wrapper.get_headers(),
|
|
1390
1437
|
timeout=60,
|
|
1391
1438
|
)
|
|
@@ -1467,10 +1514,16 @@ class AsyncLlamaExtractClient:
|
|
|
1467
1514
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1468
1515
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1469
1516
|
|
|
1470
|
-
async def get_run_by_job_id(
|
|
1517
|
+
async def get_run_by_job_id(
|
|
1518
|
+
self, job_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
1519
|
+
) -> ExtractRun:
|
|
1471
1520
|
"""
|
|
1472
1521
|
Parameters:
|
|
1473
1522
|
- job_id: str.
|
|
1523
|
+
|
|
1524
|
+
- project_id: typing.Optional[str].
|
|
1525
|
+
|
|
1526
|
+
- organization_id: typing.Optional[str].
|
|
1474
1527
|
---
|
|
1475
1528
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1476
1529
|
|
|
@@ -1484,6 +1537,7 @@ class AsyncLlamaExtractClient:
|
|
|
1484
1537
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1485
1538
|
"GET",
|
|
1486
1539
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/by-job/{job_id}"),
|
|
1540
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1487
1541
|
headers=self._client_wrapper.get_headers(),
|
|
1488
1542
|
timeout=60,
|
|
1489
1543
|
)
|
|
@@ -1497,10 +1551,16 @@ class AsyncLlamaExtractClient:
|
|
|
1497
1551
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1498
1552
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1499
1553
|
|
|
1500
|
-
async def get_run(
|
|
1554
|
+
async def get_run(
|
|
1555
|
+
self, run_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
1556
|
+
) -> ExtractRun:
|
|
1501
1557
|
"""
|
|
1502
1558
|
Parameters:
|
|
1503
1559
|
- run_id: str.
|
|
1560
|
+
|
|
1561
|
+
- project_id: typing.Optional[str].
|
|
1562
|
+
|
|
1563
|
+
- organization_id: typing.Optional[str].
|
|
1504
1564
|
---
|
|
1505
1565
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1506
1566
|
|
|
@@ -1514,6 +1574,7 @@ class AsyncLlamaExtractClient:
|
|
|
1514
1574
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1515
1575
|
"GET",
|
|
1516
1576
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
1577
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1517
1578
|
headers=self._client_wrapper.get_headers(),
|
|
1518
1579
|
timeout=60,
|
|
1519
1580
|
)
|
|
@@ -1527,10 +1588,16 @@ class AsyncLlamaExtractClient:
|
|
|
1527
1588
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1528
1589
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1529
1590
|
|
|
1530
|
-
async def delete_extraction_run(
|
|
1591
|
+
async def delete_extraction_run(
|
|
1592
|
+
self, run_id: str, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
|
|
1593
|
+
) -> typing.Any:
|
|
1531
1594
|
"""
|
|
1532
1595
|
Parameters:
|
|
1533
1596
|
- run_id: str.
|
|
1597
|
+
|
|
1598
|
+
- project_id: typing.Optional[str].
|
|
1599
|
+
|
|
1600
|
+
- organization_id: typing.Optional[str].
|
|
1534
1601
|
---
|
|
1535
1602
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1536
1603
|
|
|
@@ -1544,6 +1611,7 @@ class AsyncLlamaExtractClient:
|
|
|
1544
1611
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1545
1612
|
"DELETE",
|
|
1546
1613
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/extraction/runs/{run_id}"),
|
|
1614
|
+
params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
|
|
1547
1615
|
headers=self._client_wrapper.get_headers(),
|
|
1548
1616
|
timeout=60,
|
|
1549
1617
|
)
|
|
@@ -408,14 +408,18 @@ class OrganizationsClient:
|
|
|
408
408
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
409
409
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
410
410
|
|
|
411
|
-
def remove_users_from_organization(
|
|
411
|
+
def remove_users_from_organization(
|
|
412
|
+
self, organization_id: str, member_user_id: str, *, request: typing.Optional[typing.List[str]] = None
|
|
413
|
+
) -> None:
|
|
412
414
|
"""
|
|
413
|
-
Remove users from an organization
|
|
415
|
+
Remove users from an organization.
|
|
414
416
|
|
|
415
417
|
Parameters:
|
|
416
418
|
- organization_id: str.
|
|
417
419
|
|
|
418
420
|
- member_user_id: str.
|
|
421
|
+
|
|
422
|
+
- request: typing.Optional[typing.List[str]].
|
|
419
423
|
---
|
|
420
424
|
from llama_cloud.client import LlamaCloud
|
|
421
425
|
|
|
@@ -433,6 +437,7 @@ class OrganizationsClient:
|
|
|
433
437
|
f"{self._client_wrapper.get_base_url()}/",
|
|
434
438
|
f"api/v1/organizations/{organization_id}/users/{member_user_id}",
|
|
435
439
|
),
|
|
440
|
+
json=jsonable_encoder(request),
|
|
436
441
|
headers=self._client_wrapper.get_headers(),
|
|
437
442
|
timeout=60,
|
|
438
443
|
)
|
|
@@ -1109,14 +1114,18 @@ class AsyncOrganizationsClient:
|
|
|
1109
1114
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1110
1115
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1111
1116
|
|
|
1112
|
-
async def remove_users_from_organization(
|
|
1117
|
+
async def remove_users_from_organization(
|
|
1118
|
+
self, organization_id: str, member_user_id: str, *, request: typing.Optional[typing.List[str]] = None
|
|
1119
|
+
) -> None:
|
|
1113
1120
|
"""
|
|
1114
|
-
Remove users from an organization
|
|
1121
|
+
Remove users from an organization.
|
|
1115
1122
|
|
|
1116
1123
|
Parameters:
|
|
1117
1124
|
- organization_id: str.
|
|
1118
1125
|
|
|
1119
1126
|
- member_user_id: str.
|
|
1127
|
+
|
|
1128
|
+
- request: typing.Optional[typing.List[str]].
|
|
1120
1129
|
---
|
|
1121
1130
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1122
1131
|
|
|
@@ -1134,6 +1143,7 @@ class AsyncOrganizationsClient:
|
|
|
1134
1143
|
f"{self._client_wrapper.get_base_url()}/",
|
|
1135
1144
|
f"api/v1/organizations/{organization_id}/users/{member_user_id}",
|
|
1136
1145
|
),
|
|
1146
|
+
json=jsonable_encoder(request),
|
|
1137
1147
|
headers=self._client_wrapper.get_headers(),
|
|
1138
1148
|
timeout=60,
|
|
1139
1149
|
)
|
|
@@ -232,6 +232,7 @@ class ParsingClient:
|
|
|
232
232
|
language: typing.List[ParserLanguages],
|
|
233
233
|
extract_layout: bool,
|
|
234
234
|
max_pages: typing.Optional[int] = OMIT,
|
|
235
|
+
outlined_table_extraction: bool,
|
|
235
236
|
output_pdf_of_document: bool,
|
|
236
237
|
output_s_3_path_prefix: str,
|
|
237
238
|
output_s_3_region: str,
|
|
@@ -360,6 +361,8 @@ class ParsingClient:
|
|
|
360
361
|
|
|
361
362
|
- max_pages: typing.Optional[int].
|
|
362
363
|
|
|
364
|
+
- outlined_table_extraction: bool.
|
|
365
|
+
|
|
363
366
|
- output_pdf_of_document: bool.
|
|
364
367
|
|
|
365
368
|
- output_s_3_path_prefix: str.
|
|
@@ -493,6 +496,7 @@ class ParsingClient:
|
|
|
493
496
|
"invalidate_cache": invalidate_cache,
|
|
494
497
|
"language": language,
|
|
495
498
|
"extract_layout": extract_layout,
|
|
499
|
+
"outlined_table_extraction": outlined_table_extraction,
|
|
496
500
|
"output_pdf_of_document": output_pdf_of_document,
|
|
497
501
|
"output_s3_path_prefix": output_s_3_path_prefix,
|
|
498
502
|
"output_s3_region": output_s_3_region,
|
|
@@ -1258,6 +1262,7 @@ class AsyncParsingClient:
|
|
|
1258
1262
|
language: typing.List[ParserLanguages],
|
|
1259
1263
|
extract_layout: bool,
|
|
1260
1264
|
max_pages: typing.Optional[int] = OMIT,
|
|
1265
|
+
outlined_table_extraction: bool,
|
|
1261
1266
|
output_pdf_of_document: bool,
|
|
1262
1267
|
output_s_3_path_prefix: str,
|
|
1263
1268
|
output_s_3_region: str,
|
|
@@ -1386,6 +1391,8 @@ class AsyncParsingClient:
|
|
|
1386
1391
|
|
|
1387
1392
|
- max_pages: typing.Optional[int].
|
|
1388
1393
|
|
|
1394
|
+
- outlined_table_extraction: bool.
|
|
1395
|
+
|
|
1389
1396
|
- output_pdf_of_document: bool.
|
|
1390
1397
|
|
|
1391
1398
|
- output_s_3_path_prefix: str.
|
|
@@ -1519,6 +1526,7 @@ class AsyncParsingClient:
|
|
|
1519
1526
|
"invalidate_cache": invalidate_cache,
|
|
1520
1527
|
"language": language,
|
|
1521
1528
|
"extract_layout": extract_layout,
|
|
1529
|
+
"outlined_table_extraction": outlined_table_extraction,
|
|
1522
1530
|
"output_pdf_of_document": output_pdf_of_document,
|
|
1523
1531
|
"output_s3_path_prefix": output_s_3_path_prefix,
|
|
1524
1532
|
"output_s3_region": output_s_3_region,
|