llama-cloud 0.0.4__py3-none-any.whl → 0.0.5__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 CHANGED
@@ -1,7 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from .types import (
4
- ApiKey,
5
4
  AzureOpenAiEmbedding,
6
5
  Base,
7
6
  BasePromptTemplate,
@@ -135,12 +134,9 @@ from .resources import (
135
134
  DataSourceUpdateCustomMetadataValue,
136
135
  FileCreateResourceInfoValue,
137
136
  PipelineFileUpdateCustomMetadataValue,
138
- api_keys,
139
- billing,
140
137
  component_definitions,
141
138
  data_sinks,
142
139
  data_sources,
143
- deprecated,
144
140
  evals,
145
141
  files,
146
142
  parsing,
@@ -150,7 +146,6 @@ from .resources import (
150
146
  from .environment import LlamaCloudEnvironment
151
147
 
152
148
  __all__ = [
153
- "ApiKey",
154
149
  "AzureOpenAiEmbedding",
155
150
  "Base",
156
151
  "BasePromptTemplate",
@@ -283,12 +278,9 @@ __all__ = [
283
278
  "UnprocessableEntityError",
284
279
  "ValidationError",
285
280
  "ValidationErrorLocItem",
286
- "api_keys",
287
- "billing",
288
281
  "component_definitions",
289
282
  "data_sinks",
290
283
  "data_sources",
291
- "deprecated",
292
284
  "evals",
293
285
  "files",
294
286
  "parsing",
llama_cloud/client.py CHANGED
@@ -6,12 +6,9 @@ import httpx
6
6
 
7
7
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
8
  from .environment import LlamaCloudEnvironment
9
- from .resources.api_keys.client import ApiKeysClient, AsyncApiKeysClient
10
- from .resources.billing.client import AsyncBillingClient, BillingClient
11
9
  from .resources.component_definitions.client import AsyncComponentDefinitionsClient, ComponentDefinitionsClient
12
10
  from .resources.data_sinks.client import AsyncDataSinksClient, DataSinksClient
13
11
  from .resources.data_sources.client import AsyncDataSourcesClient, DataSourcesClient
14
- from .resources.deprecated.client import AsyncDeprecatedClient, DeprecatedClient
15
12
  from .resources.evals.client import AsyncEvalsClient, EvalsClient
16
13
  from .resources.files.client import AsyncFilesClient, FilesClient
17
14
  from .resources.parsing.client import AsyncParsingClient, ParsingClient
@@ -34,7 +31,6 @@ class LlamaCloud:
34
31
  token=token,
35
32
  httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
36
33
  )
37
- self.api_keys = ApiKeysClient(client_wrapper=self._client_wrapper)
38
34
  self.data_sinks = DataSinksClient(client_wrapper=self._client_wrapper)
39
35
  self.data_sources = DataSourcesClient(client_wrapper=self._client_wrapper)
40
36
  self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
@@ -43,8 +39,6 @@ class LlamaCloud:
43
39
  self.evals = EvalsClient(client_wrapper=self._client_wrapper)
44
40
  self.parsing = ParsingClient(client_wrapper=self._client_wrapper)
45
41
  self.component_definitions = ComponentDefinitionsClient(client_wrapper=self._client_wrapper)
46
- self.billing = BillingClient(client_wrapper=self._client_wrapper)
47
- self.deprecated = DeprecatedClient(client_wrapper=self._client_wrapper)
48
42
 
49
43
 
50
44
  class AsyncLlamaCloud:
@@ -62,7 +56,6 @@ class AsyncLlamaCloud:
62
56
  token=token,
63
57
  httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
64
58
  )
65
- self.api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper)
66
59
  self.data_sinks = AsyncDataSinksClient(client_wrapper=self._client_wrapper)
67
60
  self.data_sources = AsyncDataSourcesClient(client_wrapper=self._client_wrapper)
68
61
  self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
@@ -71,8 +64,6 @@ class AsyncLlamaCloud:
71
64
  self.evals = AsyncEvalsClient(client_wrapper=self._client_wrapper)
72
65
  self.parsing = AsyncParsingClient(client_wrapper=self._client_wrapper)
73
66
  self.component_definitions = AsyncComponentDefinitionsClient(client_wrapper=self._client_wrapper)
74
- self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper)
75
- self.deprecated = AsyncDeprecatedClient(client_wrapper=self._client_wrapper)
76
67
 
77
68
 
78
69
  def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LlamaCloudEnvironment) -> str:
@@ -1,18 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from . import (
4
- api_keys,
5
- billing,
6
- component_definitions,
7
- data_sinks,
8
- data_sources,
9
- deprecated,
10
- evals,
11
- files,
12
- parsing,
13
- pipelines,
14
- projects,
15
- )
3
+ from . import component_definitions, data_sinks, data_sources, evals, files, parsing, pipelines, projects
16
4
  from .data_sinks import DataSinkUpdateComponent, DataSinkUpdateComponentOne
17
5
  from .data_sources import DataSourceUpdateComponent, DataSourceUpdateComponentOne, DataSourceUpdateCustomMetadataValue
18
6
  from .files import FileCreateResourceInfoValue
@@ -26,12 +14,9 @@ __all__ = [
26
14
  "DataSourceUpdateCustomMetadataValue",
27
15
  "FileCreateResourceInfoValue",
28
16
  "PipelineFileUpdateCustomMetadataValue",
29
- "api_keys",
30
- "billing",
31
17
  "component_definitions",
32
18
  "data_sinks",
33
19
  "data_sources",
34
- "deprecated",
35
20
  "evals",
36
21
  "files",
37
22
  "parsing",
@@ -1,6 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from .api_key import ApiKey
4
3
  from .azure_open_ai_embedding import AzureOpenAiEmbedding
5
4
  from .base import Base
6
5
  from .base_prompt_template import BasePromptTemplate
@@ -126,7 +125,6 @@ from .validation_error import ValidationError
126
125
  from .validation_error_loc_item import ValidationErrorLocItem
127
126
 
128
127
  __all__ = [
129
- "ApiKey",
130
128
  "AzureOpenAiEmbedding",
131
129
  "Base",
132
130
  "BasePromptTemplate",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-cloud
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary:
5
5
  Author: Logan Markewich
6
6
  Author-email: logan@runllama.ai
@@ -1,5 +1,5 @@
1
- llama_cloud/__init__.py,sha256=BDB7m9sri6qJ-YAgZvVpkoNzNSwbi7HV0B_EsFR7yuA,7637
2
- llama_cloud/client.py,sha256=fUWVDi0mykQO1qc22RGMeO5x2ffAjIqUrLWlfPCZcco,4485
1
+ llama_cloud/__init__.py,sha256=TyV-luF_NMB-tDeO2bHNSaSm_1Uw3R2eY8AhaT_gPUM,7519
2
+ llama_cloud/client.py,sha256=zteEQ5dmzOW5mgEqQ-i9PBh01Ocx0LIN6jxHPy9CBlI,3786
3
3
  llama_cloud/core/__init__.py,sha256=QJS3CJ2TYP2E1Tge0CS6Z7r8LTNzJHQVX1hD3558eP0,519
4
4
  llama_cloud/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
5
5
  llama_cloud/core/client_wrapper.py,sha256=xmj0jCdQ0ySzbSqHUWOkpRRy069y74I_HuXkWltcsVM,1507
@@ -9,11 +9,7 @@ llama_cloud/core/remove_none_from_dict.py,sha256=8m91FC3YuVem0Gm9_sXhJ2tGvP33owJ
9
9
  llama_cloud/environment.py,sha256=q4q-uY5WgcSlzfHwEANOqFQPu0lstqvMnVOsSfifMKo,168
10
10
  llama_cloud/errors/__init__.py,sha256=pbbVUFtB9LCocA1RMWMMF_RKjsy5YkOKX5BAuE49w6g,170
11
11
  llama_cloud/errors/unprocessable_entity_error.py,sha256=FvR7XPlV3Xx5nu8HNlmLhBRdk4so_gCHjYT5PyZe6sM,313
12
- llama_cloud/resources/__init__.py,sha256=oNfkOfXcF9JLlasW7zdX5eo3KNrfzgpfQlCpeyS8Gnw,1016
13
- llama_cloud/resources/api_keys/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
14
- llama_cloud/resources/api_keys/client.py,sha256=dkljKgBir4voTeesRNL_fgSjRplLTx2hianMVRdoDNM,11324
15
- llama_cloud/resources/billing/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
16
- llama_cloud/resources/billing/client.py,sha256=a_OLt7rkyRbPT1ruhgdVaMN_jDEq1zlP1oNgj6pZcQg,9214
12
+ llama_cloud/resources/__init__.py,sha256=CZM0cBk0JjOYkzt1OIl9iQzVBQmD4KuWJsIhrf6BMW0,887
17
13
  llama_cloud/resources/component_definitions/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
18
14
  llama_cloud/resources/component_definitions/client.py,sha256=-Hv7W64P59flEf8osaG6L8CoyuJWDfUQh6zPR-nFvmI,7649
19
15
  llama_cloud/resources/data_sinks/__init__.py,sha256=nsMEyxkVilxvQGSdJi0Z0yKZoTaTWewZIGJNoMwNDsw,205
@@ -27,8 +23,6 @@ llama_cloud/resources/data_sources/types/__init__.py,sha256=iOdDXvAM6w80PR62JCsc
27
23
  llama_cloud/resources/data_sources/types/data_source_update_component.py,sha256=8MoJgdjYmN5WqntDpMXX34WJsf-Wsn0gYw_0t9SOTTA,257
28
24
  llama_cloud/resources/data_sources/types/data_source_update_component_one.py,sha256=jfHjlwkUonW0Z73XhJ3w0BZpmptuXU205FWXS1Ucf44,742
29
25
  llama_cloud/resources/data_sources/types/data_source_update_custom_metadata_value.py,sha256=3aFC-p8MSxjhOu2nFtqk0pixj6RqNqcFnbOYngUdZUk,215
30
- llama_cloud/resources/deprecated/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
31
- llama_cloud/resources/deprecated/client.py,sha256=MFw6I2CDLOVg2TQslkXHQ-vx3WKMt5s7sNkIWrOtuvE,36084
32
26
  llama_cloud/resources/evals/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
33
27
  llama_cloud/resources/evals/client.py,sha256=mIgyzUj74Ia1YYEenGtpFEAJuFrgm6g_c3JfoJg4Zuk,27607
34
28
  llama_cloud/resources/files/__init__.py,sha256=aZpyTj6KpZvA5XVwmuo1sIlRs7ba98btxVBZ6j5vIsI,155
@@ -43,8 +37,7 @@ llama_cloud/resources/pipelines/types/__init__.py,sha256=xuT4OBPLrRfEe-E3UVdJvRj
43
37
  llama_cloud/resources/pipelines/types/pipeline_file_update_custom_metadata_value.py,sha256=trI48WLxPcAqV9207Q6-3cj1nl4EGlZpw7En56ZsPgg,217
44
38
  llama_cloud/resources/projects/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
45
39
  llama_cloud/resources/projects/client.py,sha256=gqjSRfpNK8rxECpHGluiTLxF8qGX2LvNIPJNujfNQ9E,46742
46
- llama_cloud/types/__init__.py,sha256=xKnYxctZU1sCSVv6_GNg4w6t_o9vJIBTcD9Lqgu32Ts,10347
47
- llama_cloud/types/api_key.py,sha256=QGEPX-kwPh9n4OU4ujUvTWzItdqbeUa9Wu8XhDE0sXY,1309
40
+ llama_cloud/types/__init__.py,sha256=0cs8VGx_F_KBLMju1wnOVlvT5O3VGKNzybKL9e1nKb0,10305
48
41
  llama_cloud/types/azure_open_ai_embedding.py,sha256=Ne7DkOTpdwGsH2DUVIGdT5T8Nmk6J61lHGbmgG90LuY,3438
49
42
  llama_cloud/types/base.py,sha256=cn_Zn61yLMDCMm1iZTPvKILSRlqRzOqZtSYyYBY5dIE,938
50
43
  llama_cloud/types/base_prompt_template.py,sha256=GO9k4EDVMf3gRQIA4bVfXqgIMKnKTXhi1JlGvhqXDRY,1576
@@ -168,7 +161,7 @@ llama_cloud/types/token_text_splitter.py,sha256=Mv8xBCvMXyYuQq1KInPe65O0YYCLWxs6
168
161
  llama_cloud/types/transformation_category_names.py,sha256=0xjYe-mDW9OKbTGqL5fSbTvqsfrG4LDu_stW_ubVLl4,582
169
162
  llama_cloud/types/validation_error.py,sha256=yZDLtjUHDY5w82Ra6CW0H9sLAr18R0RY1UNgJKR72DQ,1084
170
163
  llama_cloud/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
171
- llama_cloud-0.0.4.dist-info/LICENSE,sha256=_iNqtPcw1Ue7dZKwOwgPtbegMUkWVy15hC7bffAdNmY,1067
172
- llama_cloud-0.0.4.dist-info/METADATA,sha256=_L441YyRrbj40pz0fbw5kKqLwJIREbr5zVB7K5rAttA,750
173
- llama_cloud-0.0.4.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
174
- llama_cloud-0.0.4.dist-info/RECORD,,
164
+ llama_cloud-0.0.5.dist-info/LICENSE,sha256=_iNqtPcw1Ue7dZKwOwgPtbegMUkWVy15hC7bffAdNmY,1067
165
+ llama_cloud-0.0.5.dist-info/METADATA,sha256=pkFLMMAVCJ02bq71qKh3TTWjL_7gcVR6HwVsMEzvceQ,750
166
+ llama_cloud-0.0.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
167
+ llama_cloud-0.0.5.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
@@ -1,297 +0,0 @@
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 ...errors.unprocessable_entity_error import UnprocessableEntityError
11
- from ...types.api_key import ApiKey
12
- from ...types.http_validation_error import HttpValidationError
13
-
14
- try:
15
- import pydantic
16
- if pydantic.__version__.startswith("1."):
17
- raise ImportError
18
- import pydantic.v1 as pydantic # type: ignore
19
- except ImportError:
20
- import pydantic # type: ignore
21
-
22
- # this is used as the default value for optional parameters
23
- OMIT = typing.cast(typing.Any, ...)
24
-
25
-
26
- class ApiKeysClient:
27
- def __init__(self, *, client_wrapper: SyncClientWrapper):
28
- self._client_wrapper = client_wrapper
29
-
30
- def get_keys(self) -> typing.List[ApiKey]:
31
- """
32
- Get all API Keys for a user.
33
-
34
- ---
35
- from llama_cloud.client import LlamaCloud
36
-
37
- client = LlamaCloud(
38
- token="YOUR_TOKEN",
39
- )
40
- client.api_keys.get_keys()
41
- """
42
- _response = self._client_wrapper.httpx_client.request(
43
- "GET",
44
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
45
- headers=self._client_wrapper.get_headers(),
46
- timeout=60,
47
- )
48
- if 200 <= _response.status_code < 300:
49
- return pydantic.parse_obj_as(typing.List[ApiKey], _response.json()) # type: ignore
50
- if _response.status_code == 422:
51
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
52
- try:
53
- _response_json = _response.json()
54
- except JSONDecodeError:
55
- raise ApiError(status_code=_response.status_code, body=_response.text)
56
- raise ApiError(status_code=_response.status_code, body=_response_json)
57
-
58
- def generate_key(self, *, name: typing.Optional[str] = OMIT) -> ApiKey:
59
- """
60
- Generate a new API Key.
61
-
62
- Parameters:
63
- - name: typing.Optional[str].
64
- ---
65
- from llama_cloud.client import LlamaCloud
66
-
67
- client = LlamaCloud(
68
- token="YOUR_TOKEN",
69
- )
70
- client.api_keys.generate_key()
71
- """
72
- _request: typing.Dict[str, typing.Any] = {}
73
- if name is not OMIT:
74
- _request["name"] = name
75
- _response = self._client_wrapper.httpx_client.request(
76
- "POST",
77
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
78
- json=jsonable_encoder(_request),
79
- headers=self._client_wrapper.get_headers(),
80
- timeout=60,
81
- )
82
- if 200 <= _response.status_code < 300:
83
- return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
84
- if _response.status_code == 422:
85
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
86
- try:
87
- _response_json = _response.json()
88
- except JSONDecodeError:
89
- raise ApiError(status_code=_response.status_code, body=_response.text)
90
- raise ApiError(status_code=_response.status_code, body=_response_json)
91
-
92
- def update_existing_api_key(self, api_key_id: str, *, name: typing.Optional[str] = OMIT) -> ApiKey:
93
- """
94
- Update name of an existing API Key.
95
-
96
- Parameters:
97
- - api_key_id: str.
98
-
99
- - name: typing.Optional[str].
100
- ---
101
- from llama_cloud.client import LlamaCloud
102
-
103
- client = LlamaCloud(
104
- token="YOUR_TOKEN",
105
- )
106
- client.api_keys.update_existing_api_key(
107
- api_key_id="string",
108
- )
109
- """
110
- _request: typing.Dict[str, typing.Any] = {}
111
- if name is not OMIT:
112
- _request["name"] = name
113
- _response = self._client_wrapper.httpx_client.request(
114
- "PUT",
115
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
116
- json=jsonable_encoder(_request),
117
- headers=self._client_wrapper.get_headers(),
118
- timeout=60,
119
- )
120
- if 200 <= _response.status_code < 300:
121
- return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
122
- if _response.status_code == 422:
123
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
124
- try:
125
- _response_json = _response.json()
126
- except JSONDecodeError:
127
- raise ApiError(status_code=_response.status_code, body=_response.text)
128
- raise ApiError(status_code=_response.status_code, body=_response_json)
129
-
130
- def delete_api_key(self, api_key_id: str) -> None:
131
- """
132
- Delete an API Key by ID.
133
-
134
- Parameters:
135
- - api_key_id: str.
136
- ---
137
- from llama_cloud.client import LlamaCloud
138
-
139
- client = LlamaCloud(
140
- token="YOUR_TOKEN",
141
- )
142
- client.api_keys.delete_api_key(
143
- api_key_id="string",
144
- )
145
- """
146
- _response = self._client_wrapper.httpx_client.request(
147
- "DELETE",
148
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
149
- headers=self._client_wrapper.get_headers(),
150
- timeout=60,
151
- )
152
- if 200 <= _response.status_code < 300:
153
- return
154
- if _response.status_code == 422:
155
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
156
- try:
157
- _response_json = _response.json()
158
- except JSONDecodeError:
159
- raise ApiError(status_code=_response.status_code, body=_response.text)
160
- raise ApiError(status_code=_response.status_code, body=_response_json)
161
-
162
-
163
- class AsyncApiKeysClient:
164
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
165
- self._client_wrapper = client_wrapper
166
-
167
- async def get_keys(self) -> typing.List[ApiKey]:
168
- """
169
- Get all API Keys for a user.
170
-
171
- ---
172
- from llama_cloud.client import AsyncLlamaCloud
173
-
174
- client = AsyncLlamaCloud(
175
- token="YOUR_TOKEN",
176
- )
177
- await client.api_keys.get_keys()
178
- """
179
- _response = await self._client_wrapper.httpx_client.request(
180
- "GET",
181
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
182
- headers=self._client_wrapper.get_headers(),
183
- timeout=60,
184
- )
185
- if 200 <= _response.status_code < 300:
186
- return pydantic.parse_obj_as(typing.List[ApiKey], _response.json()) # type: ignore
187
- if _response.status_code == 422:
188
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
189
- try:
190
- _response_json = _response.json()
191
- except JSONDecodeError:
192
- raise ApiError(status_code=_response.status_code, body=_response.text)
193
- raise ApiError(status_code=_response.status_code, body=_response_json)
194
-
195
- async def generate_key(self, *, name: typing.Optional[str] = OMIT) -> ApiKey:
196
- """
197
- Generate a new API Key.
198
-
199
- Parameters:
200
- - name: typing.Optional[str].
201
- ---
202
- from llama_cloud.client import AsyncLlamaCloud
203
-
204
- client = AsyncLlamaCloud(
205
- token="YOUR_TOKEN",
206
- )
207
- await client.api_keys.generate_key()
208
- """
209
- _request: typing.Dict[str, typing.Any] = {}
210
- if name is not OMIT:
211
- _request["name"] = name
212
- _response = await self._client_wrapper.httpx_client.request(
213
- "POST",
214
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
215
- json=jsonable_encoder(_request),
216
- headers=self._client_wrapper.get_headers(),
217
- timeout=60,
218
- )
219
- if 200 <= _response.status_code < 300:
220
- return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
221
- if _response.status_code == 422:
222
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
223
- try:
224
- _response_json = _response.json()
225
- except JSONDecodeError:
226
- raise ApiError(status_code=_response.status_code, body=_response.text)
227
- raise ApiError(status_code=_response.status_code, body=_response_json)
228
-
229
- async def update_existing_api_key(self, api_key_id: str, *, name: typing.Optional[str] = OMIT) -> ApiKey:
230
- """
231
- Update name of an existing API Key.
232
-
233
- Parameters:
234
- - api_key_id: str.
235
-
236
- - name: typing.Optional[str].
237
- ---
238
- from llama_cloud.client import AsyncLlamaCloud
239
-
240
- client = AsyncLlamaCloud(
241
- token="YOUR_TOKEN",
242
- )
243
- await client.api_keys.update_existing_api_key(
244
- api_key_id="string",
245
- )
246
- """
247
- _request: typing.Dict[str, typing.Any] = {}
248
- if name is not OMIT:
249
- _request["name"] = name
250
- _response = await self._client_wrapper.httpx_client.request(
251
- "PUT",
252
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
253
- json=jsonable_encoder(_request),
254
- headers=self._client_wrapper.get_headers(),
255
- timeout=60,
256
- )
257
- if 200 <= _response.status_code < 300:
258
- return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
259
- if _response.status_code == 422:
260
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
261
- try:
262
- _response_json = _response.json()
263
- except JSONDecodeError:
264
- raise ApiError(status_code=_response.status_code, body=_response.text)
265
- raise ApiError(status_code=_response.status_code, body=_response_json)
266
-
267
- async def delete_api_key(self, api_key_id: str) -> None:
268
- """
269
- Delete an API Key by ID.
270
-
271
- Parameters:
272
- - api_key_id: str.
273
- ---
274
- from llama_cloud.client import AsyncLlamaCloud
275
-
276
- client = AsyncLlamaCloud(
277
- token="YOUR_TOKEN",
278
- )
279
- await client.api_keys.delete_api_key(
280
- api_key_id="string",
281
- )
282
- """
283
- _response = await self._client_wrapper.httpx_client.request(
284
- "DELETE",
285
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
286
- headers=self._client_wrapper.get_headers(),
287
- timeout=60,
288
- )
289
- if 200 <= _response.status_code < 300:
290
- return
291
- if _response.status_code == 422:
292
- raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
293
- try:
294
- _response_json = _response.json()
295
- except JSONDecodeError:
296
- raise ApiError(status_code=_response.status_code, body=_response.text)
297
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-