llama-cloud 0.1.35__py3-none-any.whl → 0.1.37__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 +32 -4
- llama_cloud/resources/__init__.py +1 -3
- llama_cloud/resources/admin/client.py +108 -0
- llama_cloud/resources/beta/client.py +460 -0
- llama_cloud/resources/classifier/client.py +231 -181
- llama_cloud/resources/data_sinks/types/data_sink_update_component.py +2 -0
- llama_cloud/resources/files/__init__.py +2 -2
- llama_cloud/resources/files/client.py +15 -73
- llama_cloud/resources/files/types/__init__.py +1 -3
- llama_cloud/resources/llama_extract/client.py +96 -4
- llama_cloud/types/__init__.py +34 -2
- llama_cloud/types/classification_result.py +4 -5
- llama_cloud/types/classifier_rule.py +43 -0
- llama_cloud/types/classify_job.py +45 -0
- llama_cloud/types/{classify_response.py → classify_job_results.py} +3 -6
- llama_cloud/types/classify_job_with_status.py +47 -0
- llama_cloud/types/classify_parsing_configuration.py +38 -0
- llama_cloud/types/cloud_astra_db_vector_store.py +51 -0
- llama_cloud/types/cloud_confluence_data_source.py +15 -0
- llama_cloud/types/configurable_data_sink_names.py +4 -0
- llama_cloud/types/data_sink_component.py +2 -0
- llama_cloud/types/data_sink_create_component.py +2 -0
- llama_cloud/types/failure_handling_config.py +37 -0
- llama_cloud/types/file_classification.py +41 -0
- llama_cloud/types/file_create.py +41 -0
- llama_cloud/types/file_filter.py +40 -0
- llama_cloud/types/file_query_response.py +38 -0
- llama_cloud/types/file_store_info_response.py +34 -0
- llama_cloud/types/file_store_info_response_status.py +25 -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/supported_llm_model_names.py +12 -0
- {llama_cloud-0.1.35.dist-info → llama_cloud-0.1.37.dist-info}/METADATA +1 -1
- {llama_cloud-0.1.35.dist-info → llama_cloud-0.1.37.dist-info}/RECORD +38 -24
- /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.35.dist-info → llama_cloud-0.1.37.dist-info}/LICENSE +0 -0
- {llama_cloud-0.1.35.dist-info → llama_cloud-0.1.37.dist-info}/WHEEL +0 -0
llama_cloud/__init__.py
CHANGED
|
@@ -38,7 +38,12 @@ from .types import (
|
|
|
38
38
|
ChatData,
|
|
39
39
|
ChunkMode,
|
|
40
40
|
ClassificationResult,
|
|
41
|
-
|
|
41
|
+
ClassifierRule,
|
|
42
|
+
ClassifyJob,
|
|
43
|
+
ClassifyJobResults,
|
|
44
|
+
ClassifyJobWithStatus,
|
|
45
|
+
ClassifyParsingConfiguration,
|
|
46
|
+
CloudAstraDbVectorStore,
|
|
42
47
|
CloudAzStorageBlobDataSource,
|
|
43
48
|
CloudAzureAiSearchVectorStore,
|
|
44
49
|
CloudBoxDataSource,
|
|
@@ -132,13 +137,22 @@ from .types import (
|
|
|
132
137
|
ExtractState,
|
|
133
138
|
ExtractTarget,
|
|
134
139
|
FailPageMode,
|
|
140
|
+
FailureHandlingConfig,
|
|
135
141
|
File,
|
|
142
|
+
FileClassification,
|
|
136
143
|
FileCountByStatusResponse,
|
|
144
|
+
FileCreate,
|
|
145
|
+
FileCreatePermissionInfoValue,
|
|
146
|
+
FileCreateResourceInfoValue,
|
|
137
147
|
FileData,
|
|
148
|
+
FileFilter,
|
|
138
149
|
FileIdPresignedUrl,
|
|
139
150
|
FileParsePublic,
|
|
140
151
|
FilePermissionInfoValue,
|
|
152
|
+
FileQueryResponse,
|
|
141
153
|
FileResourceInfoValue,
|
|
154
|
+
FileStoreInfoResponse,
|
|
155
|
+
FileStoreInfoResponseStatus,
|
|
142
156
|
FilterCondition,
|
|
143
157
|
FilterOperation,
|
|
144
158
|
FilterOperationEq,
|
|
@@ -175,6 +189,8 @@ from .types import (
|
|
|
175
189
|
LLamaParseTransformConfig,
|
|
176
190
|
LegacyParseJobConfig,
|
|
177
191
|
LicenseInfoResponse,
|
|
192
|
+
LlamaExtractModeAvailability,
|
|
193
|
+
LlamaExtractModeAvailabilityStatus,
|
|
178
194
|
LlamaExtractSettings,
|
|
179
195
|
LlamaIndexCoreBaseLlmsTypesChatMessage,
|
|
180
196
|
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem,
|
|
@@ -383,8 +399,6 @@ from .resources import (
|
|
|
383
399
|
ExtractStatelessRequestDataSchema,
|
|
384
400
|
ExtractStatelessRequestDataSchemaZeroValue,
|
|
385
401
|
FileCreateFromUrlResourceInfoValue,
|
|
386
|
-
FileCreatePermissionInfoValue,
|
|
387
|
-
FileCreateResourceInfoValue,
|
|
388
402
|
PipelineFileUpdateCustomMetadataValue,
|
|
389
403
|
PipelineUpdateEmbeddingConfig,
|
|
390
404
|
PipelineUpdateEmbeddingConfig_AzureEmbedding,
|
|
@@ -457,7 +471,12 @@ __all__ = [
|
|
|
457
471
|
"ChatData",
|
|
458
472
|
"ChunkMode",
|
|
459
473
|
"ClassificationResult",
|
|
460
|
-
"
|
|
474
|
+
"ClassifierRule",
|
|
475
|
+
"ClassifyJob",
|
|
476
|
+
"ClassifyJobResults",
|
|
477
|
+
"ClassifyJobWithStatus",
|
|
478
|
+
"ClassifyParsingConfiguration",
|
|
479
|
+
"CloudAstraDbVectorStore",
|
|
461
480
|
"CloudAzStorageBlobDataSource",
|
|
462
481
|
"CloudAzureAiSearchVectorStore",
|
|
463
482
|
"CloudBoxDataSource",
|
|
@@ -572,16 +591,23 @@ __all__ = [
|
|
|
572
591
|
"ExtractStatelessRequestDataSchemaZeroValue",
|
|
573
592
|
"ExtractTarget",
|
|
574
593
|
"FailPageMode",
|
|
594
|
+
"FailureHandlingConfig",
|
|
575
595
|
"File",
|
|
596
|
+
"FileClassification",
|
|
576
597
|
"FileCountByStatusResponse",
|
|
598
|
+
"FileCreate",
|
|
577
599
|
"FileCreateFromUrlResourceInfoValue",
|
|
578
600
|
"FileCreatePermissionInfoValue",
|
|
579
601
|
"FileCreateResourceInfoValue",
|
|
580
602
|
"FileData",
|
|
603
|
+
"FileFilter",
|
|
581
604
|
"FileIdPresignedUrl",
|
|
582
605
|
"FileParsePublic",
|
|
583
606
|
"FilePermissionInfoValue",
|
|
607
|
+
"FileQueryResponse",
|
|
584
608
|
"FileResourceInfoValue",
|
|
609
|
+
"FileStoreInfoResponse",
|
|
610
|
+
"FileStoreInfoResponseStatus",
|
|
585
611
|
"FilterCondition",
|
|
586
612
|
"FilterOperation",
|
|
587
613
|
"FilterOperationEq",
|
|
@@ -619,6 +645,8 @@ __all__ = [
|
|
|
619
645
|
"LegacyParseJobConfig",
|
|
620
646
|
"LicenseInfoResponse",
|
|
621
647
|
"LlamaCloudEnvironment",
|
|
648
|
+
"LlamaExtractModeAvailability",
|
|
649
|
+
"LlamaExtractModeAvailabilityStatus",
|
|
622
650
|
"LlamaExtractSettings",
|
|
623
651
|
"LlamaIndexCoreBaseLlmsTypesChatMessage",
|
|
624
652
|
"LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem",
|
|
@@ -33,7 +33,7 @@ from .embedding_model_configs import (
|
|
|
33
33
|
EmbeddingModelConfigCreateEmbeddingConfig_OpenaiEmbedding,
|
|
34
34
|
EmbeddingModelConfigCreateEmbeddingConfig_VertexaiEmbedding,
|
|
35
35
|
)
|
|
36
|
-
from .files import FileCreateFromUrlResourceInfoValue
|
|
36
|
+
from .files import FileCreateFromUrlResourceInfoValue
|
|
37
37
|
from .llama_extract import (
|
|
38
38
|
ExtractAgentCreateDataSchema,
|
|
39
39
|
ExtractAgentCreateDataSchemaZeroValue,
|
|
@@ -84,8 +84,6 @@ __all__ = [
|
|
|
84
84
|
"ExtractStatelessRequestDataSchema",
|
|
85
85
|
"ExtractStatelessRequestDataSchemaZeroValue",
|
|
86
86
|
"FileCreateFromUrlResourceInfoValue",
|
|
87
|
-
"FileCreatePermissionInfoValue",
|
|
88
|
-
"FileCreateResourceInfoValue",
|
|
89
87
|
"PipelineFileUpdateCustomMetadataValue",
|
|
90
88
|
"PipelineUpdateEmbeddingConfig",
|
|
91
89
|
"PipelineUpdateEmbeddingConfig_AzureEmbedding",
|
|
@@ -8,8 +8,10 @@ from ...core.api_error import ApiError
|
|
|
8
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
9
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
10
10
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
11
|
+
from ...types.file_store_info_response import FileStoreInfoResponse
|
|
11
12
|
from ...types.http_validation_error import HttpValidationError
|
|
12
13
|
from ...types.license_info_response import LicenseInfoResponse
|
|
14
|
+
from ...types.llama_extract_mode_availability import LlamaExtractModeAvailability
|
|
13
15
|
|
|
14
16
|
try:
|
|
15
17
|
import pydantic
|
|
@@ -53,6 +55,59 @@ class AdminClient:
|
|
|
53
55
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
54
56
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
55
57
|
|
|
58
|
+
def get_file_store_info(self) -> FileStoreInfoResponse:
|
|
59
|
+
"""
|
|
60
|
+
from llama_cloud.client import LlamaCloud
|
|
61
|
+
|
|
62
|
+
client = LlamaCloud(
|
|
63
|
+
token="YOUR_TOKEN",
|
|
64
|
+
)
|
|
65
|
+
client.admin.get_file_store_info()
|
|
66
|
+
"""
|
|
67
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
68
|
+
"GET",
|
|
69
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/admin/filestores/info"),
|
|
70
|
+
headers=self._client_wrapper.get_headers(),
|
|
71
|
+
timeout=60,
|
|
72
|
+
)
|
|
73
|
+
if 200 <= _response.status_code < 300:
|
|
74
|
+
return pydantic.parse_obj_as(FileStoreInfoResponse, _response.json()) # type: ignore
|
|
75
|
+
if _response.status_code == 422:
|
|
76
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
77
|
+
try:
|
|
78
|
+
_response_json = _response.json()
|
|
79
|
+
except JSONDecodeError:
|
|
80
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
81
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
82
|
+
|
|
83
|
+
def get_llamaextract_features(self) -> typing.List[LlamaExtractModeAvailability]:
|
|
84
|
+
"""
|
|
85
|
+
Get LlamaExtract feature availability based on available models.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
from llama_cloud.client import LlamaCloud
|
|
89
|
+
|
|
90
|
+
client = LlamaCloud(
|
|
91
|
+
token="YOUR_TOKEN",
|
|
92
|
+
)
|
|
93
|
+
client.admin.get_llamaextract_features()
|
|
94
|
+
"""
|
|
95
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
96
|
+
"GET",
|
|
97
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/admin/llamaextract/features"),
|
|
98
|
+
headers=self._client_wrapper.get_headers(),
|
|
99
|
+
timeout=60,
|
|
100
|
+
)
|
|
101
|
+
if 200 <= _response.status_code < 300:
|
|
102
|
+
return pydantic.parse_obj_as(typing.List[LlamaExtractModeAvailability], _response.json()) # type: ignore
|
|
103
|
+
if _response.status_code == 422:
|
|
104
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
105
|
+
try:
|
|
106
|
+
_response_json = _response.json()
|
|
107
|
+
except JSONDecodeError:
|
|
108
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
109
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
110
|
+
|
|
56
111
|
|
|
57
112
|
class AsyncAdminClient:
|
|
58
113
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -86,3 +141,56 @@ class AsyncAdminClient:
|
|
|
86
141
|
except JSONDecodeError:
|
|
87
142
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
88
143
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
144
|
+
|
|
145
|
+
async def get_file_store_info(self) -> FileStoreInfoResponse:
|
|
146
|
+
"""
|
|
147
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
148
|
+
|
|
149
|
+
client = AsyncLlamaCloud(
|
|
150
|
+
token="YOUR_TOKEN",
|
|
151
|
+
)
|
|
152
|
+
await client.admin.get_file_store_info()
|
|
153
|
+
"""
|
|
154
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
155
|
+
"GET",
|
|
156
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/admin/filestores/info"),
|
|
157
|
+
headers=self._client_wrapper.get_headers(),
|
|
158
|
+
timeout=60,
|
|
159
|
+
)
|
|
160
|
+
if 200 <= _response.status_code < 300:
|
|
161
|
+
return pydantic.parse_obj_as(FileStoreInfoResponse, _response.json()) # type: ignore
|
|
162
|
+
if _response.status_code == 422:
|
|
163
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
164
|
+
try:
|
|
165
|
+
_response_json = _response.json()
|
|
166
|
+
except JSONDecodeError:
|
|
167
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
168
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
169
|
+
|
|
170
|
+
async def get_llamaextract_features(self) -> typing.List[LlamaExtractModeAvailability]:
|
|
171
|
+
"""
|
|
172
|
+
Get LlamaExtract feature availability based on available models.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
176
|
+
|
|
177
|
+
client = AsyncLlamaCloud(
|
|
178
|
+
token="YOUR_TOKEN",
|
|
179
|
+
)
|
|
180
|
+
await client.admin.get_llamaextract_features()
|
|
181
|
+
"""
|
|
182
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
183
|
+
"GET",
|
|
184
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/admin/llamaextract/features"),
|
|
185
|
+
headers=self._client_wrapper.get_headers(),
|
|
186
|
+
timeout=60,
|
|
187
|
+
)
|
|
188
|
+
if 200 <= _response.status_code < 300:
|
|
189
|
+
return pydantic.parse_obj_as(typing.List[LlamaExtractModeAvailability], _response.json()) # type: ignore
|
|
190
|
+
if _response.status_code == 422:
|
|
191
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
192
|
+
try:
|
|
193
|
+
_response_json = _response.json()
|
|
194
|
+
except JSONDecodeError:
|
|
195
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
196
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|