llama-cloud 0.1.37__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.

Files changed (37) hide show
  1. llama_cloud/__init__.py +8 -2
  2. llama_cloud/client.py +3 -0
  3. llama_cloud/resources/__init__.py +2 -0
  4. llama_cloud/resources/alpha/__init__.py +2 -0
  5. llama_cloud/resources/alpha/client.py +118 -0
  6. llama_cloud/resources/beta/client.py +126 -30
  7. llama_cloud/resources/chat_apps/client.py +32 -8
  8. llama_cloud/resources/classifier/client.py +139 -11
  9. llama_cloud/resources/data_sinks/client.py +32 -8
  10. llama_cloud/resources/data_sources/client.py +32 -8
  11. llama_cloud/resources/data_sources/types/data_source_update_component.py +2 -0
  12. llama_cloud/resources/embedding_model_configs/client.py +48 -12
  13. llama_cloud/resources/files/client.py +176 -42
  14. llama_cloud/resources/jobs/client.py +12 -6
  15. llama_cloud/resources/llama_extract/client.py +138 -32
  16. llama_cloud/resources/organizations/client.py +18 -4
  17. llama_cloud/resources/parsing/client.py +16 -4
  18. llama_cloud/resources/pipelines/client.py +32 -8
  19. llama_cloud/resources/projects/client.py +78 -18
  20. llama_cloud/resources/reports/client.py +126 -30
  21. llama_cloud/resources/retrievers/client.py +48 -12
  22. llama_cloud/types/__init__.py +6 -2
  23. llama_cloud/types/agent_deployment_summary.py +1 -0
  24. llama_cloud/types/classify_job.py +2 -0
  25. llama_cloud/types/cloud_jira_data_source_v_2.py +52 -0
  26. llama_cloud/types/cloud_jira_data_source_v_2_api_version.py +21 -0
  27. llama_cloud/types/configurable_data_source_names.py +4 -0
  28. llama_cloud/types/data_source_component.py +2 -0
  29. llama_cloud/types/data_source_create_component.py +2 -0
  30. llama_cloud/types/data_source_reader_version_metadata_reader_version.py +9 -1
  31. llama_cloud/types/{classify_job_with_status.py → paginated_response_classify_job.py} +5 -18
  32. llama_cloud/types/pipeline_data_source_component.py +2 -0
  33. llama_cloud/types/usage_response_active_alerts_item.py +4 -0
  34. {llama_cloud-0.1.37.dist-info → llama_cloud-0.1.38.dist-info}/METADATA +2 -3
  35. {llama_cloud-0.1.37.dist-info → llama_cloud-0.1.38.dist-info}/RECORD +37 -33
  36. {llama_cloud-0.1.37.dist-info → llama_cloud-0.1.38.dist-info}/WHEEL +1 -1
  37. {llama_cloud-0.1.37.dist-info → llama_cloud-0.1.38.dist-info}/LICENSE +0 -0
llama_cloud/__init__.py CHANGED
@@ -41,7 +41,6 @@ from .types import (
41
41
  ClassifierRule,
42
42
  ClassifyJob,
43
43
  ClassifyJobResults,
44
- ClassifyJobWithStatus,
45
44
  ClassifyParsingConfiguration,
46
45
  CloudAstraDbVectorStore,
47
46
  CloudAzStorageBlobDataSource,
@@ -51,6 +50,8 @@ from .types import (
51
50
  CloudDocument,
52
51
  CloudDocumentCreate,
53
52
  CloudJiraDataSource,
53
+ CloudJiraDataSourceV2,
54
+ CloudJiraDataSourceV2ApiVersion,
54
55
  CloudMilvusVectorStore,
55
56
  CloudMongoDbAtlasVectorSearch,
56
57
  CloudNotionPageDataSource,
@@ -235,6 +236,7 @@ from .types import (
235
236
  PaginatedReportResponse,
236
237
  PaginatedResponseAgentData,
237
238
  PaginatedResponseAggregateGroup,
239
+ PaginatedResponseClassifyJob,
238
240
  PaginatedResponseQuotaConfiguration,
239
241
  ParseJobConfig,
240
242
  ParseJobConfigPriority,
@@ -413,6 +415,7 @@ from .resources import (
413
415
  UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction,
414
416
  admin,
415
417
  agent_deployments,
418
+ alpha,
416
419
  beta,
417
420
  chat_apps,
418
421
  classifier,
@@ -474,7 +477,6 @@ __all__ = [
474
477
  "ClassifierRule",
475
478
  "ClassifyJob",
476
479
  "ClassifyJobResults",
477
- "ClassifyJobWithStatus",
478
480
  "ClassifyParsingConfiguration",
479
481
  "CloudAstraDbVectorStore",
480
482
  "CloudAzStorageBlobDataSource",
@@ -484,6 +486,8 @@ __all__ = [
484
486
  "CloudDocument",
485
487
  "CloudDocumentCreate",
486
488
  "CloudJiraDataSource",
489
+ "CloudJiraDataSourceV2",
490
+ "CloudJiraDataSourceV2ApiVersion",
487
491
  "CloudMilvusVectorStore",
488
492
  "CloudMongoDbAtlasVectorSearch",
489
493
  "CloudNotionPageDataSource",
@@ -691,6 +695,7 @@ __all__ = [
691
695
  "PaginatedReportResponse",
692
696
  "PaginatedResponseAgentData",
693
697
  "PaginatedResponseAggregateGroup",
698
+ "PaginatedResponseClassifyJob",
694
699
  "PaginatedResponseQuotaConfiguration",
695
700
  "ParseJobConfig",
696
701
  "ParseJobConfigPriority",
@@ -845,6 +850,7 @@ __all__ = [
845
850
  "WebhookConfigurationWebhookEventsItem",
846
851
  "admin",
847
852
  "agent_deployments",
853
+ "alpha",
848
854
  "beta",
849
855
  "chat_apps",
850
856
  "classifier",
llama_cloud/client.py CHANGED
@@ -8,6 +8,7 @@ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
8
  from .environment import LlamaCloudEnvironment
9
9
  from .resources.admin.client import AdminClient, AsyncAdminClient
10
10
  from .resources.agent_deployments.client import AgentDeploymentsClient, AsyncAgentDeploymentsClient
11
+ from .resources.alpha.client import AlphaClient, AsyncAlphaClient
11
12
  from .resources.beta.client import AsyncBetaClient, BetaClient
12
13
  from .resources.chat_apps.client import AsyncChatAppsClient, ChatAppsClient
13
14
  from .resources.classifier.client import AsyncClassifierClient, ClassifierClient
@@ -61,6 +62,7 @@ class LlamaCloud:
61
62
  self.llama_extract = LlamaExtractClient(client_wrapper=self._client_wrapper)
62
63
  self.reports = ReportsClient(client_wrapper=self._client_wrapper)
63
64
  self.beta = BetaClient(client_wrapper=self._client_wrapper)
65
+ self.alpha = AlphaClient(client_wrapper=self._client_wrapper)
64
66
 
65
67
 
66
68
  class AsyncLlamaCloud:
@@ -97,6 +99,7 @@ class AsyncLlamaCloud:
97
99
  self.llama_extract = AsyncLlamaExtractClient(client_wrapper=self._client_wrapper)
98
100
  self.reports = AsyncReportsClient(client_wrapper=self._client_wrapper)
99
101
  self.beta = AsyncBetaClient(client_wrapper=self._client_wrapper)
102
+ self.alpha = AsyncAlphaClient(client_wrapper=self._client_wrapper)
100
103
 
101
104
 
102
105
  def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LlamaCloudEnvironment) -> str:
@@ -3,6 +3,7 @@
3
3
  from . import (
4
4
  admin,
5
5
  agent_deployments,
6
+ alpha,
6
7
  beta,
7
8
  chat_apps,
8
9
  classifier,
@@ -98,6 +99,7 @@ __all__ = [
98
99
  "UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction",
99
100
  "admin",
100
101
  "agent_deployments",
102
+ "alpha",
101
103
  "beta",
102
104
  "chat_apps",
103
105
  "classifier",
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,118 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ import urllib.parse
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.jsonable_encoder import jsonable_encoder
10
+ from ...core.remove_none_from_dict import remove_none_from_dict
11
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
12
+ from ...types.http_validation_error import HttpValidationError
13
+ from ...types.parsing_job import ParsingJob
14
+
15
+ try:
16
+ import pydantic
17
+ if pydantic.__version__.startswith("1."):
18
+ raise ImportError
19
+ import pydantic.v1 as pydantic # type: ignore
20
+ except ImportError:
21
+ import pydantic # type: ignore
22
+
23
+ # this is used as the default value for optional parameters
24
+ OMIT = typing.cast(typing.Any, ...)
25
+
26
+
27
+ class AlphaClient:
28
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
29
+ self._client_wrapper = client_wrapper
30
+
31
+ def upload_file_v_2(
32
+ self,
33
+ *,
34
+ project_id: typing.Optional[str] = None,
35
+ organization_id: typing.Optional[str] = None,
36
+ configuration: str,
37
+ file: typing.Optional[str] = OMIT,
38
+ project_id: typing.Optional[str] = None,
39
+ ) -> ParsingJob:
40
+ """
41
+ Parameters:
42
+ - project_id: typing.Optional[str].
43
+
44
+ - organization_id: typing.Optional[str].
45
+
46
+ - configuration: str.
47
+
48
+ - file: typing.Optional[str].
49
+
50
+ - project_id: typing.Optional[str].
51
+ """
52
+ _request: typing.Dict[str, typing.Any] = {"configuration": configuration}
53
+ if file is not OMIT:
54
+ _request["file"] = file
55
+ _response = self._client_wrapper.httpx_client.request(
56
+ "POST",
57
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v2alpha1/parse/upload"),
58
+ params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
59
+ json=jsonable_encoder(_request),
60
+ headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
61
+ timeout=60,
62
+ )
63
+ if 200 <= _response.status_code < 300:
64
+ return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
65
+ if _response.status_code == 422:
66
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
67
+ try:
68
+ _response_json = _response.json()
69
+ except JSONDecodeError:
70
+ raise ApiError(status_code=_response.status_code, body=_response.text)
71
+ raise ApiError(status_code=_response.status_code, body=_response_json)
72
+
73
+
74
+ class AsyncAlphaClient:
75
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
76
+ self._client_wrapper = client_wrapper
77
+
78
+ async def upload_file_v_2(
79
+ self,
80
+ *,
81
+ project_id: typing.Optional[str] = None,
82
+ organization_id: typing.Optional[str] = None,
83
+ configuration: str,
84
+ file: typing.Optional[str] = OMIT,
85
+ project_id: typing.Optional[str] = None,
86
+ ) -> ParsingJob:
87
+ """
88
+ Parameters:
89
+ - project_id: typing.Optional[str].
90
+
91
+ - organization_id: typing.Optional[str].
92
+
93
+ - configuration: str.
94
+
95
+ - file: typing.Optional[str].
96
+
97
+ - project_id: typing.Optional[str].
98
+ """
99
+ _request: typing.Dict[str, typing.Any] = {"configuration": configuration}
100
+ if file is not OMIT:
101
+ _request["file"] = file
102
+ _response = await self._client_wrapper.httpx_client.request(
103
+ "POST",
104
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v2alpha1/parse/upload"),
105
+ params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
106
+ json=jsonable_encoder(_request),
107
+ headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "Project-Id": project_id}),
108
+ timeout=60,
109
+ )
110
+ if 200 <= _response.status_code < 300:
111
+ return pydantic.parse_obj_as(ParsingJob, _response.json()) # type: ignore
112
+ if _response.status_code == 422:
113
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
114
+ try:
115
+ _response_json = _response.json()
116
+ except JSONDecodeError:
117
+ raise ApiError(status_code=_response.status_code, body=_response.text)
118
+ raise ApiError(status_code=_response.status_code, body=_response_json)