llama-cloud 0.1.39__py3-none-any.whl → 0.1.41__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.
- llama_cloud/__init__.py +24 -72
- llama_cloud/client.py +2 -5
- llama_cloud/resources/__init__.py +0 -4
- llama_cloud/resources/admin/client.py +5 -5
- llama_cloud/resources/beta/client.py +1351 -335
- llama_cloud/resources/llama_extract/client.py +56 -0
- llama_cloud/resources/parsing/client.py +8 -0
- llama_cloud/resources/pipelines/client.py +37 -0
- llama_cloud/types/__init__.py +24 -72
- llama_cloud/types/{src_app_schema_chat_chat_message.py → chat_message.py} +1 -1
- llama_cloud/types/extract_config.py +8 -2
- llama_cloud/types/extract_job_create.py +2 -0
- llama_cloud/types/extract_job_create_priority.py +29 -0
- llama_cloud/types/extract_models.py +28 -28
- llama_cloud/types/job_names.py +0 -4
- llama_cloud/types/{document_block.py → llama_extract_feature_availability.py} +5 -6
- llama_cloud/types/llama_extract_mode_availability.py +4 -3
- llama_cloud/types/llama_extract_settings.py +1 -1
- llama_cloud/types/llama_parse_parameters.py +1 -0
- llama_cloud/types/{progress_event.py → parse_configuration.py} +12 -12
- llama_cloud/types/{llama_index_core_base_llms_types_chat_message.py → parse_configuration_create.py} +9 -7
- llama_cloud/types/{edit_suggestion.py → parse_configuration_filter.py} +8 -6
- llama_cloud/types/{report_update_event.py → parse_configuration_query_response.py} +6 -6
- llama_cloud/types/parse_job_config.py +1 -0
- llama_cloud/types/pipeline.py +4 -0
- llama_cloud/types/pipeline_create.py +2 -0
- llama_cloud/types/playground_session.py +2 -2
- llama_cloud/types/public_model_name.py +97 -0
- llama_cloud/types/{report_create_response.py → schema_generation_availability.py} +4 -2
- llama_cloud/types/schema_generation_availability_status.py +17 -0
- llama_cloud/types/{report_event_item.py → sparse_model_config.py} +10 -8
- llama_cloud/types/sparse_model_type.py +33 -0
- llama_cloud/types/webhook_configuration.py +1 -0
- llama_cloud-0.1.41.dist-info/METADATA +106 -0
- {llama_cloud-0.1.39.dist-info → llama_cloud-0.1.41.dist-info}/RECORD +37 -56
- {llama_cloud-0.1.39.dist-info → llama_cloud-0.1.41.dist-info}/WHEEL +1 -1
- llama_cloud/resources/reports/__init__.py +0 -5
- llama_cloud/resources/reports/client.py +0 -1230
- llama_cloud/resources/reports/types/__init__.py +0 -7
- llama_cloud/resources/reports/types/update_report_plan_api_v_1_reports_report_id_plan_patch_request_action.py +0 -25
- llama_cloud/types/audio_block.py +0 -34
- llama_cloud/types/edit_suggestion_blocks_item.py +0 -8
- llama_cloud/types/image_block.py +0 -35
- llama_cloud/types/llama_index_core_base_llms_types_chat_message_blocks_item.py +0 -56
- llama_cloud/types/paginated_report_response.py +0 -35
- llama_cloud/types/progress_event_status.py +0 -33
- llama_cloud/types/report.py +0 -33
- llama_cloud/types/report_block.py +0 -35
- llama_cloud/types/report_block_dependency.py +0 -29
- llama_cloud/types/report_event_item_event_data.py +0 -45
- llama_cloud/types/report_event_type.py +0 -37
- llama_cloud/types/report_metadata.py +0 -43
- llama_cloud/types/report_plan.py +0 -36
- llama_cloud/types/report_plan_block.py +0 -36
- llama_cloud/types/report_query.py +0 -33
- llama_cloud/types/report_response.py +0 -41
- llama_cloud/types/report_state.py +0 -37
- llama_cloud/types/report_state_event.py +0 -38
- llama_cloud/types/text_block.py +0 -31
- llama_cloud-0.1.39.dist-info/METADATA +0 -32
- {llama_cloud-0.1.39.dist-info → llama_cloud-0.1.41.dist-info}/LICENSE +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from .update_report_plan_api_v_1_reports_report_id_plan_patch_request_action import (
|
|
4
|
-
UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction,
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
__all__ = ["UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction"]
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import enum
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
T_Result = typing.TypeVar("T_Result")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction(str, enum.Enum):
|
|
10
|
-
APPROVE = "approve"
|
|
11
|
-
REJECT = "reject"
|
|
12
|
-
EDIT = "edit"
|
|
13
|
-
|
|
14
|
-
def visit(
|
|
15
|
-
self,
|
|
16
|
-
approve: typing.Callable[[], T_Result],
|
|
17
|
-
reject: typing.Callable[[], T_Result],
|
|
18
|
-
edit: typing.Callable[[], T_Result],
|
|
19
|
-
) -> T_Result:
|
|
20
|
-
if self is UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.APPROVE:
|
|
21
|
-
return approve()
|
|
22
|
-
if self is UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.REJECT:
|
|
23
|
-
return reject()
|
|
24
|
-
if self is UpdateReportPlanApiV1ReportsReportIdPlanPatchRequestAction.EDIT:
|
|
25
|
-
return edit()
|
llama_cloud/types/audio_block.py
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
try:
|
|
9
|
-
import pydantic
|
|
10
|
-
if pydantic.__version__.startswith("1."):
|
|
11
|
-
raise ImportError
|
|
12
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
13
|
-
except ImportError:
|
|
14
|
-
import pydantic # type: ignore
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class AudioBlock(pydantic.BaseModel):
|
|
18
|
-
audio: typing.Optional[str]
|
|
19
|
-
path: typing.Optional[str]
|
|
20
|
-
url: typing.Optional[str]
|
|
21
|
-
format: typing.Optional[str]
|
|
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}
|
llama_cloud/types/image_block.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
try:
|
|
9
|
-
import pydantic
|
|
10
|
-
if pydantic.__version__.startswith("1."):
|
|
11
|
-
raise ImportError
|
|
12
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
13
|
-
except ImportError:
|
|
14
|
-
import pydantic # type: ignore
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ImageBlock(pydantic.BaseModel):
|
|
18
|
-
image: typing.Optional[str]
|
|
19
|
-
path: typing.Optional[str]
|
|
20
|
-
url: typing.Optional[str]
|
|
21
|
-
image_mimetype: typing.Optional[str]
|
|
22
|
-
detail: typing.Optional[str]
|
|
23
|
-
|
|
24
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
26
|
-
return super().json(**kwargs_with_defaults)
|
|
27
|
-
|
|
28
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
29
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
30
|
-
return super().dict(**kwargs_with_defaults)
|
|
31
|
-
|
|
32
|
-
class Config:
|
|
33
|
-
frozen = True
|
|
34
|
-
smart_union = True
|
|
35
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import typing
|
|
6
|
-
|
|
7
|
-
import typing_extensions
|
|
8
|
-
|
|
9
|
-
from .audio_block import AudioBlock
|
|
10
|
-
from .document_block import DocumentBlock
|
|
11
|
-
from .image_block import ImageBlock
|
|
12
|
-
from .text_block import TextBlock
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Audio(AudioBlock):
|
|
16
|
-
block_type: typing_extensions.Literal["audio"]
|
|
17
|
-
|
|
18
|
-
class Config:
|
|
19
|
-
frozen = True
|
|
20
|
-
smart_union = True
|
|
21
|
-
allow_population_by_field_name = True
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Document(DocumentBlock):
|
|
25
|
-
block_type: typing_extensions.Literal["document"]
|
|
26
|
-
|
|
27
|
-
class Config:
|
|
28
|
-
frozen = True
|
|
29
|
-
smart_union = True
|
|
30
|
-
allow_population_by_field_name = True
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Image(ImageBlock):
|
|
34
|
-
block_type: typing_extensions.Literal["image"]
|
|
35
|
-
|
|
36
|
-
class Config:
|
|
37
|
-
frozen = True
|
|
38
|
-
smart_union = True
|
|
39
|
-
allow_population_by_field_name = True
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text(TextBlock):
|
|
43
|
-
block_type: typing_extensions.Literal["text"]
|
|
44
|
-
|
|
45
|
-
class Config:
|
|
46
|
-
frozen = True
|
|
47
|
-
smart_union = True
|
|
48
|
-
allow_population_by_field_name = True
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem = typing.Union[
|
|
52
|
-
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Audio,
|
|
53
|
-
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Document,
|
|
54
|
-
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Image,
|
|
55
|
-
LlamaIndexCoreBaseLlmsTypesChatMessageBlocksItem_Text,
|
|
56
|
-
]
|
|
@@ -1,35 +0,0 @@
|
|
|
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 .report_response import ReportResponse
|
|
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 PaginatedReportResponse(pydantic.BaseModel):
|
|
19
|
-
report_responses: typing.List[ReportResponse]
|
|
20
|
-
limit: int
|
|
21
|
-
offset: int
|
|
22
|
-
total_count: int
|
|
23
|
-
|
|
24
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
26
|
-
return super().json(**kwargs_with_defaults)
|
|
27
|
-
|
|
28
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
29
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
30
|
-
return super().dict(**kwargs_with_defaults)
|
|
31
|
-
|
|
32
|
-
class Config:
|
|
33
|
-
frozen = True
|
|
34
|
-
smart_union = True
|
|
35
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import enum
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
T_Result = typing.TypeVar("T_Result")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ProgressEventStatus(str, enum.Enum):
|
|
10
|
-
"""
|
|
11
|
-
Current status of the operation
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
PENDING = "pending"
|
|
15
|
-
IN_PROGRESS = "in_progress"
|
|
16
|
-
COMPLETED = "completed"
|
|
17
|
-
ERROR = "error"
|
|
18
|
-
|
|
19
|
-
def visit(
|
|
20
|
-
self,
|
|
21
|
-
pending: typing.Callable[[], T_Result],
|
|
22
|
-
in_progress: typing.Callable[[], T_Result],
|
|
23
|
-
completed: typing.Callable[[], T_Result],
|
|
24
|
-
error: typing.Callable[[], T_Result],
|
|
25
|
-
) -> T_Result:
|
|
26
|
-
if self is ProgressEventStatus.PENDING:
|
|
27
|
-
return pending()
|
|
28
|
-
if self is ProgressEventStatus.IN_PROGRESS:
|
|
29
|
-
return in_progress()
|
|
30
|
-
if self is ProgressEventStatus.COMPLETED:
|
|
31
|
-
return completed()
|
|
32
|
-
if self is ProgressEventStatus.ERROR:
|
|
33
|
-
return error()
|
llama_cloud/types/report.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
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 .report_block import ReportBlock
|
|
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 Report(pydantic.BaseModel):
|
|
19
|
-
id: str = pydantic.Field(description="The id of the report")
|
|
20
|
-
blocks: typing.Optional[typing.List[ReportBlock]] = pydantic.Field(description="The blocks of the report")
|
|
21
|
-
|
|
22
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
23
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
24
|
-
return super().json(**kwargs_with_defaults)
|
|
25
|
-
|
|
26
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
27
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
28
|
-
return super().dict(**kwargs_with_defaults)
|
|
29
|
-
|
|
30
|
-
class Config:
|
|
31
|
-
frozen = True
|
|
32
|
-
smart_union = True
|
|
33
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,35 +0,0 @@
|
|
|
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 .text_node_with_score import TextNodeWithScore
|
|
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 ReportBlock(pydantic.BaseModel):
|
|
19
|
-
idx: int = pydantic.Field(description="The index of the block")
|
|
20
|
-
template: str = pydantic.Field(description="The content of the block")
|
|
21
|
-
requires_human_review: typing.Optional[bool] = pydantic.Field(description="Whether the block requires human review")
|
|
22
|
-
sources: typing.Optional[typing.List[TextNodeWithScore]] = pydantic.Field(description="The sources for the block")
|
|
23
|
-
|
|
24
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
26
|
-
return super().json(**kwargs_with_defaults)
|
|
27
|
-
|
|
28
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
29
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
30
|
-
return super().dict(**kwargs_with_defaults)
|
|
31
|
-
|
|
32
|
-
class Config:
|
|
33
|
-
frozen = True
|
|
34
|
-
smart_union = True
|
|
35
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import enum
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
T_Result = typing.TypeVar("T_Result")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReportBlockDependency(str, enum.Enum):
|
|
10
|
-
NONE = "none"
|
|
11
|
-
ALL = "all"
|
|
12
|
-
PREVIOUS = "previous"
|
|
13
|
-
NEXT = "next"
|
|
14
|
-
|
|
15
|
-
def visit(
|
|
16
|
-
self,
|
|
17
|
-
none: typing.Callable[[], T_Result],
|
|
18
|
-
all: typing.Callable[[], T_Result],
|
|
19
|
-
previous: typing.Callable[[], T_Result],
|
|
20
|
-
next: typing.Callable[[], T_Result],
|
|
21
|
-
) -> T_Result:
|
|
22
|
-
if self is ReportBlockDependency.NONE:
|
|
23
|
-
return none()
|
|
24
|
-
if self is ReportBlockDependency.ALL:
|
|
25
|
-
return all()
|
|
26
|
-
if self is ReportBlockDependency.PREVIOUS:
|
|
27
|
-
return previous()
|
|
28
|
-
if self is ReportBlockDependency.NEXT:
|
|
29
|
-
return next()
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import typing
|
|
6
|
-
|
|
7
|
-
import typing_extensions
|
|
8
|
-
|
|
9
|
-
from .progress_event import ProgressEvent
|
|
10
|
-
from .report_state_event import ReportStateEvent
|
|
11
|
-
from .report_update_event import ReportUpdateEvent
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class ReportEventItemEventData_Progress(ProgressEvent):
|
|
15
|
-
type: typing_extensions.Literal["progress"]
|
|
16
|
-
|
|
17
|
-
class Config:
|
|
18
|
-
frozen = True
|
|
19
|
-
smart_union = True
|
|
20
|
-
allow_population_by_field_name = True
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class ReportEventItemEventData_ReportBlockUpdate(ReportUpdateEvent):
|
|
24
|
-
type: typing_extensions.Literal["report_block_update"]
|
|
25
|
-
|
|
26
|
-
class Config:
|
|
27
|
-
frozen = True
|
|
28
|
-
smart_union = True
|
|
29
|
-
allow_population_by_field_name = True
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class ReportEventItemEventData_ReportStateUpdate(ReportStateEvent):
|
|
33
|
-
type: typing_extensions.Literal["report_state_update"]
|
|
34
|
-
|
|
35
|
-
class Config:
|
|
36
|
-
frozen = True
|
|
37
|
-
smart_union = True
|
|
38
|
-
allow_population_by_field_name = True
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ReportEventItemEventData = typing.Union[
|
|
42
|
-
ReportEventItemEventData_Progress,
|
|
43
|
-
ReportEventItemEventData_ReportBlockUpdate,
|
|
44
|
-
ReportEventItemEventData_ReportStateUpdate,
|
|
45
|
-
]
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import enum
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
T_Result = typing.TypeVar("T_Result")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReportEventType(str, enum.Enum):
|
|
10
|
-
LOAD_TEMPLATE = "load_template"
|
|
11
|
-
EXTRACT_PLAN = "extract_plan"
|
|
12
|
-
SUMMARIZE = "summarize"
|
|
13
|
-
FILE_PROCESSING = "file_processing"
|
|
14
|
-
GENERATE_BLOCK = "generate_block"
|
|
15
|
-
EDITING = "editing"
|
|
16
|
-
|
|
17
|
-
def visit(
|
|
18
|
-
self,
|
|
19
|
-
load_template: typing.Callable[[], T_Result],
|
|
20
|
-
extract_plan: typing.Callable[[], T_Result],
|
|
21
|
-
summarize: typing.Callable[[], T_Result],
|
|
22
|
-
file_processing: typing.Callable[[], T_Result],
|
|
23
|
-
generate_block: typing.Callable[[], T_Result],
|
|
24
|
-
editing: typing.Callable[[], T_Result],
|
|
25
|
-
) -> T_Result:
|
|
26
|
-
if self is ReportEventType.LOAD_TEMPLATE:
|
|
27
|
-
return load_template()
|
|
28
|
-
if self is ReportEventType.EXTRACT_PLAN:
|
|
29
|
-
return extract_plan()
|
|
30
|
-
if self is ReportEventType.SUMMARIZE:
|
|
31
|
-
return summarize()
|
|
32
|
-
if self is ReportEventType.FILE_PROCESSING:
|
|
33
|
-
return file_processing()
|
|
34
|
-
if self is ReportEventType.GENERATE_BLOCK:
|
|
35
|
-
return generate_block()
|
|
36
|
-
if self is ReportEventType.EDITING:
|
|
37
|
-
return editing()
|
|
@@ -1,43 +0,0 @@
|
|
|
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 .report_state import ReportState
|
|
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 ReportMetadata(pydantic.BaseModel):
|
|
19
|
-
"""
|
|
20
|
-
Used to update the metadata of a report.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
id: str = pydantic.Field(description="The id of the report")
|
|
24
|
-
name: str = pydantic.Field(description="The name of the report")
|
|
25
|
-
report_metadata: typing.Dict[str, typing.Any] = pydantic.Field(description="The metadata for the report")
|
|
26
|
-
state: ReportState = pydantic.Field(description="The state of the report")
|
|
27
|
-
input_files: typing.Optional[typing.List[str]]
|
|
28
|
-
template_file: typing.Optional[str]
|
|
29
|
-
template_text: typing.Optional[str]
|
|
30
|
-
template_instructions: typing.Optional[str]
|
|
31
|
-
|
|
32
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
33
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
34
|
-
return super().json(**kwargs_with_defaults)
|
|
35
|
-
|
|
36
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
37
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
38
|
-
return super().dict(**kwargs_with_defaults)
|
|
39
|
-
|
|
40
|
-
class Config:
|
|
41
|
-
frozen = True
|
|
42
|
-
smart_union = True
|
|
43
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
llama_cloud/types/report_plan.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 .report_plan_block import ReportPlanBlock
|
|
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 ReportPlan(pydantic.BaseModel):
|
|
19
|
-
id: typing.Optional[str] = pydantic.Field(description="The id of the report plan")
|
|
20
|
-
blocks: typing.Optional[typing.List[ReportPlanBlock]] = pydantic.Field(description="The blocks of the report")
|
|
21
|
-
generated_at: typing.Optional[dt.datetime] = pydantic.Field(
|
|
22
|
-
description="The timestamp of when the plan was generated"
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
26
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
27
|
-
return super().json(**kwargs_with_defaults)
|
|
28
|
-
|
|
29
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
30
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
31
|
-
return super().dict(**kwargs_with_defaults)
|
|
32
|
-
|
|
33
|
-
class Config:
|
|
34
|
-
frozen = True
|
|
35
|
-
smart_union = True
|
|
36
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,36 +0,0 @@
|
|
|
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 .report_block import ReportBlock
|
|
8
|
-
from .report_block_dependency import ReportBlockDependency
|
|
9
|
-
from .report_query import ReportQuery
|
|
10
|
-
|
|
11
|
-
try:
|
|
12
|
-
import pydantic
|
|
13
|
-
if pydantic.__version__.startswith("1."):
|
|
14
|
-
raise ImportError
|
|
15
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
16
|
-
except ImportError:
|
|
17
|
-
import pydantic # type: ignore
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ReportPlanBlock(pydantic.BaseModel):
|
|
21
|
-
block: ReportBlock
|
|
22
|
-
queries: typing.Optional[typing.List[ReportQuery]] = pydantic.Field(description="The queries for the block")
|
|
23
|
-
dependency: ReportBlockDependency = pydantic.Field(description="The dependency for the block")
|
|
24
|
-
|
|
25
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
26
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
27
|
-
return super().json(**kwargs_with_defaults)
|
|
28
|
-
|
|
29
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
30
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
31
|
-
return super().dict(**kwargs_with_defaults)
|
|
32
|
-
|
|
33
|
-
class Config:
|
|
34
|
-
frozen = True
|
|
35
|
-
smart_union = True
|
|
36
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
try:
|
|
9
|
-
import pydantic
|
|
10
|
-
if pydantic.__version__.startswith("1."):
|
|
11
|
-
raise ImportError
|
|
12
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
13
|
-
except ImportError:
|
|
14
|
-
import pydantic # type: ignore
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ReportQuery(pydantic.BaseModel):
|
|
18
|
-
field: str = pydantic.Field(description="The field in the template that needs to be filled in")
|
|
19
|
-
prompt: str = pydantic.Field(description="The prompt for filling in the field")
|
|
20
|
-
context: str = pydantic.Field(description="Any additional context for the query")
|
|
21
|
-
|
|
22
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
23
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
24
|
-
return super().json(**kwargs_with_defaults)
|
|
25
|
-
|
|
26
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
27
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
28
|
-
return super().dict(**kwargs_with_defaults)
|
|
29
|
-
|
|
30
|
-
class Config:
|
|
31
|
-
frozen = True
|
|
32
|
-
smart_union = True
|
|
33
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,41 +0,0 @@
|
|
|
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 .report import Report
|
|
8
|
-
from .report_plan import ReportPlan
|
|
9
|
-
from .report_state import ReportState
|
|
10
|
-
|
|
11
|
-
try:
|
|
12
|
-
import pydantic
|
|
13
|
-
if pydantic.__version__.startswith("1."):
|
|
14
|
-
raise ImportError
|
|
15
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
16
|
-
except ImportError:
|
|
17
|
-
import pydantic # type: ignore
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ReportResponse(pydantic.BaseModel):
|
|
21
|
-
name: str
|
|
22
|
-
report_id: str
|
|
23
|
-
report: typing.Optional[Report]
|
|
24
|
-
plan: typing.Optional[ReportPlan]
|
|
25
|
-
version: int
|
|
26
|
-
last_updated: dt.datetime
|
|
27
|
-
status: ReportState
|
|
28
|
-
total_versions: int
|
|
29
|
-
|
|
30
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
31
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
32
|
-
return super().json(**kwargs_with_defaults)
|
|
33
|
-
|
|
34
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
35
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
36
|
-
return super().dict(**kwargs_with_defaults)
|
|
37
|
-
|
|
38
|
-
class Config:
|
|
39
|
-
frozen = True
|
|
40
|
-
smart_union = True
|
|
41
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import enum
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
T_Result = typing.TypeVar("T_Result")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ReportState(str, enum.Enum):
|
|
10
|
-
PENDING = "pending"
|
|
11
|
-
PLANNING = "planning"
|
|
12
|
-
WAITING_APPROVAL = "waiting_approval"
|
|
13
|
-
GENERATING = "generating"
|
|
14
|
-
COMPLETED = "completed"
|
|
15
|
-
ERROR = "error"
|
|
16
|
-
|
|
17
|
-
def visit(
|
|
18
|
-
self,
|
|
19
|
-
pending: typing.Callable[[], T_Result],
|
|
20
|
-
planning: typing.Callable[[], T_Result],
|
|
21
|
-
waiting_approval: typing.Callable[[], T_Result],
|
|
22
|
-
generating: typing.Callable[[], T_Result],
|
|
23
|
-
completed: typing.Callable[[], T_Result],
|
|
24
|
-
error: typing.Callable[[], T_Result],
|
|
25
|
-
) -> T_Result:
|
|
26
|
-
if self is ReportState.PENDING:
|
|
27
|
-
return pending()
|
|
28
|
-
if self is ReportState.PLANNING:
|
|
29
|
-
return planning()
|
|
30
|
-
if self is ReportState.WAITING_APPROVAL:
|
|
31
|
-
return waiting_approval()
|
|
32
|
-
if self is ReportState.GENERATING:
|
|
33
|
-
return generating()
|
|
34
|
-
if self is ReportState.COMPLETED:
|
|
35
|
-
return completed()
|
|
36
|
-
if self is ReportState.ERROR:
|
|
37
|
-
return error()
|