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
|
@@ -410,6 +410,38 @@ class PipelinesClient:
|
|
|
410
410
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
411
411
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
412
412
|
|
|
413
|
+
def force_delete_pipeline(self, pipeline_id: str) -> None:
|
|
414
|
+
"""
|
|
415
|
+
Parameters:
|
|
416
|
+
- pipeline_id: str.
|
|
417
|
+
---
|
|
418
|
+
from llama_cloud.client import LlamaCloud
|
|
419
|
+
|
|
420
|
+
client = LlamaCloud(
|
|
421
|
+
token="YOUR_TOKEN",
|
|
422
|
+
)
|
|
423
|
+
client.pipelines.force_delete_pipeline(
|
|
424
|
+
pipeline_id="string",
|
|
425
|
+
)
|
|
426
|
+
"""
|
|
427
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
428
|
+
"POST",
|
|
429
|
+
urllib.parse.urljoin(
|
|
430
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/force-delete"
|
|
431
|
+
),
|
|
432
|
+
headers=self._client_wrapper.get_headers(),
|
|
433
|
+
timeout=60,
|
|
434
|
+
)
|
|
435
|
+
if 200 <= _response.status_code < 300:
|
|
436
|
+
return
|
|
437
|
+
if _response.status_code == 422:
|
|
438
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
439
|
+
try:
|
|
440
|
+
_response_json = _response.json()
|
|
441
|
+
except JSONDecodeError:
|
|
442
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
443
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
444
|
+
|
|
413
445
|
def copy_pipeline(self, pipeline_id: str) -> Pipeline:
|
|
414
446
|
"""
|
|
415
447
|
Copy a pipeline by ID.
|
|
@@ -2049,6 +2081,38 @@ class AsyncPipelinesClient:
|
|
|
2049
2081
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2050
2082
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
2051
2083
|
|
|
2084
|
+
async def force_delete_pipeline(self, pipeline_id: str) -> None:
|
|
2085
|
+
"""
|
|
2086
|
+
Parameters:
|
|
2087
|
+
- pipeline_id: str.
|
|
2088
|
+
---
|
|
2089
|
+
from llama_cloud.client import AsyncLlamaCloud
|
|
2090
|
+
|
|
2091
|
+
client = AsyncLlamaCloud(
|
|
2092
|
+
token="YOUR_TOKEN",
|
|
2093
|
+
)
|
|
2094
|
+
await client.pipelines.force_delete_pipeline(
|
|
2095
|
+
pipeline_id="string",
|
|
2096
|
+
)
|
|
2097
|
+
"""
|
|
2098
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2099
|
+
"POST",
|
|
2100
|
+
urllib.parse.urljoin(
|
|
2101
|
+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/pipelines/{pipeline_id}/force-delete"
|
|
2102
|
+
),
|
|
2103
|
+
headers=self._client_wrapper.get_headers(),
|
|
2104
|
+
timeout=60,
|
|
2105
|
+
)
|
|
2106
|
+
if 200 <= _response.status_code < 300:
|
|
2107
|
+
return
|
|
2108
|
+
if _response.status_code == 422:
|
|
2109
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
2110
|
+
try:
|
|
2111
|
+
_response_json = _response.json()
|
|
2112
|
+
except JSONDecodeError:
|
|
2113
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2114
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
2115
|
+
|
|
2052
2116
|
async def copy_pipeline(self, pipeline_id: str) -> Pipeline:
|
|
2053
2117
|
"""
|
|
2054
2118
|
Copy a pipeline by ID.
|
llama_cloud/types/__init__.py
CHANGED
|
@@ -15,10 +15,10 @@ from .advanced_mode_transform_config_segmentation_config import (
|
|
|
15
15
|
AdvancedModeTransformConfigSegmentationConfig_None,
|
|
16
16
|
AdvancedModeTransformConfigSegmentationConfig_Page,
|
|
17
17
|
)
|
|
18
|
+
from .agent_data import AgentData
|
|
18
19
|
from .agent_deployment_list import AgentDeploymentList
|
|
19
20
|
from .agent_deployment_summary import AgentDeploymentSummary
|
|
20
|
-
from .
|
|
21
|
-
from .app_schema_responses_message_role import AppSchemaResponsesMessageRole
|
|
21
|
+
from .aggregate_group import AggregateGroup
|
|
22
22
|
from .audio_block import AudioBlock
|
|
23
23
|
from .auto_transform_config import AutoTransformConfig
|
|
24
24
|
from .azure_open_ai_embedding import AzureOpenAiEmbedding
|
|
@@ -142,6 +142,13 @@ from .file_parse_public import FileParsePublic
|
|
|
142
142
|
from .file_permission_info_value import FilePermissionInfoValue
|
|
143
143
|
from .file_resource_info_value import FileResourceInfoValue
|
|
144
144
|
from .filter_condition import FilterCondition
|
|
145
|
+
from .filter_operation import FilterOperation
|
|
146
|
+
from .filter_operation_eq import FilterOperationEq
|
|
147
|
+
from .filter_operation_gt import FilterOperationGt
|
|
148
|
+
from .filter_operation_gte import FilterOperationGte
|
|
149
|
+
from .filter_operation_includes_item import FilterOperationIncludesItem
|
|
150
|
+
from .filter_operation_lt import FilterOperationLt
|
|
151
|
+
from .filter_operation_lte import FilterOperationLte
|
|
145
152
|
from .filter_operator import FilterOperator
|
|
146
153
|
from .free_credits_usage import FreeCreditsUsage
|
|
147
154
|
from .gemini_embedding import GeminiEmbedding
|
|
@@ -181,7 +188,6 @@ from .llama_index_core_base_llms_types_chat_message_blocks_item import (
|
|
|
181
188
|
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Image,
|
|
182
189
|
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text,
|
|
183
190
|
)
|
|
184
|
-
from .llama_index_core_base_llms_types_message_role import LlamaIndexCoreBaseLlmsTypesMessageRole
|
|
185
191
|
from .llama_parse_parameters import LlamaParseParameters
|
|
186
192
|
from .llama_parse_parameters_priority import LlamaParseParametersPriority
|
|
187
193
|
from .llama_parse_supported_file_extensions import LlamaParseSupportedFileExtensions
|
|
@@ -190,13 +196,12 @@ from .llm_parameters import LlmParameters
|
|
|
190
196
|
from .load_files_job_config import LoadFilesJobConfig
|
|
191
197
|
from .managed_ingestion_status import ManagedIngestionStatus
|
|
192
198
|
from .managed_ingestion_status_response import ManagedIngestionStatusResponse
|
|
193
|
-
from .message import Message
|
|
194
199
|
from .message_annotation import MessageAnnotation
|
|
200
|
+
from .message_role import MessageRole
|
|
195
201
|
from .metadata_filter import MetadataFilter
|
|
196
202
|
from .metadata_filter_value import MetadataFilterValue
|
|
197
203
|
from .metadata_filters import MetadataFilters
|
|
198
204
|
from .metadata_filters_filters_item import MetadataFiltersFiltersItem
|
|
199
|
-
from .model_configuration import ModelConfiguration
|
|
200
205
|
from .node_relationship import NodeRelationship
|
|
201
206
|
from .none_chunking_config import NoneChunkingConfig
|
|
202
207
|
from .none_segmentation_config import NoneSegmentationConfig
|
|
@@ -215,6 +220,8 @@ from .paginated_jobs_history_with_metrics import PaginatedJobsHistoryWithMetrics
|
|
|
215
220
|
from .paginated_list_cloud_documents_response import PaginatedListCloudDocumentsResponse
|
|
216
221
|
from .paginated_list_pipeline_files_response import PaginatedListPipelineFilesResponse
|
|
217
222
|
from .paginated_report_response import PaginatedReportResponse
|
|
223
|
+
from .paginated_response_agent_data import PaginatedResponseAgentData
|
|
224
|
+
from .paginated_response_aggregate_group import PaginatedResponseAggregateGroup
|
|
218
225
|
from .parse_job_config import ParseJobConfig
|
|
219
226
|
from .parse_job_config_priority import ParseJobConfigPriority
|
|
220
227
|
from .parse_plan_level import ParsePlanLevel
|
|
@@ -328,13 +335,13 @@ from .role import Role
|
|
|
328
335
|
from .schema_relax_mode import SchemaRelaxMode
|
|
329
336
|
from .semantic_chunking_config import SemanticChunkingConfig
|
|
330
337
|
from .sentence_chunking_config import SentenceChunkingConfig
|
|
338
|
+
from .src_app_schema_chat_chat_message import SrcAppSchemaChatChatMessage
|
|
331
339
|
from .status_enum import StatusEnum
|
|
332
340
|
from .struct_mode import StructMode
|
|
333
341
|
from .struct_parse_conf import StructParseConf
|
|
334
342
|
from .supported_llm_model import SupportedLlmModel
|
|
335
343
|
from .supported_llm_model_names import SupportedLlmModelNames
|
|
336
344
|
from .text_block import TextBlock
|
|
337
|
-
from .text_content_block import TextContentBlock
|
|
338
345
|
from .text_node import TextNode
|
|
339
346
|
from .text_node_relationships_value import TextNodeRelationshipsValue
|
|
340
347
|
from .text_node_with_score import TextNodeWithScore
|
|
@@ -368,10 +375,10 @@ __all__ = [
|
|
|
368
375
|
"AdvancedModeTransformConfigSegmentationConfig_Element",
|
|
369
376
|
"AdvancedModeTransformConfigSegmentationConfig_None",
|
|
370
377
|
"AdvancedModeTransformConfigSegmentationConfig_Page",
|
|
378
|
+
"AgentData",
|
|
371
379
|
"AgentDeploymentList",
|
|
372
380
|
"AgentDeploymentSummary",
|
|
373
|
-
"
|
|
374
|
-
"AppSchemaResponsesMessageRole",
|
|
381
|
+
"AggregateGroup",
|
|
375
382
|
"AudioBlock",
|
|
376
383
|
"AutoTransformConfig",
|
|
377
384
|
"AzureOpenAiEmbedding",
|
|
@@ -491,6 +498,13 @@ __all__ = [
|
|
|
491
498
|
"FilePermissionInfoValue",
|
|
492
499
|
"FileResourceInfoValue",
|
|
493
500
|
"FilterCondition",
|
|
501
|
+
"FilterOperation",
|
|
502
|
+
"FilterOperationEq",
|
|
503
|
+
"FilterOperationGt",
|
|
504
|
+
"FilterOperationGte",
|
|
505
|
+
"FilterOperationIncludesItem",
|
|
506
|
+
"FilterOperationLt",
|
|
507
|
+
"FilterOperationLte",
|
|
494
508
|
"FilterOperator",
|
|
495
509
|
"FreeCreditsUsage",
|
|
496
510
|
"GeminiEmbedding",
|
|
@@ -526,7 +540,6 @@ __all__ = [
|
|
|
526
540
|
"LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Document",
|
|
527
541
|
"LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Image",
|
|
528
542
|
"LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text",
|
|
529
|
-
"LlamaIndexCoreBaseLlmsTypesMessageRole",
|
|
530
543
|
"LlamaParseParameters",
|
|
531
544
|
"LlamaParseParametersPriority",
|
|
532
545
|
"LlamaParseSupportedFileExtensions",
|
|
@@ -535,13 +548,12 @@ __all__ = [
|
|
|
535
548
|
"LoadFilesJobConfig",
|
|
536
549
|
"ManagedIngestionStatus",
|
|
537
550
|
"ManagedIngestionStatusResponse",
|
|
538
|
-
"Message",
|
|
539
551
|
"MessageAnnotation",
|
|
552
|
+
"MessageRole",
|
|
540
553
|
"MetadataFilter",
|
|
541
554
|
"MetadataFilterValue",
|
|
542
555
|
"MetadataFilters",
|
|
543
556
|
"MetadataFiltersFiltersItem",
|
|
544
|
-
"ModelConfiguration",
|
|
545
557
|
"NodeRelationship",
|
|
546
558
|
"NoneChunkingConfig",
|
|
547
559
|
"NoneSegmentationConfig",
|
|
@@ -560,6 +572,8 @@ __all__ = [
|
|
|
560
572
|
"PaginatedListCloudDocumentsResponse",
|
|
561
573
|
"PaginatedListPipelineFilesResponse",
|
|
562
574
|
"PaginatedReportResponse",
|
|
575
|
+
"PaginatedResponseAgentData",
|
|
576
|
+
"PaginatedResponseAggregateGroup",
|
|
563
577
|
"ParseJobConfig",
|
|
564
578
|
"ParseJobConfigPriority",
|
|
565
579
|
"ParsePlanLevel",
|
|
@@ -663,13 +677,13 @@ __all__ = [
|
|
|
663
677
|
"SchemaRelaxMode",
|
|
664
678
|
"SemanticChunkingConfig",
|
|
665
679
|
"SentenceChunkingConfig",
|
|
680
|
+
"SrcAppSchemaChatChatMessage",
|
|
666
681
|
"StatusEnum",
|
|
667
682
|
"StructMode",
|
|
668
683
|
"StructParseConf",
|
|
669
684
|
"SupportedLlmModel",
|
|
670
685
|
"SupportedLlmModelNames",
|
|
671
686
|
"TextBlock",
|
|
672
|
-
"TextContentBlock",
|
|
673
687
|
"TextNode",
|
|
674
688
|
"TextNodeRelationshipsValue",
|
|
675
689
|
"TextNodeWithScore",
|
|
@@ -4,7 +4,6 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .supported_llm_model_names import SupportedLlmModelNames
|
|
8
7
|
|
|
9
8
|
try:
|
|
10
9
|
import pydantic
|
|
@@ -15,15 +14,17 @@ except ImportError:
|
|
|
15
14
|
import pydantic # type: ignore
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
class
|
|
17
|
+
class AgentData(pydantic.BaseModel):
|
|
19
18
|
"""
|
|
20
|
-
|
|
19
|
+
API Result for a single agent data item
|
|
21
20
|
"""
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
id: typing.Optional[str]
|
|
23
|
+
agent_slug: str
|
|
24
|
+
collection: typing.Optional[str]
|
|
25
|
+
data: typing.Dict[str, typing.Any]
|
|
26
|
+
created_at: typing.Optional[dt.datetime]
|
|
27
|
+
updated_at: typing.Optional[dt.datetime]
|
|
27
28
|
|
|
28
29
|
def json(self, **kwargs: typing.Any) -> str:
|
|
29
30
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -17,7 +17,7 @@ except ImportError:
|
|
|
17
17
|
class AgentDeploymentSummary(pydantic.BaseModel):
|
|
18
18
|
id: str = pydantic.Field(description="Deployment ID. Prefixed with dpl-")
|
|
19
19
|
project_id: str = pydantic.Field(description="Project ID")
|
|
20
|
-
|
|
20
|
+
agent_slug: str = pydantic.Field(description="readable ID of the deployed app")
|
|
21
21
|
thumbnail_url: typing.Optional[str]
|
|
22
22
|
base_url: str = pydantic.Field(description="Base URL of the deployed app")
|
|
23
23
|
display_name: str = pydantic.Field(description="Display name of the deployed app")
|
|
@@ -4,8 +4,6 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .app_schema_responses_message_role import AppSchemaResponsesMessageRole
|
|
8
|
-
from .text_content_block import TextContentBlock
|
|
9
7
|
|
|
10
8
|
try:
|
|
11
9
|
import pydantic
|
|
@@ -16,13 +14,14 @@ except ImportError:
|
|
|
16
14
|
import pydantic # type: ignore
|
|
17
15
|
|
|
18
16
|
|
|
19
|
-
class
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
class AggregateGroup(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
API Result for a single group in the aggregate response
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
group_key: typing.Dict[str, typing.Any]
|
|
23
|
+
count: typing.Optional[int]
|
|
24
|
+
first_item: typing.Optional[typing.Dict[str, typing.Any]]
|
|
26
25
|
|
|
27
26
|
def json(self, **kwargs: typing.Any) -> str:
|
|
28
27
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
llama_cloud/types/base_plan.py
CHANGED
|
@@ -35,6 +35,9 @@ class BasePlan(pydantic.BaseModel):
|
|
|
35
35
|
is_payment_failed: typing.Optional[bool] = pydantic.Field(
|
|
36
36
|
description="Whether the organization has a failed payment that requires support contact"
|
|
37
37
|
)
|
|
38
|
+
failure_count: typing.Optional[int] = pydantic.Field(
|
|
39
|
+
description="The number of payment failures for this organization"
|
|
40
|
+
)
|
|
38
41
|
|
|
39
42
|
def json(self, **kwargs: typing.Any) -> str:
|
|
40
43
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -11,7 +11,6 @@ class ExtractMode(str, enum.Enum):
|
|
|
11
11
|
BALANCED = "BALANCED"
|
|
12
12
|
PREMIUM = "PREMIUM"
|
|
13
13
|
MULTIMODAL = "MULTIMODAL"
|
|
14
|
-
ACCURATE = "ACCURATE"
|
|
15
14
|
|
|
16
15
|
def visit(
|
|
17
16
|
self,
|
|
@@ -19,7 +18,6 @@ class ExtractMode(str, enum.Enum):
|
|
|
19
18
|
balanced: typing.Callable[[], T_Result],
|
|
20
19
|
premium: typing.Callable[[], T_Result],
|
|
21
20
|
multimodal: typing.Callable[[], T_Result],
|
|
22
|
-
accurate: typing.Callable[[], T_Result],
|
|
23
21
|
) -> T_Result:
|
|
24
22
|
if self is ExtractMode.FAST:
|
|
25
23
|
return fast()
|
|
@@ -29,5 +27,3 @@ class ExtractMode(str, enum.Enum):
|
|
|
29
27
|
return premium()
|
|
30
28
|
if self is ExtractMode.MULTIMODAL:
|
|
31
29
|
return multimodal()
|
|
32
|
-
if self is ExtractMode.ACCURATE:
|
|
33
|
-
return accurate()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .filter_operation_eq import FilterOperationEq
|
|
8
|
+
from .filter_operation_gt import FilterOperationGt
|
|
9
|
+
from .filter_operation_gte import FilterOperationGte
|
|
10
|
+
from .filter_operation_includes_item import FilterOperationIncludesItem
|
|
11
|
+
from .filter_operation_lt import FilterOperationLt
|
|
12
|
+
from .filter_operation_lte import FilterOperationLte
|
|
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
|
+
|
|
23
|
+
class FilterOperation(pydantic.BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
API request model for a filter comparison operation.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
eq: typing.Optional[FilterOperationEq]
|
|
29
|
+
gt: typing.Optional[FilterOperationGt]
|
|
30
|
+
gte: typing.Optional[FilterOperationGte]
|
|
31
|
+
lt: typing.Optional[FilterOperationLt]
|
|
32
|
+
lte: typing.Optional[FilterOperationLte]
|
|
33
|
+
includes: typing.Optional[typing.List[typing.Optional[FilterOperationIncludesItem]]]
|
|
34
|
+
|
|
35
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
36
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
37
|
+
return super().json(**kwargs_with_defaults)
|
|
38
|
+
|
|
39
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
40
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
41
|
+
return super().dict(**kwargs_with_defaults)
|
|
42
|
+
|
|
43
|
+
class Config:
|
|
44
|
+
frozen = True
|
|
45
|
+
smart_union = True
|
|
46
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -4,7 +4,7 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .
|
|
7
|
+
from .message_role import MessageRole
|
|
8
8
|
|
|
9
9
|
try:
|
|
10
10
|
import pydantic
|
|
@@ -21,7 +21,7 @@ class InputMessage(pydantic.BaseModel):
|
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
id: typing.Optional[str] = pydantic.Field(description="ID of the message, if any. a UUID.")
|
|
24
|
-
role:
|
|
24
|
+
role: MessageRole
|
|
25
25
|
content: str
|
|
26
26
|
data: typing.Optional[typing.Dict[str, typing.Any]]
|
|
27
27
|
class_name: typing.Optional[str]
|
|
@@ -46,6 +46,9 @@ class LegacyParseJobConfig(pydantic.BaseModel):
|
|
|
46
46
|
invalidate_cache: bool = pydantic.Field(alias="invalidateCache", description="Whether to invalidate the cache.")
|
|
47
47
|
output_pdf_of_document: typing.Optional[bool] = pydantic.Field(alias="outputPDFOfDocument")
|
|
48
48
|
outlined_table_extraction: typing.Optional[bool] = pydantic.Field(alias="outlinedTableExtraction")
|
|
49
|
+
merge_tables_across_pages_in_markdown: typing.Optional[bool] = pydantic.Field(
|
|
50
|
+
alias="mergeTablesAcrossPagesInMarkdown"
|
|
51
|
+
)
|
|
49
52
|
save_images: typing.Optional[bool] = pydantic.Field(alias="saveImages")
|
|
50
53
|
gpt_4_o: typing.Optional[bool] = pydantic.Field(alias="gpt4o", description="Whether to use GPT4o.")
|
|
51
54
|
open_aiapi_key: str = pydantic.Field(alias="openAIAPIKey", description="The OpenAI API key.")
|
|
@@ -5,7 +5,7 @@ import typing
|
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
7
|
from .llama_index_core_base_llms_types_chat_message_blocks_item import LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem
|
|
8
|
-
from .
|
|
8
|
+
from .message_role import MessageRole
|
|
9
9
|
|
|
10
10
|
try:
|
|
11
11
|
import pydantic
|
|
@@ -21,7 +21,7 @@ class LlamaIndexCoreBaseLlmsTypesChatMessage(pydantic.BaseModel):
|
|
|
21
21
|
Chat message.
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
role: typing.Optional[
|
|
24
|
+
role: typing.Optional[MessageRole]
|
|
25
25
|
additional_kwargs: typing.Optional[typing.Dict[str, typing.Any]]
|
|
26
26
|
blocks: typing.Optional[typing.List[LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem]]
|
|
27
27
|
|
|
@@ -34,6 +34,7 @@ class LlamaParseParameters(pydantic.BaseModel):
|
|
|
34
34
|
disable_image_extraction: typing.Optional[bool]
|
|
35
35
|
invalidate_cache: typing.Optional[bool]
|
|
36
36
|
outlined_table_extraction: typing.Optional[bool]
|
|
37
|
+
merge_tables_across_pages_in_markdown: typing.Optional[bool]
|
|
37
38
|
output_pdf_of_document: typing.Optional[bool]
|
|
38
39
|
do_not_cache: typing.Optional[bool]
|
|
39
40
|
fast_mode: typing.Optional[bool]
|
|
@@ -6,7 +6,7 @@ import typing
|
|
|
6
6
|
T_Result = typing.TypeVar("T_Result")
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class MessageRole(str, enum.Enum):
|
|
10
10
|
"""
|
|
11
11
|
Message role.
|
|
12
12
|
"""
|
|
@@ -31,19 +31,19 @@ class LlamaIndexCoreBaseLlmsTypesMessageRole(str, enum.Enum):
|
|
|
31
31
|
chatbot: typing.Callable[[], T_Result],
|
|
32
32
|
model: typing.Callable[[], T_Result],
|
|
33
33
|
) -> T_Result:
|
|
34
|
-
if self is
|
|
34
|
+
if self is MessageRole.SYSTEM:
|
|
35
35
|
return system()
|
|
36
|
-
if self is
|
|
36
|
+
if self is MessageRole.DEVELOPER:
|
|
37
37
|
return developer()
|
|
38
|
-
if self is
|
|
38
|
+
if self is MessageRole.USER:
|
|
39
39
|
return user()
|
|
40
|
-
if self is
|
|
40
|
+
if self is MessageRole.ASSISTANT:
|
|
41
41
|
return assistant()
|
|
42
|
-
if self is
|
|
42
|
+
if self is MessageRole.FUNCTION:
|
|
43
43
|
return function()
|
|
44
|
-
if self is
|
|
44
|
+
if self is MessageRole.TOOL:
|
|
45
45
|
return tool()
|
|
46
|
-
if self is
|
|
46
|
+
if self is MessageRole.CHATBOT:
|
|
47
47
|
return chatbot()
|
|
48
|
-
if self is
|
|
48
|
+
if self is MessageRole.MODEL:
|
|
49
49
|
return model()
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import datetime as dt
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
|
-
import typing_extensions
|
|
7
|
-
|
|
8
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .agent_data import AgentData
|
|
9
8
|
|
|
10
9
|
try:
|
|
11
10
|
import pydantic
|
|
@@ -16,9 +15,10 @@ except ImportError:
|
|
|
16
15
|
import pydantic # type: ignore
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
class
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
class PaginatedResponseAgentData(pydantic.BaseModel):
|
|
19
|
+
items: typing.List[AgentData] = pydantic.Field(description="The list of items.")
|
|
20
|
+
next_page_token: typing.Optional[str]
|
|
21
|
+
total_size: typing.Optional[int]
|
|
22
22
|
|
|
23
23
|
def json(self, **kwargs: typing.Any) -> str:
|
|
24
24
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .aggregate_group import AggregateGroup
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import pydantic
|
|
11
|
+
if pydantic.__version__.startswith("1."):
|
|
12
|
+
raise ImportError
|
|
13
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
14
|
+
except ImportError:
|
|
15
|
+
import pydantic # type: ignore
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PaginatedResponseAggregateGroup(pydantic.BaseModel):
|
|
19
|
+
items: typing.List[AggregateGroup] = pydantic.Field(description="The list of items.")
|
|
20
|
+
next_page_token: typing.Optional[str]
|
|
21
|
+
total_size: typing.Optional[int]
|
|
22
|
+
|
|
23
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
|
+
return super().json(**kwargs_with_defaults)
|
|
26
|
+
|
|
27
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
28
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
29
|
+
return super().dict(**kwargs_with_defaults)
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -36,6 +36,7 @@ class ParseJobConfig(pydantic.BaseModel):
|
|
|
36
36
|
disable_image_extraction: typing.Optional[bool]
|
|
37
37
|
invalidate_cache: typing.Optional[bool]
|
|
38
38
|
outlined_table_extraction: typing.Optional[bool]
|
|
39
|
+
merge_tables_across_pages_in_markdown: typing.Optional[bool]
|
|
39
40
|
output_pdf_of_document: typing.Optional[bool]
|
|
40
41
|
do_not_cache: typing.Optional[bool]
|
|
41
42
|
fast_mode: typing.Optional[bool]
|
|
@@ -4,9 +4,9 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .app_schema_chat_chat_message import AppSchemaChatChatMessage
|
|
8
7
|
from .llm_parameters import LlmParameters
|
|
9
8
|
from .preset_retrieval_params import PresetRetrievalParams
|
|
9
|
+
from .src_app_schema_chat_chat_message import SrcAppSchemaChatChatMessage
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
import pydantic
|
|
@@ -33,7 +33,7 @@ class PlaygroundSession(pydantic.BaseModel):
|
|
|
33
33
|
retrieval_params: typing.Optional[PresetRetrievalParams] = pydantic.Field(
|
|
34
34
|
description="Preset retrieval parameters last used in this session."
|
|
35
35
|
)
|
|
36
|
-
chat_messages: typing.Optional[typing.List[
|
|
36
|
+
chat_messages: typing.Optional[typing.List[SrcAppSchemaChatChatMessage]] = pydantic.Field(
|
|
37
37
|
description="Chat message history for this session."
|
|
38
38
|
)
|
|
39
39
|
|
llama_cloud/types/role.py
CHANGED
|
@@ -24,7 +24,6 @@ class Role(pydantic.BaseModel):
|
|
|
24
24
|
created_at: typing.Optional[dt.datetime]
|
|
25
25
|
updated_at: typing.Optional[dt.datetime]
|
|
26
26
|
name: str = pydantic.Field(description="A name for the role.")
|
|
27
|
-
organization_id: typing.Optional[str]
|
|
28
27
|
permissions: typing.List[Permission] = pydantic.Field(description="The actual permissions of the role.")
|
|
29
28
|
|
|
30
29
|
def json(self, **kwargs: typing.Any) -> str:
|
|
@@ -4,8 +4,8 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .llama_index_core_base_llms_types_message_role import LlamaIndexCoreBaseLlmsTypesMessageRole
|
|
8
7
|
from .message_annotation import MessageAnnotation
|
|
8
|
+
from .message_role import MessageRole
|
|
9
9
|
|
|
10
10
|
try:
|
|
11
11
|
import pydantic
|
|
@@ -16,13 +16,13 @@ except ImportError:
|
|
|
16
16
|
import pydantic # type: ignore
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class SrcAppSchemaChatChatMessage(pydantic.BaseModel):
|
|
20
20
|
id: str
|
|
21
21
|
index: int = pydantic.Field(description="The index of the message in the chat.")
|
|
22
22
|
annotations: typing.Optional[typing.List[MessageAnnotation]] = pydantic.Field(
|
|
23
23
|
description="Retrieval annotations for the message."
|
|
24
24
|
)
|
|
25
|
-
role:
|
|
25
|
+
role: MessageRole = pydantic.Field(description="The role of the message.")
|
|
26
26
|
content: typing.Optional[str]
|
|
27
27
|
additional_kwargs: typing.Optional[typing.Dict[str, str]] = pydantic.Field(
|
|
28
28
|
description="Additional arguments passed to the model"
|
|
@@ -26,7 +26,6 @@ class UserOrganizationRole(pydantic.BaseModel):
|
|
|
26
26
|
user_id: str = pydantic.Field(description="The user's ID.")
|
|
27
27
|
organization_id: str = pydantic.Field(description="The organization's ID.")
|
|
28
28
|
project_ids: typing.Optional[typing.List[str]]
|
|
29
|
-
role_id: str = pydantic.Field(description="The role's ID.")
|
|
30
29
|
role: Role = pydantic.Field(description="The role.")
|
|
31
30
|
|
|
32
31
|
def json(self, **kwargs: typing.Any) -> str:
|