llama-cloud 0.1.4__py3-none-any.whl → 0.1.6__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 +76 -10
- llama_cloud/client.py +3 -0
- llama_cloud/environment.py +1 -1
- llama_cloud/resources/__init__.py +23 -1
- llama_cloud/resources/data_sinks/client.py +26 -20
- llama_cloud/resources/data_sources/client.py +16 -16
- llama_cloud/resources/embedding_model_configs/__init__.py +23 -0
- llama_cloud/resources/embedding_model_configs/client.py +416 -0
- llama_cloud/resources/embedding_model_configs/types/__init__.py +23 -0
- llama_cloud/resources/embedding_model_configs/types/embedding_model_config_create_embedding_config.py +89 -0
- llama_cloud/resources/evals/client.py +36 -26
- llama_cloud/resources/extraction/client.py +32 -32
- llama_cloud/resources/files/__init__.py +2 -2
- llama_cloud/resources/files/client.py +310 -54
- llama_cloud/resources/files/types/__init__.py +3 -1
- llama_cloud/resources/files/types/file_create_from_url_resource_info_value.py +7 -0
- llama_cloud/resources/files/types/file_create_permission_info_value.py +7 -0
- llama_cloud/resources/organizations/client.py +125 -56
- llama_cloud/resources/parsing/client.py +652 -264
- llama_cloud/resources/pipelines/client.py +617 -310
- llama_cloud/resources/projects/client.py +341 -136
- llama_cloud/types/__init__.py +58 -10
- llama_cloud/types/azure_open_ai_embedding.py +12 -6
- llama_cloud/types/base_prompt_template.py +6 -2
- llama_cloud/types/bedrock_embedding.py +12 -6
- llama_cloud/types/character_splitter.py +4 -2
- llama_cloud/types/chat_message.py +1 -1
- llama_cloud/types/cloud_az_storage_blob_data_source.py +16 -7
- llama_cloud/types/cloud_box_data_source.py +13 -6
- llama_cloud/types/cloud_confluence_data_source.py +7 -6
- llama_cloud/types/cloud_document.py +3 -1
- llama_cloud/types/cloud_document_create.py +3 -1
- llama_cloud/types/cloud_google_drive_data_source.py +1 -0
- llama_cloud/types/cloud_jira_data_source.py +7 -4
- llama_cloud/types/cloud_notion_page_data_source.py +3 -2
- llama_cloud/types/cloud_one_drive_data_source.py +6 -2
- llama_cloud/types/cloud_postgres_vector_store.py +1 -1
- llama_cloud/types/cloud_s_3_data_source.py +9 -4
- llama_cloud/types/cloud_sharepoint_data_source.py +9 -5
- llama_cloud/types/cloud_slack_data_source.py +7 -6
- llama_cloud/types/code_splitter.py +1 -1
- llama_cloud/types/cohere_embedding.py +7 -3
- llama_cloud/types/data_sink.py +4 -4
- llama_cloud/types/data_sink_create.py +1 -1
- llama_cloud/types/data_source.py +7 -5
- llama_cloud/types/data_source_create.py +4 -2
- llama_cloud/types/embedding_model_config.py +43 -0
- llama_cloud/types/embedding_model_config_embedding_config.py +89 -0
- llama_cloud/types/embedding_model_config_update.py +35 -0
- llama_cloud/types/embedding_model_config_update_embedding_config.py +89 -0
- llama_cloud/types/eval_dataset.py +2 -2
- llama_cloud/types/eval_dataset_job_record.py +13 -7
- llama_cloud/types/eval_execution_params_override.py +6 -2
- llama_cloud/types/eval_question.py +2 -2
- llama_cloud/types/extraction_result.py +2 -2
- llama_cloud/types/extraction_schema.py +5 -3
- llama_cloud/types/file.py +15 -7
- llama_cloud/types/file_permission_info_value.py +5 -0
- llama_cloud/types/filter_operator.py +2 -2
- llama_cloud/types/gemini_embedding.py +10 -6
- llama_cloud/types/hugging_face_inference_api_embedding.py +27 -11
- llama_cloud/types/input_message.py +3 -1
- llama_cloud/types/interval_usage_and_plan.py +36 -0
- llama_cloud/types/job_name_mapping.py +4 -0
- llama_cloud/types/llama_parse_parameters.py +21 -0
- llama_cloud/types/llm.py +4 -2
- llama_cloud/types/llm_parameters.py +5 -2
- llama_cloud/types/local_eval.py +10 -8
- llama_cloud/types/local_eval_results.py +1 -1
- llama_cloud/types/managed_ingestion_status_response.py +5 -3
- llama_cloud/types/markdown_element_node_parser.py +5 -3
- llama_cloud/types/markdown_node_parser.py +3 -2
- llama_cloud/types/metadata_filter.py +2 -2
- llama_cloud/types/metric_result.py +3 -3
- llama_cloud/types/node_parser.py +1 -1
- llama_cloud/types/open_ai_embedding.py +12 -6
- llama_cloud/types/organization.py +2 -2
- llama_cloud/types/page_splitter_node_parser.py +2 -2
- llama_cloud/types/paginated_list_pipeline_files_response.py +35 -0
- llama_cloud/types/parsing_job_structured_result.py +32 -0
- llama_cloud/types/permission.py +3 -3
- llama_cloud/types/pipeline.py +17 -6
- llama_cloud/types/pipeline_configuration_hashes.py +3 -3
- llama_cloud/types/pipeline_create.py +15 -4
- llama_cloud/types/pipeline_data_source.py +13 -7
- llama_cloud/types/pipeline_data_source_create.py +3 -1
- llama_cloud/types/pipeline_deployment.py +4 -4
- llama_cloud/types/pipeline_file.py +25 -10
- llama_cloud/types/pipeline_file_create.py +3 -1
- llama_cloud/types/pipeline_file_permission_info_value.py +7 -0
- llama_cloud/types/plan.py +40 -0
- llama_cloud/types/playground_session.py +2 -2
- llama_cloud/types/preset_retrieval_params.py +14 -7
- llama_cloud/types/presigned_url.py +3 -1
- llama_cloud/types/project.py +2 -2
- llama_cloud/types/prompt_mixin_prompts.py +1 -1
- llama_cloud/types/prompt_spec.py +4 -2
- llama_cloud/types/role.py +3 -3
- llama_cloud/types/sentence_splitter.py +4 -2
- llama_cloud/types/text_node.py +3 -3
- llama_cloud/types/{hugging_face_inference_api_embedding_token.py → token.py} +1 -1
- llama_cloud/types/token_text_splitter.py +1 -1
- llama_cloud/types/usage.py +41 -0
- llama_cloud/types/user_organization.py +9 -5
- llama_cloud/types/user_organization_create.py +4 -4
- llama_cloud/types/user_organization_delete.py +2 -2
- llama_cloud/types/user_organization_role.py +2 -2
- llama_cloud/types/value.py +5 -0
- llama_cloud/types/vertex_text_embedding.py +9 -5
- {llama_cloud-0.1.4.dist-info → llama_cloud-0.1.6.dist-info}/METADATA +1 -1
- {llama_cloud-0.1.4.dist-info → llama_cloud-0.1.6.dist-info}/RECORD +113 -99
- llama_cloud/types/data_sink_component.py +0 -20
- llama_cloud/types/data_source_component.py +0 -28
- llama_cloud/types/metadata_filter_value.py +0 -5
- llama_cloud/types/pipeline_data_source_component.py +0 -28
- {llama_cloud-0.1.4.dist-info → llama_cloud-0.1.6.dist-info}/LICENSE +0 -0
- {llama_cloud-0.1.4.dist-info → llama_cloud-0.1.6.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from .file_create_from_url_resource_info_value import FileCreateFromUrlResourceInfoValue
|
|
4
|
+
from .file_create_permission_info_value import FileCreatePermissionInfoValue
|
|
3
5
|
from .file_create_resource_info_value import FileCreateResourceInfoValue
|
|
4
6
|
|
|
5
|
-
__all__ = ["FileCreateResourceInfoValue"]
|
|
7
|
+
__all__ = ["FileCreateFromUrlResourceInfoValue", "FileCreatePermissionInfoValue", "FileCreateResourceInfoValue"]
|
|
@@ -10,6 +10,7 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
|
10
10
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
11
11
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
12
|
from ...types.http_validation_error import HttpValidationError
|
|
13
|
+
from ...types.interval_usage_and_plan import IntervalUsageAndPlan
|
|
13
14
|
from ...types.organization import Organization
|
|
14
15
|
from ...types.organization_create import OrganizationCreate
|
|
15
16
|
from ...types.project import Project
|
|
@@ -78,7 +79,7 @@ class OrganizationsClient:
|
|
|
78
79
|
)
|
|
79
80
|
client.organizations.create_organization(
|
|
80
81
|
request=OrganizationCreate(
|
|
81
|
-
name="
|
|
82
|
+
name="name",
|
|
82
83
|
),
|
|
83
84
|
)
|
|
84
85
|
"""
|
|
@@ -114,7 +115,7 @@ class OrganizationsClient:
|
|
|
114
115
|
)
|
|
115
116
|
client.organizations.upsert_organization(
|
|
116
117
|
request=OrganizationCreate(
|
|
117
|
-
name="
|
|
118
|
+
name="name",
|
|
118
119
|
),
|
|
119
120
|
)
|
|
120
121
|
"""
|
|
@@ -176,7 +177,7 @@ class OrganizationsClient:
|
|
|
176
177
|
token="YOUR_TOKEN",
|
|
177
178
|
)
|
|
178
179
|
client.organizations.set_default_organization(
|
|
179
|
-
organization_id="
|
|
180
|
+
organization_id="organization_id",
|
|
180
181
|
)
|
|
181
182
|
"""
|
|
182
183
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -209,7 +210,7 @@ class OrganizationsClient:
|
|
|
209
210
|
token="YOUR_TOKEN",
|
|
210
211
|
)
|
|
211
212
|
client.organizations.get_organization(
|
|
212
|
-
organization_id="
|
|
213
|
+
organization_id="organization_id",
|
|
213
214
|
)
|
|
214
215
|
"""
|
|
215
216
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -235,7 +236,7 @@ class OrganizationsClient:
|
|
|
235
236
|
Parameters:
|
|
236
237
|
- organization_id: str.
|
|
237
238
|
|
|
238
|
-
- name: typing.Optional[str].
|
|
239
|
+
- name: typing.Optional[str]. A name for the organization.
|
|
239
240
|
---
|
|
240
241
|
from llama_cloud.client import LlamaCloud
|
|
241
242
|
|
|
@@ -243,7 +244,7 @@ class OrganizationsClient:
|
|
|
243
244
|
token="YOUR_TOKEN",
|
|
244
245
|
)
|
|
245
246
|
client.organizations.update_organization(
|
|
246
|
-
organization_id="
|
|
247
|
+
organization_id="organization_id",
|
|
247
248
|
)
|
|
248
249
|
"""
|
|
249
250
|
_request: typing.Dict[str, typing.Any] = {}
|
|
@@ -279,7 +280,7 @@ class OrganizationsClient:
|
|
|
279
280
|
token="YOUR_TOKEN",
|
|
280
281
|
)
|
|
281
282
|
client.organizations.delete_organization(
|
|
282
|
-
organization_id="
|
|
283
|
+
organization_id="organization_id",
|
|
283
284
|
)
|
|
284
285
|
"""
|
|
285
286
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -298,6 +299,38 @@ class OrganizationsClient:
|
|
|
298
299
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
299
300
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
300
301
|
|
|
302
|
+
def get_organization_usage(self, organization_id: typing.Optional[str]) -> IntervalUsageAndPlan:
|
|
303
|
+
"""
|
|
304
|
+
Get usage for a project
|
|
305
|
+
|
|
306
|
+
Parameters:
|
|
307
|
+
- organization_id: typing.Optional[str].
|
|
308
|
+
---
|
|
309
|
+
from llama_cloud.client import LlamaCloud
|
|
310
|
+
|
|
311
|
+
client = LlamaCloud(
|
|
312
|
+
token="YOUR_TOKEN",
|
|
313
|
+
)
|
|
314
|
+
client.organizations.get_organization_usage()
|
|
315
|
+
"""
|
|
316
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
317
|
+
"GET",
|
|
318
|
+
urllib.parse.urljoin(
|
|
319
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/organizations/{organization_id}/usage"
|
|
320
|
+
),
|
|
321
|
+
headers=self._client_wrapper.get_headers(),
|
|
322
|
+
timeout=60,
|
|
323
|
+
)
|
|
324
|
+
if 200 <= _response.status_code < 300:
|
|
325
|
+
return pydantic.parse_obj_as(IntervalUsageAndPlan, _response.json()) # type: ignore
|
|
326
|
+
if _response.status_code == 422:
|
|
327
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
328
|
+
try:
|
|
329
|
+
_response_json = _response.json()
|
|
330
|
+
except JSONDecodeError:
|
|
331
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
332
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
333
|
+
|
|
301
334
|
def list_organization_users(self, organization_id: str) -> typing.List[UserOrganization]:
|
|
302
335
|
"""
|
|
303
336
|
Get all users in an organization.
|
|
@@ -311,7 +344,7 @@ class OrganizationsClient:
|
|
|
311
344
|
token="YOUR_TOKEN",
|
|
312
345
|
)
|
|
313
346
|
client.organizations.list_organization_users(
|
|
314
|
-
organization_id="
|
|
347
|
+
organization_id="organization_id",
|
|
315
348
|
)
|
|
316
349
|
"""
|
|
317
350
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -343,14 +376,15 @@ class OrganizationsClient:
|
|
|
343
376
|
|
|
344
377
|
- request: typing.List[UserOrganizationCreate].
|
|
345
378
|
---
|
|
379
|
+
from llama_cloud import UserOrganizationCreate
|
|
346
380
|
from llama_cloud.client import LlamaCloud
|
|
347
381
|
|
|
348
382
|
client = LlamaCloud(
|
|
349
383
|
token="YOUR_TOKEN",
|
|
350
384
|
)
|
|
351
385
|
client.organizations.add_users_to_organization(
|
|
352
|
-
organization_id="
|
|
353
|
-
request=[],
|
|
386
|
+
organization_id="organization_id",
|
|
387
|
+
request=[UserOrganizationCreate()],
|
|
354
388
|
)
|
|
355
389
|
"""
|
|
356
390
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -387,8 +421,8 @@ class OrganizationsClient:
|
|
|
387
421
|
token="YOUR_TOKEN",
|
|
388
422
|
)
|
|
389
423
|
client.organizations.remove_users_from_organization(
|
|
390
|
-
organization_id="
|
|
391
|
-
member_user_id="
|
|
424
|
+
organization_id="organization_id",
|
|
425
|
+
member_user_id="member_user_id",
|
|
392
426
|
)
|
|
393
427
|
"""
|
|
394
428
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -421,14 +455,15 @@ class OrganizationsClient:
|
|
|
421
455
|
|
|
422
456
|
- request: typing.List[UserOrganizationDelete].
|
|
423
457
|
---
|
|
458
|
+
from llama_cloud import UserOrganizationDelete
|
|
424
459
|
from llama_cloud.client import LlamaCloud
|
|
425
460
|
|
|
426
461
|
client = LlamaCloud(
|
|
427
462
|
token="YOUR_TOKEN",
|
|
428
463
|
)
|
|
429
464
|
client.organizations.batch_remove_users_from_organization(
|
|
430
|
-
organization_id="
|
|
431
|
-
request=[],
|
|
465
|
+
organization_id="organization_id",
|
|
466
|
+
request=[UserOrganizationDelete()],
|
|
432
467
|
)
|
|
433
468
|
"""
|
|
434
469
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -463,7 +498,7 @@ class OrganizationsClient:
|
|
|
463
498
|
token="YOUR_TOKEN",
|
|
464
499
|
)
|
|
465
500
|
client.organizations.list_roles(
|
|
466
|
-
organization_id="
|
|
501
|
+
organization_id="organization_id",
|
|
467
502
|
)
|
|
468
503
|
"""
|
|
469
504
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -497,7 +532,7 @@ class OrganizationsClient:
|
|
|
497
532
|
token="YOUR_TOKEN",
|
|
498
533
|
)
|
|
499
534
|
client.organizations.get_user_role(
|
|
500
|
-
organization_id="
|
|
535
|
+
organization_id="organization_id",
|
|
501
536
|
)
|
|
502
537
|
"""
|
|
503
538
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -539,10 +574,10 @@ class OrganizationsClient:
|
|
|
539
574
|
token="YOUR_TOKEN",
|
|
540
575
|
)
|
|
541
576
|
client.organizations.assign_role_to_user_in_organization(
|
|
542
|
-
organization_id="
|
|
543
|
-
user_id="
|
|
544
|
-
user_organization_role_create_organization_id="
|
|
545
|
-
role_id="
|
|
577
|
+
organization_id="organization_id",
|
|
578
|
+
user_id="user_id",
|
|
579
|
+
user_organization_role_create_organization_id="organization_id",
|
|
580
|
+
role_id="role_id",
|
|
546
581
|
)
|
|
547
582
|
"""
|
|
548
583
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -585,8 +620,8 @@ class OrganizationsClient:
|
|
|
585
620
|
token="YOUR_TOKEN",
|
|
586
621
|
)
|
|
587
622
|
client.organizations.list_projects_by_user(
|
|
588
|
-
organization_id="
|
|
589
|
-
user_id="
|
|
623
|
+
organization_id="organization_id",
|
|
624
|
+
user_id="user_id",
|
|
590
625
|
)
|
|
591
626
|
"""
|
|
592
627
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -625,9 +660,9 @@ class OrganizationsClient:
|
|
|
625
660
|
token="YOUR_TOKEN",
|
|
626
661
|
)
|
|
627
662
|
client.organizations.add_user_to_project(
|
|
628
|
-
organization_id="
|
|
629
|
-
user_id="
|
|
630
|
-
project_id="
|
|
663
|
+
organization_id="organization_id",
|
|
664
|
+
user_id="user_id",
|
|
665
|
+
project_id="project_id",
|
|
631
666
|
)
|
|
632
667
|
"""
|
|
633
668
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -667,9 +702,9 @@ class OrganizationsClient:
|
|
|
667
702
|
token="YOUR_TOKEN",
|
|
668
703
|
)
|
|
669
704
|
client.organizations.remove_user_from_project(
|
|
670
|
-
organization_id="
|
|
671
|
-
user_id="
|
|
672
|
-
project_id="
|
|
705
|
+
organization_id="organization_id",
|
|
706
|
+
user_id="user_id",
|
|
707
|
+
project_id="project_id",
|
|
673
708
|
)
|
|
674
709
|
"""
|
|
675
710
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -739,7 +774,7 @@ class AsyncOrganizationsClient:
|
|
|
739
774
|
)
|
|
740
775
|
await client.organizations.create_organization(
|
|
741
776
|
request=OrganizationCreate(
|
|
742
|
-
name="
|
|
777
|
+
name="name",
|
|
743
778
|
),
|
|
744
779
|
)
|
|
745
780
|
"""
|
|
@@ -775,7 +810,7 @@ class AsyncOrganizationsClient:
|
|
|
775
810
|
)
|
|
776
811
|
await client.organizations.upsert_organization(
|
|
777
812
|
request=OrganizationCreate(
|
|
778
|
-
name="
|
|
813
|
+
name="name",
|
|
779
814
|
),
|
|
780
815
|
)
|
|
781
816
|
"""
|
|
@@ -837,7 +872,7 @@ class AsyncOrganizationsClient:
|
|
|
837
872
|
token="YOUR_TOKEN",
|
|
838
873
|
)
|
|
839
874
|
await client.organizations.set_default_organization(
|
|
840
|
-
organization_id="
|
|
875
|
+
organization_id="organization_id",
|
|
841
876
|
)
|
|
842
877
|
"""
|
|
843
878
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -870,7 +905,7 @@ class AsyncOrganizationsClient:
|
|
|
870
905
|
token="YOUR_TOKEN",
|
|
871
906
|
)
|
|
872
907
|
await client.organizations.get_organization(
|
|
873
|
-
organization_id="
|
|
908
|
+
organization_id="organization_id",
|
|
874
909
|
)
|
|
875
910
|
"""
|
|
876
911
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -896,7 +931,7 @@ class AsyncOrganizationsClient:
|
|
|
896
931
|
Parameters:
|
|
897
932
|
- organization_id: str.
|
|
898
933
|
|
|
899
|
-
- name: typing.Optional[str].
|
|
934
|
+
- name: typing.Optional[str]. A name for the organization.
|
|
900
935
|
---
|
|
901
936
|
from llama_cloud.client import AsyncLlamaCloud
|
|
902
937
|
|
|
@@ -904,7 +939,7 @@ class AsyncOrganizationsClient:
|
|
|
904
939
|
token="YOUR_TOKEN",
|
|
905
940
|
)
|
|
906
941
|
await client.organizations.update_organization(
|
|
907
|
-
organization_id="
|
|
942
|
+
organization_id="organization_id",
|
|
908
943
|
)
|
|
909
944
|
"""
|
|
910
945
|
_request: typing.Dict[str, typing.Any] = {}
|
|
@@ -940,7 +975,7 @@ class AsyncOrganizationsClient:
|
|
|
940
975
|
token="YOUR_TOKEN",
|
|
941
976
|
)
|
|
942
977
|
await client.organizations.delete_organization(
|
|
943
|
-
organization_id="
|
|
978
|
+
organization_id="organization_id",
|
|
944
979
|
)
|
|
945
980
|
"""
|
|
946
981
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -959,6 +994,38 @@ class AsyncOrganizationsClient:
|
|
|
959
994
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
960
995
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
961
996
|
|
|
997
|
+
async def get_organization_usage(self, organization_id: typing.Optional[str]) -> IntervalUsageAndPlan:
|
|
998
|
+
"""
|
|
999
|
+
Get usage for a project
|
|
1000
|
+
|
|
1001
|
+
Parameters:
|
|
1002
|
+
- organization_id: typing.Optional[str].
|
|
1003
|
+
---
|
|
1004
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
1005
|
+
|
|
1006
|
+
client = AsyncLlamaCloud(
|
|
1007
|
+
token="YOUR_TOKEN",
|
|
1008
|
+
)
|
|
1009
|
+
await client.organizations.get_organization_usage()
|
|
1010
|
+
"""
|
|
1011
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1012
|
+
"GET",
|
|
1013
|
+
urllib.parse.urljoin(
|
|
1014
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/organizations/{organization_id}/usage"
|
|
1015
|
+
),
|
|
1016
|
+
headers=self._client_wrapper.get_headers(),
|
|
1017
|
+
timeout=60,
|
|
1018
|
+
)
|
|
1019
|
+
if 200 <= _response.status_code < 300:
|
|
1020
|
+
return pydantic.parse_obj_as(IntervalUsageAndPlan, _response.json()) # type: ignore
|
|
1021
|
+
if _response.status_code == 422:
|
|
1022
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
1023
|
+
try:
|
|
1024
|
+
_response_json = _response.json()
|
|
1025
|
+
except JSONDecodeError:
|
|
1026
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1027
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1028
|
+
|
|
962
1029
|
async def list_organization_users(self, organization_id: str) -> typing.List[UserOrganization]:
|
|
963
1030
|
"""
|
|
964
1031
|
Get all users in an organization.
|
|
@@ -972,7 +1039,7 @@ class AsyncOrganizationsClient:
|
|
|
972
1039
|
token="YOUR_TOKEN",
|
|
973
1040
|
)
|
|
974
1041
|
await client.organizations.list_organization_users(
|
|
975
|
-
organization_id="
|
|
1042
|
+
organization_id="organization_id",
|
|
976
1043
|
)
|
|
977
1044
|
"""
|
|
978
1045
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1004,14 +1071,15 @@ class AsyncOrganizationsClient:
|
|
|
1004
1071
|
|
|
1005
1072
|
- request: typing.List[UserOrganizationCreate].
|
|
1006
1073
|
---
|
|
1074
|
+
from llama_cloud import UserOrganizationCreate
|
|
1007
1075
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1008
1076
|
|
|
1009
1077
|
client = AsyncLlamaCloud(
|
|
1010
1078
|
token="YOUR_TOKEN",
|
|
1011
1079
|
)
|
|
1012
1080
|
await client.organizations.add_users_to_organization(
|
|
1013
|
-
organization_id="
|
|
1014
|
-
request=[],
|
|
1081
|
+
organization_id="organization_id",
|
|
1082
|
+
request=[UserOrganizationCreate()],
|
|
1015
1083
|
)
|
|
1016
1084
|
"""
|
|
1017
1085
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1048,8 +1116,8 @@ class AsyncOrganizationsClient:
|
|
|
1048
1116
|
token="YOUR_TOKEN",
|
|
1049
1117
|
)
|
|
1050
1118
|
await client.organizations.remove_users_from_organization(
|
|
1051
|
-
organization_id="
|
|
1052
|
-
member_user_id="
|
|
1119
|
+
organization_id="organization_id",
|
|
1120
|
+
member_user_id="member_user_id",
|
|
1053
1121
|
)
|
|
1054
1122
|
"""
|
|
1055
1123
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1082,14 +1150,15 @@ class AsyncOrganizationsClient:
|
|
|
1082
1150
|
|
|
1083
1151
|
- request: typing.List[UserOrganizationDelete].
|
|
1084
1152
|
---
|
|
1153
|
+
from llama_cloud import UserOrganizationDelete
|
|
1085
1154
|
from llama_cloud.client import AsyncLlamaCloud
|
|
1086
1155
|
|
|
1087
1156
|
client = AsyncLlamaCloud(
|
|
1088
1157
|
token="YOUR_TOKEN",
|
|
1089
1158
|
)
|
|
1090
1159
|
await client.organizations.batch_remove_users_from_organization(
|
|
1091
|
-
organization_id="
|
|
1092
|
-
request=[],
|
|
1160
|
+
organization_id="organization_id",
|
|
1161
|
+
request=[UserOrganizationDelete()],
|
|
1093
1162
|
)
|
|
1094
1163
|
"""
|
|
1095
1164
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1124,7 +1193,7 @@ class AsyncOrganizationsClient:
|
|
|
1124
1193
|
token="YOUR_TOKEN",
|
|
1125
1194
|
)
|
|
1126
1195
|
await client.organizations.list_roles(
|
|
1127
|
-
organization_id="
|
|
1196
|
+
organization_id="organization_id",
|
|
1128
1197
|
)
|
|
1129
1198
|
"""
|
|
1130
1199
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1158,7 +1227,7 @@ class AsyncOrganizationsClient:
|
|
|
1158
1227
|
token="YOUR_TOKEN",
|
|
1159
1228
|
)
|
|
1160
1229
|
await client.organizations.get_user_role(
|
|
1161
|
-
organization_id="
|
|
1230
|
+
organization_id="organization_id",
|
|
1162
1231
|
)
|
|
1163
1232
|
"""
|
|
1164
1233
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1200,10 +1269,10 @@ class AsyncOrganizationsClient:
|
|
|
1200
1269
|
token="YOUR_TOKEN",
|
|
1201
1270
|
)
|
|
1202
1271
|
await client.organizations.assign_role_to_user_in_organization(
|
|
1203
|
-
organization_id="
|
|
1204
|
-
user_id="
|
|
1205
|
-
user_organization_role_create_organization_id="
|
|
1206
|
-
role_id="
|
|
1272
|
+
organization_id="organization_id",
|
|
1273
|
+
user_id="user_id",
|
|
1274
|
+
user_organization_role_create_organization_id="organization_id",
|
|
1275
|
+
role_id="role_id",
|
|
1207
1276
|
)
|
|
1208
1277
|
"""
|
|
1209
1278
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1246,8 +1315,8 @@ class AsyncOrganizationsClient:
|
|
|
1246
1315
|
token="YOUR_TOKEN",
|
|
1247
1316
|
)
|
|
1248
1317
|
await client.organizations.list_projects_by_user(
|
|
1249
|
-
organization_id="
|
|
1250
|
-
user_id="
|
|
1318
|
+
organization_id="organization_id",
|
|
1319
|
+
user_id="user_id",
|
|
1251
1320
|
)
|
|
1252
1321
|
"""
|
|
1253
1322
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1286,9 +1355,9 @@ class AsyncOrganizationsClient:
|
|
|
1286
1355
|
token="YOUR_TOKEN",
|
|
1287
1356
|
)
|
|
1288
1357
|
await client.organizations.add_user_to_project(
|
|
1289
|
-
organization_id="
|
|
1290
|
-
user_id="
|
|
1291
|
-
project_id="
|
|
1358
|
+
organization_id="organization_id",
|
|
1359
|
+
user_id="user_id",
|
|
1360
|
+
project_id="project_id",
|
|
1292
1361
|
)
|
|
1293
1362
|
"""
|
|
1294
1363
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1328,9 +1397,9 @@ class AsyncOrganizationsClient:
|
|
|
1328
1397
|
token="YOUR_TOKEN",
|
|
1329
1398
|
)
|
|
1330
1399
|
await client.organizations.remove_user_from_project(
|
|
1331
|
-
organization_id="
|
|
1332
|
-
user_id="
|
|
1333
|
-
project_id="
|
|
1400
|
+
organization_id="organization_id",
|
|
1401
|
+
user_id="user_id",
|
|
1402
|
+
project_id="project_id",
|
|
1334
1403
|
)
|
|
1335
1404
|
"""
|
|
1336
1405
|
_response = await self._client_wrapper.httpx_client.request(
|