llama-cloud 0.1.30__py3-none-any.whl → 0.1.32__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 +26 -14
- llama_cloud/client.py +0 -3
- llama_cloud/resources/__init__.py +0 -2
- llama_cloud/resources/beta/client.py +602 -0
- llama_cloud/resources/organizations/client.py +2 -2
- llama_cloud/resources/parsing/client.py +8 -0
- llama_cloud/resources/pipelines/client.py +64 -0
- llama_cloud/types/__init__.py +26 -12
- llama_cloud/types/{model_configuration.py → agent_data.py} +8 -7
- llama_cloud/types/agent_deployment_summary.py +1 -1
- llama_cloud/types/{message.py → aggregate_group.py} +8 -9
- llama_cloud/types/base_plan.py +3 -0
- llama_cloud/types/extract_mode.py +0 -4
- llama_cloud/types/filter_operation.py +46 -0
- llama_cloud/types/filter_operation_eq.py +6 -0
- llama_cloud/types/filter_operation_gt.py +6 -0
- llama_cloud/types/filter_operation_gte.py +6 -0
- llama_cloud/types/filter_operation_includes_item.py +6 -0
- llama_cloud/types/filter_operation_lt.py +6 -0
- llama_cloud/types/filter_operation_lte.py +6 -0
- llama_cloud/types/input_message.py +2 -2
- llama_cloud/types/legacy_parse_job_config.py +3 -0
- llama_cloud/types/llama_index_core_base_llms_types_chat_message.py +2 -2
- llama_cloud/types/llama_parse_parameters.py +1 -0
- llama_cloud/types/{llama_index_core_base_llms_types_message_role.py → message_role.py} +9 -9
- llama_cloud/types/{text_content_block.py → paginated_response_agent_data.py} +5 -5
- llama_cloud/types/paginated_response_aggregate_group.py +34 -0
- llama_cloud/types/parse_job_config.py +1 -0
- llama_cloud/types/playground_session.py +2 -2
- llama_cloud/types/role.py +0 -1
- llama_cloud/types/{app_schema_chat_chat_message.py → src_app_schema_chat_chat_message.py} +3 -3
- llama_cloud/types/user_organization_role.py +0 -1
- {llama_cloud-0.1.30.dist-info → llama_cloud-0.1.32.dist-info}/METADATA +1 -1
- {llama_cloud-0.1.30.dist-info → llama_cloud-0.1.32.dist-info}/RECORD +36 -31
- llama_cloud/resources/responses/__init__.py +0 -2
- llama_cloud/resources/responses/client.py +0 -137
- llama_cloud/types/app_schema_responses_message_role.py +0 -33
- {llama_cloud-0.1.30.dist-info → llama_cloud-0.1.32.dist-info}/LICENSE +0 -0
- {llama_cloud-0.1.30.dist-info → llama_cloud-0.1.32.dist-info}/WHEEL +0 -0
|
@@ -9,11 +9,15 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
9
9
|
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
|
+
from ...types.agent_data import AgentData
|
|
12
13
|
from ...types.batch import Batch
|
|
13
14
|
from ...types.batch_paginated_list import BatchPaginatedList
|
|
14
15
|
from ...types.batch_public_output import BatchPublicOutput
|
|
16
|
+
from ...types.filter_operation import FilterOperation
|
|
15
17
|
from ...types.http_validation_error import HttpValidationError
|
|
16
18
|
from ...types.llama_parse_parameters import LlamaParseParameters
|
|
19
|
+
from ...types.paginated_response_agent_data import PaginatedResponseAgentData
|
|
20
|
+
from ...types.paginated_response_aggregate_group import PaginatedResponseAggregateGroup
|
|
17
21
|
|
|
18
22
|
try:
|
|
19
23
|
import pydantic
|
|
@@ -204,6 +208,305 @@ class BetaClient:
|
|
|
204
208
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
205
209
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
206
210
|
|
|
211
|
+
def get_agent_data(self, item_id: str) -> AgentData:
|
|
212
|
+
"""
|
|
213
|
+
Get agent data by ID.
|
|
214
|
+
|
|
215
|
+
Parameters:
|
|
216
|
+
- item_id: str.
|
|
217
|
+
---
|
|
218
|
+
from llama_cloud.client import LlamaCloud
|
|
219
|
+
|
|
220
|
+
client = LlamaCloud(
|
|
221
|
+
token="YOUR_TOKEN",
|
|
222
|
+
)
|
|
223
|
+
client.beta.get_agent_data(
|
|
224
|
+
item_id="string",
|
|
225
|
+
)
|
|
226
|
+
"""
|
|
227
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
228
|
+
"GET",
|
|
229
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
230
|
+
headers=self._client_wrapper.get_headers(),
|
|
231
|
+
timeout=60,
|
|
232
|
+
)
|
|
233
|
+
if 200 <= _response.status_code < 300:
|
|
234
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
235
|
+
if _response.status_code == 422:
|
|
236
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
237
|
+
try:
|
|
238
|
+
_response_json = _response.json()
|
|
239
|
+
except JSONDecodeError:
|
|
240
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
241
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
242
|
+
|
|
243
|
+
def update_agent_data(self, item_id: str, *, data: typing.Dict[str, typing.Any]) -> AgentData:
|
|
244
|
+
"""
|
|
245
|
+
Update agent data by ID (overwrites).
|
|
246
|
+
|
|
247
|
+
Parameters:
|
|
248
|
+
- item_id: str.
|
|
249
|
+
|
|
250
|
+
- data: typing.Dict[str, typing.Any].
|
|
251
|
+
---
|
|
252
|
+
from llama_cloud.client import LlamaCloud
|
|
253
|
+
|
|
254
|
+
client = LlamaCloud(
|
|
255
|
+
token="YOUR_TOKEN",
|
|
256
|
+
)
|
|
257
|
+
client.beta.update_agent_data(
|
|
258
|
+
item_id="string",
|
|
259
|
+
data={"string": {}},
|
|
260
|
+
)
|
|
261
|
+
"""
|
|
262
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
263
|
+
"PUT",
|
|
264
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
265
|
+
json=jsonable_encoder({"data": data}),
|
|
266
|
+
headers=self._client_wrapper.get_headers(),
|
|
267
|
+
timeout=60,
|
|
268
|
+
)
|
|
269
|
+
if 200 <= _response.status_code < 300:
|
|
270
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
271
|
+
if _response.status_code == 422:
|
|
272
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
273
|
+
try:
|
|
274
|
+
_response_json = _response.json()
|
|
275
|
+
except JSONDecodeError:
|
|
276
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
277
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
278
|
+
|
|
279
|
+
def delete_agent_data(self, item_id: str) -> typing.Dict[str, str]:
|
|
280
|
+
"""
|
|
281
|
+
Delete agent data by ID.
|
|
282
|
+
|
|
283
|
+
Parameters:
|
|
284
|
+
- item_id: str.
|
|
285
|
+
---
|
|
286
|
+
from llama_cloud.client import LlamaCloud
|
|
287
|
+
|
|
288
|
+
client = LlamaCloud(
|
|
289
|
+
token="YOUR_TOKEN",
|
|
290
|
+
)
|
|
291
|
+
client.beta.delete_agent_data(
|
|
292
|
+
item_id="string",
|
|
293
|
+
)
|
|
294
|
+
"""
|
|
295
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
296
|
+
"DELETE",
|
|
297
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
298
|
+
headers=self._client_wrapper.get_headers(),
|
|
299
|
+
timeout=60,
|
|
300
|
+
)
|
|
301
|
+
if 200 <= _response.status_code < 300:
|
|
302
|
+
return pydantic.parse_obj_as(typing.Dict[str, str], _response.json()) # type: ignore
|
|
303
|
+
if _response.status_code == 422:
|
|
304
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
305
|
+
try:
|
|
306
|
+
_response_json = _response.json()
|
|
307
|
+
except JSONDecodeError:
|
|
308
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
309
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
310
|
+
|
|
311
|
+
def create_agent_data_api_v_1_beta_agent_data_post(
|
|
312
|
+
self, *, agent_slug: str, collection: typing.Optional[str] = OMIT, data: typing.Dict[str, typing.Any]
|
|
313
|
+
) -> AgentData:
|
|
314
|
+
"""
|
|
315
|
+
Create new agent data.
|
|
316
|
+
|
|
317
|
+
Parameters:
|
|
318
|
+
- agent_slug: str.
|
|
319
|
+
|
|
320
|
+
- collection: typing.Optional[str].
|
|
321
|
+
|
|
322
|
+
- data: typing.Dict[str, typing.Any].
|
|
323
|
+
---
|
|
324
|
+
from llama_cloud.client import LlamaCloud
|
|
325
|
+
|
|
326
|
+
client = LlamaCloud(
|
|
327
|
+
token="YOUR_TOKEN",
|
|
328
|
+
)
|
|
329
|
+
client.beta.create_agent_data_api_v_1_beta_agent_data_post(
|
|
330
|
+
agent_slug="string",
|
|
331
|
+
data={"string": {}},
|
|
332
|
+
)
|
|
333
|
+
"""
|
|
334
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug, "data": data}
|
|
335
|
+
if collection is not OMIT:
|
|
336
|
+
_request["collection"] = collection
|
|
337
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
338
|
+
"POST",
|
|
339
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data"),
|
|
340
|
+
json=jsonable_encoder(_request),
|
|
341
|
+
headers=self._client_wrapper.get_headers(),
|
|
342
|
+
timeout=60,
|
|
343
|
+
)
|
|
344
|
+
if 200 <= _response.status_code < 300:
|
|
345
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
346
|
+
if _response.status_code == 422:
|
|
347
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
348
|
+
try:
|
|
349
|
+
_response_json = _response.json()
|
|
350
|
+
except JSONDecodeError:
|
|
351
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
352
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
353
|
+
|
|
354
|
+
def search_agent_data_api_v_1_beta_agent_data_search_post(
|
|
355
|
+
self,
|
|
356
|
+
*,
|
|
357
|
+
page_size: typing.Optional[int] = OMIT,
|
|
358
|
+
page_token: typing.Optional[str] = OMIT,
|
|
359
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]] = OMIT,
|
|
360
|
+
order_by: typing.Optional[str] = OMIT,
|
|
361
|
+
agent_slug: str,
|
|
362
|
+
collection: typing.Optional[str] = OMIT,
|
|
363
|
+
include_total: typing.Optional[bool] = OMIT,
|
|
364
|
+
offset: typing.Optional[int] = OMIT,
|
|
365
|
+
) -> PaginatedResponseAgentData:
|
|
366
|
+
"""
|
|
367
|
+
Search agent data with filtering, sorting, and pagination.
|
|
368
|
+
|
|
369
|
+
Parameters:
|
|
370
|
+
- page_size: typing.Optional[int].
|
|
371
|
+
|
|
372
|
+
- page_token: typing.Optional[str].
|
|
373
|
+
|
|
374
|
+
- filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
|
|
375
|
+
|
|
376
|
+
- order_by: typing.Optional[str].
|
|
377
|
+
|
|
378
|
+
- agent_slug: str. The agent deployment's agent_slug to search within
|
|
379
|
+
|
|
380
|
+
- collection: typing.Optional[str]. The logical agent data collection to search within
|
|
381
|
+
|
|
382
|
+
- include_total: typing.Optional[bool]. Whether to include the total number of items in the response
|
|
383
|
+
|
|
384
|
+
- offset: typing.Optional[int].
|
|
385
|
+
---
|
|
386
|
+
from llama_cloud.client import LlamaCloud
|
|
387
|
+
|
|
388
|
+
client = LlamaCloud(
|
|
389
|
+
token="YOUR_TOKEN",
|
|
390
|
+
)
|
|
391
|
+
client.beta.search_agent_data_api_v_1_beta_agent_data_search_post(
|
|
392
|
+
agent_slug="string",
|
|
393
|
+
)
|
|
394
|
+
"""
|
|
395
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug}
|
|
396
|
+
if page_size is not OMIT:
|
|
397
|
+
_request["page_size"] = page_size
|
|
398
|
+
if page_token is not OMIT:
|
|
399
|
+
_request["page_token"] = page_token
|
|
400
|
+
if filter is not OMIT:
|
|
401
|
+
_request["filter"] = filter
|
|
402
|
+
if order_by is not OMIT:
|
|
403
|
+
_request["order_by"] = order_by
|
|
404
|
+
if collection is not OMIT:
|
|
405
|
+
_request["collection"] = collection
|
|
406
|
+
if include_total is not OMIT:
|
|
407
|
+
_request["include_total"] = include_total
|
|
408
|
+
if offset is not OMIT:
|
|
409
|
+
_request["offset"] = offset
|
|
410
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
411
|
+
"POST",
|
|
412
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data/:search"),
|
|
413
|
+
json=jsonable_encoder(_request),
|
|
414
|
+
headers=self._client_wrapper.get_headers(),
|
|
415
|
+
timeout=60,
|
|
416
|
+
)
|
|
417
|
+
if 200 <= _response.status_code < 300:
|
|
418
|
+
return pydantic.parse_obj_as(PaginatedResponseAgentData, _response.json()) # type: ignore
|
|
419
|
+
if _response.status_code == 422:
|
|
420
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
421
|
+
try:
|
|
422
|
+
_response_json = _response.json()
|
|
423
|
+
except JSONDecodeError:
|
|
424
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
425
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
426
|
+
|
|
427
|
+
def aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
|
|
428
|
+
self,
|
|
429
|
+
*,
|
|
430
|
+
page_size: typing.Optional[int] = OMIT,
|
|
431
|
+
page_token: typing.Optional[str] = OMIT,
|
|
432
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]] = OMIT,
|
|
433
|
+
order_by: typing.Optional[str] = OMIT,
|
|
434
|
+
agent_slug: str,
|
|
435
|
+
collection: typing.Optional[str] = OMIT,
|
|
436
|
+
group_by: typing.Optional[typing.List[str]] = OMIT,
|
|
437
|
+
count: typing.Optional[bool] = OMIT,
|
|
438
|
+
first: typing.Optional[bool] = OMIT,
|
|
439
|
+
offset: typing.Optional[int] = OMIT,
|
|
440
|
+
) -> PaginatedResponseAggregateGroup:
|
|
441
|
+
"""
|
|
442
|
+
Aggregate agent data with grouping and optional counting/first item retrieval.
|
|
443
|
+
|
|
444
|
+
Parameters:
|
|
445
|
+
- page_size: typing.Optional[int].
|
|
446
|
+
|
|
447
|
+
- page_token: typing.Optional[str].
|
|
448
|
+
|
|
449
|
+
- filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
|
|
450
|
+
|
|
451
|
+
- order_by: typing.Optional[str].
|
|
452
|
+
|
|
453
|
+
- agent_slug: str. The agent deployment's agent_slug to aggregate data for
|
|
454
|
+
|
|
455
|
+
- collection: typing.Optional[str]. The logical agent data collection to aggregate data for
|
|
456
|
+
|
|
457
|
+
- group_by: typing.Optional[typing.List[str]].
|
|
458
|
+
|
|
459
|
+
- count: typing.Optional[bool].
|
|
460
|
+
|
|
461
|
+
- first: typing.Optional[bool].
|
|
462
|
+
|
|
463
|
+
- offset: typing.Optional[int].
|
|
464
|
+
---
|
|
465
|
+
from llama_cloud.client import LlamaCloud
|
|
466
|
+
|
|
467
|
+
client = LlamaCloud(
|
|
468
|
+
token="YOUR_TOKEN",
|
|
469
|
+
)
|
|
470
|
+
client.beta.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
|
|
471
|
+
agent_slug="string",
|
|
472
|
+
)
|
|
473
|
+
"""
|
|
474
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug}
|
|
475
|
+
if page_size is not OMIT:
|
|
476
|
+
_request["page_size"] = page_size
|
|
477
|
+
if page_token is not OMIT:
|
|
478
|
+
_request["page_token"] = page_token
|
|
479
|
+
if filter is not OMIT:
|
|
480
|
+
_request["filter"] = filter
|
|
481
|
+
if order_by is not OMIT:
|
|
482
|
+
_request["order_by"] = order_by
|
|
483
|
+
if collection is not OMIT:
|
|
484
|
+
_request["collection"] = collection
|
|
485
|
+
if group_by is not OMIT:
|
|
486
|
+
_request["group_by"] = group_by
|
|
487
|
+
if count is not OMIT:
|
|
488
|
+
_request["count"] = count
|
|
489
|
+
if first is not OMIT:
|
|
490
|
+
_request["first"] = first
|
|
491
|
+
if offset is not OMIT:
|
|
492
|
+
_request["offset"] = offset
|
|
493
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
494
|
+
"POST",
|
|
495
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data/:aggregate"),
|
|
496
|
+
json=jsonable_encoder(_request),
|
|
497
|
+
headers=self._client_wrapper.get_headers(),
|
|
498
|
+
timeout=60,
|
|
499
|
+
)
|
|
500
|
+
if 200 <= _response.status_code < 300:
|
|
501
|
+
return pydantic.parse_obj_as(PaginatedResponseAggregateGroup, _response.json()) # type: ignore
|
|
502
|
+
if _response.status_code == 422:
|
|
503
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
504
|
+
try:
|
|
505
|
+
_response_json = _response.json()
|
|
506
|
+
except JSONDecodeError:
|
|
507
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
508
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
509
|
+
|
|
207
510
|
|
|
208
511
|
class AsyncBetaClient:
|
|
209
512
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -381,3 +684,302 @@ class AsyncBetaClient:
|
|
|
381
684
|
except JSONDecodeError:
|
|
382
685
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
383
686
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
687
|
+
|
|
688
|
+
async def get_agent_data(self, item_id: str) -> AgentData:
|
|
689
|
+
"""
|
|
690
|
+
Get agent data by ID.
|
|
691
|
+
|
|
692
|
+
Parameters:
|
|
693
|
+
- item_id: str.
|
|
694
|
+
---
|
|
695
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
696
|
+
|
|
697
|
+
client = AsyncLlamaCloud(
|
|
698
|
+
token="YOUR_TOKEN",
|
|
699
|
+
)
|
|
700
|
+
await client.beta.get_agent_data(
|
|
701
|
+
item_id="string",
|
|
702
|
+
)
|
|
703
|
+
"""
|
|
704
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
705
|
+
"GET",
|
|
706
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
707
|
+
headers=self._client_wrapper.get_headers(),
|
|
708
|
+
timeout=60,
|
|
709
|
+
)
|
|
710
|
+
if 200 <= _response.status_code < 300:
|
|
711
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
712
|
+
if _response.status_code == 422:
|
|
713
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
714
|
+
try:
|
|
715
|
+
_response_json = _response.json()
|
|
716
|
+
except JSONDecodeError:
|
|
717
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
718
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
719
|
+
|
|
720
|
+
async def update_agent_data(self, item_id: str, *, data: typing.Dict[str, typing.Any]) -> AgentData:
|
|
721
|
+
"""
|
|
722
|
+
Update agent data by ID (overwrites).
|
|
723
|
+
|
|
724
|
+
Parameters:
|
|
725
|
+
- item_id: str.
|
|
726
|
+
|
|
727
|
+
- data: typing.Dict[str, typing.Any].
|
|
728
|
+
---
|
|
729
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
730
|
+
|
|
731
|
+
client = AsyncLlamaCloud(
|
|
732
|
+
token="YOUR_TOKEN",
|
|
733
|
+
)
|
|
734
|
+
await client.beta.update_agent_data(
|
|
735
|
+
item_id="string",
|
|
736
|
+
data={"string": {}},
|
|
737
|
+
)
|
|
738
|
+
"""
|
|
739
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
740
|
+
"PUT",
|
|
741
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
742
|
+
json=jsonable_encoder({"data": data}),
|
|
743
|
+
headers=self._client_wrapper.get_headers(),
|
|
744
|
+
timeout=60,
|
|
745
|
+
)
|
|
746
|
+
if 200 <= _response.status_code < 300:
|
|
747
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
748
|
+
if _response.status_code == 422:
|
|
749
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
750
|
+
try:
|
|
751
|
+
_response_json = _response.json()
|
|
752
|
+
except JSONDecodeError:
|
|
753
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
754
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
755
|
+
|
|
756
|
+
async def delete_agent_data(self, item_id: str) -> typing.Dict[str, str]:
|
|
757
|
+
"""
|
|
758
|
+
Delete agent data by ID.
|
|
759
|
+
|
|
760
|
+
Parameters:
|
|
761
|
+
- item_id: str.
|
|
762
|
+
---
|
|
763
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
764
|
+
|
|
765
|
+
client = AsyncLlamaCloud(
|
|
766
|
+
token="YOUR_TOKEN",
|
|
767
|
+
)
|
|
768
|
+
await client.beta.delete_agent_data(
|
|
769
|
+
item_id="string",
|
|
770
|
+
)
|
|
771
|
+
"""
|
|
772
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
773
|
+
"DELETE",
|
|
774
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/beta/agent-data/{item_id}"),
|
|
775
|
+
headers=self._client_wrapper.get_headers(),
|
|
776
|
+
timeout=60,
|
|
777
|
+
)
|
|
778
|
+
if 200 <= _response.status_code < 300:
|
|
779
|
+
return pydantic.parse_obj_as(typing.Dict[str, str], _response.json()) # type: ignore
|
|
780
|
+
if _response.status_code == 422:
|
|
781
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
782
|
+
try:
|
|
783
|
+
_response_json = _response.json()
|
|
784
|
+
except JSONDecodeError:
|
|
785
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
786
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
787
|
+
|
|
788
|
+
async def create_agent_data_api_v_1_beta_agent_data_post(
|
|
789
|
+
self, *, agent_slug: str, collection: typing.Optional[str] = OMIT, data: typing.Dict[str, typing.Any]
|
|
790
|
+
) -> AgentData:
|
|
791
|
+
"""
|
|
792
|
+
Create new agent data.
|
|
793
|
+
|
|
794
|
+
Parameters:
|
|
795
|
+
- agent_slug: str.
|
|
796
|
+
|
|
797
|
+
- collection: typing.Optional[str].
|
|
798
|
+
|
|
799
|
+
- data: typing.Dict[str, typing.Any].
|
|
800
|
+
---
|
|
801
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
802
|
+
|
|
803
|
+
client = AsyncLlamaCloud(
|
|
804
|
+
token="YOUR_TOKEN",
|
|
805
|
+
)
|
|
806
|
+
await client.beta.create_agent_data_api_v_1_beta_agent_data_post(
|
|
807
|
+
agent_slug="string",
|
|
808
|
+
data={"string": {}},
|
|
809
|
+
)
|
|
810
|
+
"""
|
|
811
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug, "data": data}
|
|
812
|
+
if collection is not OMIT:
|
|
813
|
+
_request["collection"] = collection
|
|
814
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
815
|
+
"POST",
|
|
816
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data"),
|
|
817
|
+
json=jsonable_encoder(_request),
|
|
818
|
+
headers=self._client_wrapper.get_headers(),
|
|
819
|
+
timeout=60,
|
|
820
|
+
)
|
|
821
|
+
if 200 <= _response.status_code < 300:
|
|
822
|
+
return pydantic.parse_obj_as(AgentData, _response.json()) # type: ignore
|
|
823
|
+
if _response.status_code == 422:
|
|
824
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
825
|
+
try:
|
|
826
|
+
_response_json = _response.json()
|
|
827
|
+
except JSONDecodeError:
|
|
828
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
829
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
830
|
+
|
|
831
|
+
async def search_agent_data_api_v_1_beta_agent_data_search_post(
|
|
832
|
+
self,
|
|
833
|
+
*,
|
|
834
|
+
page_size: typing.Optional[int] = OMIT,
|
|
835
|
+
page_token: typing.Optional[str] = OMIT,
|
|
836
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]] = OMIT,
|
|
837
|
+
order_by: typing.Optional[str] = OMIT,
|
|
838
|
+
agent_slug: str,
|
|
839
|
+
collection: typing.Optional[str] = OMIT,
|
|
840
|
+
include_total: typing.Optional[bool] = OMIT,
|
|
841
|
+
offset: typing.Optional[int] = OMIT,
|
|
842
|
+
) -> PaginatedResponseAgentData:
|
|
843
|
+
"""
|
|
844
|
+
Search agent data with filtering, sorting, and pagination.
|
|
845
|
+
|
|
846
|
+
Parameters:
|
|
847
|
+
- page_size: typing.Optional[int].
|
|
848
|
+
|
|
849
|
+
- page_token: typing.Optional[str].
|
|
850
|
+
|
|
851
|
+
- filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
|
|
852
|
+
|
|
853
|
+
- order_by: typing.Optional[str].
|
|
854
|
+
|
|
855
|
+
- agent_slug: str. The agent deployment's agent_slug to search within
|
|
856
|
+
|
|
857
|
+
- collection: typing.Optional[str]. The logical agent data collection to search within
|
|
858
|
+
|
|
859
|
+
- include_total: typing.Optional[bool]. Whether to include the total number of items in the response
|
|
860
|
+
|
|
861
|
+
- offset: typing.Optional[int].
|
|
862
|
+
---
|
|
863
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
864
|
+
|
|
865
|
+
client = AsyncLlamaCloud(
|
|
866
|
+
token="YOUR_TOKEN",
|
|
867
|
+
)
|
|
868
|
+
await client.beta.search_agent_data_api_v_1_beta_agent_data_search_post(
|
|
869
|
+
agent_slug="string",
|
|
870
|
+
)
|
|
871
|
+
"""
|
|
872
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug}
|
|
873
|
+
if page_size is not OMIT:
|
|
874
|
+
_request["page_size"] = page_size
|
|
875
|
+
if page_token is not OMIT:
|
|
876
|
+
_request["page_token"] = page_token
|
|
877
|
+
if filter is not OMIT:
|
|
878
|
+
_request["filter"] = filter
|
|
879
|
+
if order_by is not OMIT:
|
|
880
|
+
_request["order_by"] = order_by
|
|
881
|
+
if collection is not OMIT:
|
|
882
|
+
_request["collection"] = collection
|
|
883
|
+
if include_total is not OMIT:
|
|
884
|
+
_request["include_total"] = include_total
|
|
885
|
+
if offset is not OMIT:
|
|
886
|
+
_request["offset"] = offset
|
|
887
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
888
|
+
"POST",
|
|
889
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data/:search"),
|
|
890
|
+
json=jsonable_encoder(_request),
|
|
891
|
+
headers=self._client_wrapper.get_headers(),
|
|
892
|
+
timeout=60,
|
|
893
|
+
)
|
|
894
|
+
if 200 <= _response.status_code < 300:
|
|
895
|
+
return pydantic.parse_obj_as(PaginatedResponseAgentData, _response.json()) # type: ignore
|
|
896
|
+
if _response.status_code == 422:
|
|
897
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
898
|
+
try:
|
|
899
|
+
_response_json = _response.json()
|
|
900
|
+
except JSONDecodeError:
|
|
901
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
902
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
903
|
+
|
|
904
|
+
async def aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
|
|
905
|
+
self,
|
|
906
|
+
*,
|
|
907
|
+
page_size: typing.Optional[int] = OMIT,
|
|
908
|
+
page_token: typing.Optional[str] = OMIT,
|
|
909
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]] = OMIT,
|
|
910
|
+
order_by: typing.Optional[str] = OMIT,
|
|
911
|
+
agent_slug: str,
|
|
912
|
+
collection: typing.Optional[str] = OMIT,
|
|
913
|
+
group_by: typing.Optional[typing.List[str]] = OMIT,
|
|
914
|
+
count: typing.Optional[bool] = OMIT,
|
|
915
|
+
first: typing.Optional[bool] = OMIT,
|
|
916
|
+
offset: typing.Optional[int] = OMIT,
|
|
917
|
+
) -> PaginatedResponseAggregateGroup:
|
|
918
|
+
"""
|
|
919
|
+
Aggregate agent data with grouping and optional counting/first item retrieval.
|
|
920
|
+
|
|
921
|
+
Parameters:
|
|
922
|
+
- page_size: typing.Optional[int].
|
|
923
|
+
|
|
924
|
+
- page_token: typing.Optional[str].
|
|
925
|
+
|
|
926
|
+
- filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
|
|
927
|
+
|
|
928
|
+
- order_by: typing.Optional[str].
|
|
929
|
+
|
|
930
|
+
- agent_slug: str. The agent deployment's agent_slug to aggregate data for
|
|
931
|
+
|
|
932
|
+
- collection: typing.Optional[str]. The logical agent data collection to aggregate data for
|
|
933
|
+
|
|
934
|
+
- group_by: typing.Optional[typing.List[str]].
|
|
935
|
+
|
|
936
|
+
- count: typing.Optional[bool].
|
|
937
|
+
|
|
938
|
+
- first: typing.Optional[bool].
|
|
939
|
+
|
|
940
|
+
- offset: typing.Optional[int].
|
|
941
|
+
---
|
|
942
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
943
|
+
|
|
944
|
+
client = AsyncLlamaCloud(
|
|
945
|
+
token="YOUR_TOKEN",
|
|
946
|
+
)
|
|
947
|
+
await client.beta.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
|
|
948
|
+
agent_slug="string",
|
|
949
|
+
)
|
|
950
|
+
"""
|
|
951
|
+
_request: typing.Dict[str, typing.Any] = {"agent_slug": agent_slug}
|
|
952
|
+
if page_size is not OMIT:
|
|
953
|
+
_request["page_size"] = page_size
|
|
954
|
+
if page_token is not OMIT:
|
|
955
|
+
_request["page_token"] = page_token
|
|
956
|
+
if filter is not OMIT:
|
|
957
|
+
_request["filter"] = filter
|
|
958
|
+
if order_by is not OMIT:
|
|
959
|
+
_request["order_by"] = order_by
|
|
960
|
+
if collection is not OMIT:
|
|
961
|
+
_request["collection"] = collection
|
|
962
|
+
if group_by is not OMIT:
|
|
963
|
+
_request["group_by"] = group_by
|
|
964
|
+
if count is not OMIT:
|
|
965
|
+
_request["count"] = count
|
|
966
|
+
if first is not OMIT:
|
|
967
|
+
_request["first"] = first
|
|
968
|
+
if offset is not OMIT:
|
|
969
|
+
_request["offset"] = offset
|
|
970
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
971
|
+
"POST",
|
|
972
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/beta/agent-data/:aggregate"),
|
|
973
|
+
json=jsonable_encoder(_request),
|
|
974
|
+
headers=self._client_wrapper.get_headers(),
|
|
975
|
+
timeout=60,
|
|
976
|
+
)
|
|
977
|
+
if 200 <= _response.status_code < 300:
|
|
978
|
+
return pydantic.parse_obj_as(PaginatedResponseAggregateGroup, _response.json()) # type: ignore
|
|
979
|
+
if _response.status_code == 422:
|
|
980
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
981
|
+
try:
|
|
982
|
+
_response_json = _response.json()
|
|
983
|
+
except JSONDecodeError:
|
|
984
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
985
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -301,7 +301,7 @@ class OrganizationsClient:
|
|
|
301
301
|
self, organization_id: typing.Optional[str], *, get_current_invoice_total: typing.Optional[bool] = None
|
|
302
302
|
) -> UsageAndPlan:
|
|
303
303
|
"""
|
|
304
|
-
Get usage for a
|
|
304
|
+
Get usage for a specific organization.
|
|
305
305
|
|
|
306
306
|
Parameters:
|
|
307
307
|
- organization_id: typing.Optional[str].
|
|
@@ -1007,7 +1007,7 @@ class AsyncOrganizationsClient:
|
|
|
1007
1007
|
self, organization_id: typing.Optional[str], *, get_current_invoice_total: typing.Optional[bool] = None
|
|
1008
1008
|
) -> UsageAndPlan:
|
|
1009
1009
|
"""
|
|
1010
|
-
Get usage for a
|
|
1010
|
+
Get usage for a specific organization.
|
|
1011
1011
|
|
|
1012
1012
|
Parameters:
|
|
1013
1013
|
- organization_id: typing.Optional[str].
|
|
@@ -233,6 +233,7 @@ class ParsingClient:
|
|
|
233
233
|
language: typing.List[ParserLanguages],
|
|
234
234
|
extract_layout: bool,
|
|
235
235
|
max_pages: typing.Optional[int] = OMIT,
|
|
236
|
+
merge_tables_across_pages_in_markdown: bool,
|
|
236
237
|
outlined_table_extraction: bool,
|
|
237
238
|
output_pdf_of_document: bool,
|
|
238
239
|
output_s_3_path_prefix: str,
|
|
@@ -370,6 +371,8 @@ class ParsingClient:
|
|
|
370
371
|
|
|
371
372
|
- max_pages: typing.Optional[int].
|
|
372
373
|
|
|
374
|
+
- merge_tables_across_pages_in_markdown: bool.
|
|
375
|
+
|
|
373
376
|
- outlined_table_extraction: bool.
|
|
374
377
|
|
|
375
378
|
- output_pdf_of_document: bool.
|
|
@@ -518,6 +521,7 @@ class ParsingClient:
|
|
|
518
521
|
"invalidate_cache": invalidate_cache,
|
|
519
522
|
"language": language,
|
|
520
523
|
"extract_layout": extract_layout,
|
|
524
|
+
"merge_tables_across_pages_in_markdown": merge_tables_across_pages_in_markdown,
|
|
521
525
|
"outlined_table_extraction": outlined_table_extraction,
|
|
522
526
|
"output_pdf_of_document": output_pdf_of_document,
|
|
523
527
|
"output_s3_path_prefix": output_s_3_path_prefix,
|
|
@@ -1389,6 +1393,7 @@ class AsyncParsingClient:
|
|
|
1389
1393
|
language: typing.List[ParserLanguages],
|
|
1390
1394
|
extract_layout: bool,
|
|
1391
1395
|
max_pages: typing.Optional[int] = OMIT,
|
|
1396
|
+
merge_tables_across_pages_in_markdown: bool,
|
|
1392
1397
|
outlined_table_extraction: bool,
|
|
1393
1398
|
output_pdf_of_document: bool,
|
|
1394
1399
|
output_s_3_path_prefix: str,
|
|
@@ -1526,6 +1531,8 @@ class AsyncParsingClient:
|
|
|
1526
1531
|
|
|
1527
1532
|
- max_pages: typing.Optional[int].
|
|
1528
1533
|
|
|
1534
|
+
- merge_tables_across_pages_in_markdown: bool.
|
|
1535
|
+
|
|
1529
1536
|
- outlined_table_extraction: bool.
|
|
1530
1537
|
|
|
1531
1538
|
- output_pdf_of_document: bool.
|
|
@@ -1674,6 +1681,7 @@ class AsyncParsingClient:
|
|
|
1674
1681
|
"invalidate_cache": invalidate_cache,
|
|
1675
1682
|
"language": language,
|
|
1676
1683
|
"extract_layout": extract_layout,
|
|
1684
|
+
"merge_tables_across_pages_in_markdown": merge_tables_across_pages_in_markdown,
|
|
1677
1685
|
"outlined_table_extraction": outlined_table_extraction,
|
|
1678
1686
|
"output_pdf_of_document": output_pdf_of_document,
|
|
1679
1687
|
"output_s3_path_prefix": output_s_3_path_prefix,
|