llama-cloud 0.1.34__py3-none-any.whl → 0.1.36__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 +54 -2
- llama_cloud/client.py +3 -0
- llama_cloud/resources/__init__.py +6 -0
- llama_cloud/resources/admin/client.py +51 -0
- llama_cloud/resources/beta/client.py +211 -8
- llama_cloud/resources/classifier/client.py +231 -181
- llama_cloud/resources/data_sinks/types/data_sink_update_component.py +2 -0
- llama_cloud/resources/files/client.py +226 -0
- llama_cloud/resources/llama_extract/__init__.py +4 -0
- llama_cloud/resources/llama_extract/client.py +275 -4
- llama_cloud/resources/llama_extract/types/__init__.py +4 -0
- llama_cloud/resources/llama_extract/types/extract_stateless_request_data_schema.py +9 -0
- llama_cloud/resources/llama_extract/types/extract_stateless_request_data_schema_zero_value.py +7 -0
- llama_cloud/resources/parsing/client.py +24 -0
- llama_cloud/resources/users/__init__.py +2 -0
- llama_cloud/resources/users/client.py +155 -0
- llama_cloud/types/__init__.py +48 -2
- llama_cloud/types/classification_result.py +4 -5
- llama_cloud/types/classifier_rule.py +43 -0
- llama_cloud/types/classify_job.py +45 -0
- llama_cloud/types/{classify_response.py → classify_job_results.py} +3 -6
- llama_cloud/types/classify_job_with_status.py +47 -0
- llama_cloud/types/classify_parsing_configuration.py +38 -0
- llama_cloud/types/cloud_astra_db_vector_store.py +51 -0
- llama_cloud/types/cloud_confluence_data_source.py +15 -0
- llama_cloud/types/configurable_data_sink_names.py +4 -0
- llama_cloud/types/data_sink_component.py +2 -0
- llama_cloud/types/data_sink_create_component.py +2 -0
- llama_cloud/types/data_source_reader_version_metadata.py +2 -1
- llama_cloud/types/data_source_reader_version_metadata_reader_version.py +17 -0
- llama_cloud/types/extract_agent.py +3 -0
- llama_cloud/types/extract_config.py +4 -0
- llama_cloud/types/failure_handling_config.py +37 -0
- llama_cloud/types/file_classification.py +41 -0
- llama_cloud/types/file_data.py +36 -0
- llama_cloud/types/file_store_info_response.py +34 -0
- llama_cloud/types/file_store_info_response_status.py +25 -0
- llama_cloud/types/legacy_parse_job_config.py +3 -0
- llama_cloud/types/llama_extract_settings.py +4 -0
- llama_cloud/types/llama_parse_parameters.py +3 -0
- llama_cloud/types/managed_open_ai_embedding.py +36 -0
- llama_cloud/types/managed_open_ai_embedding_config.py +34 -0
- llama_cloud/types/multimodal_parse_resolution.py +17 -0
- llama_cloud/types/paginated_response_quota_configuration.py +36 -0
- llama_cloud/types/parse_job_config.py +3 -0
- llama_cloud/types/pipeline_embedding_config.py +11 -0
- llama_cloud/types/quota_configuration.py +53 -0
- llama_cloud/types/quota_configuration_configuration_type.py +33 -0
- llama_cloud/types/quota_configuration_status.py +21 -0
- llama_cloud/types/quota_rate_limit_configuration_value.py +38 -0
- llama_cloud/types/quota_rate_limit_configuration_value_denominator_units.py +29 -0
- llama_cloud/types/supported_llm_model_names.py +12 -0
- llama_cloud/types/update_user_response.py +33 -0
- llama_cloud/types/usage_response_active_alerts_item.py +4 -0
- llama_cloud/types/user_summary.py +38 -0
- llama_cloud/types/webhook_configuration_webhook_events_item.py +20 -0
- {llama_cloud-0.1.34.dist-info → llama_cloud-0.1.36.dist-info}/METADATA +2 -4
- {llama_cloud-0.1.34.dist-info → llama_cloud-0.1.36.dist-info}/RECORD +60 -34
- {llama_cloud-0.1.34.dist-info → llama_cloud-0.1.36.dist-info}/WHEEL +1 -1
- {llama_cloud-0.1.34.dist-info → llama_cloud-0.1.36.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
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 .parser_languages import ParserLanguages
|
|
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 ClassifyParsingConfiguration(pydantic.BaseModel):
|
|
19
|
+
"""
|
|
20
|
+
Parsing configuration for a classify job.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
lang: typing.Optional[ParserLanguages] = pydantic.Field(description="The language to parse the files in")
|
|
24
|
+
max_pages: typing.Optional[int]
|
|
25
|
+
target_pages: typing.Optional[typing.List[int]]
|
|
26
|
+
|
|
27
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
28
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
29
|
+
return super().json(**kwargs_with_defaults)
|
|
30
|
+
|
|
31
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
32
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
|
+
return super().dict(**kwargs_with_defaults)
|
|
34
|
+
|
|
35
|
+
class Config:
|
|
36
|
+
frozen = True
|
|
37
|
+
smart_union = True
|
|
38
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 CloudAstraDbVectorStore(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Cloud AstraDB Vector Store.
|
|
20
|
+
|
|
21
|
+
This class is used to store the configuration for an AstraDB vector store, so that it can be
|
|
22
|
+
created and used in LlamaCloud.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
token (str): The Astra DB Application Token to use.
|
|
26
|
+
api_endpoint (str): The Astra DB JSON API endpoint for your database.
|
|
27
|
+
collection_name (str): Collection name to use. If not existing, it will be created.
|
|
28
|
+
embedding_dimension (int): Length of the embedding vectors in use.
|
|
29
|
+
keyspace (optional[str]): The keyspace to use. If not provided, 'default_keyspace'
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
supports_nested_metadata_filters: typing.Optional[bool]
|
|
33
|
+
token: str = pydantic.Field(description="The Astra DB Application Token to use")
|
|
34
|
+
api_endpoint: str = pydantic.Field(description="The Astra DB JSON API endpoint for your database")
|
|
35
|
+
collection_name: str = pydantic.Field(description="Collection name to use. If not existing, it will be created")
|
|
36
|
+
embedding_dimension: int = pydantic.Field(description="Length of the embedding vectors in use")
|
|
37
|
+
keyspace: typing.Optional[str]
|
|
38
|
+
class_name: typing.Optional[str]
|
|
39
|
+
|
|
40
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
41
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
42
|
+
return super().json(**kwargs_with_defaults)
|
|
43
|
+
|
|
44
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
45
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
46
|
+
return super().dict(**kwargs_with_defaults)
|
|
47
|
+
|
|
48
|
+
class Config:
|
|
49
|
+
frozen = True
|
|
50
|
+
smart_union = True
|
|
51
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -4,6 +4,7 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .failure_handling_config import FailureHandlingConfig
|
|
7
8
|
|
|
8
9
|
try:
|
|
9
10
|
import pydantic
|
|
@@ -28,6 +29,20 @@ class CloudConfluenceDataSource(pydantic.BaseModel):
|
|
|
28
29
|
label: typing.Optional[str]
|
|
29
30
|
index_restricted_pages: typing.Optional[bool] = pydantic.Field(description="Whether to index restricted pages.")
|
|
30
31
|
keep_markdown_format: typing.Optional[bool] = pydantic.Field(description="Whether to keep the markdown format.")
|
|
32
|
+
failure_handling: typing.Optional[FailureHandlingConfig] = pydantic.Field(
|
|
33
|
+
description=(
|
|
34
|
+
"Configuration for handling failures during processing. Key-value object controlling failure handling behaviors.\n"
|
|
35
|
+
"\n"
|
|
36
|
+
"Example:\n"
|
|
37
|
+
"{\n"
|
|
38
|
+
'"skip_list_failures": true\n'
|
|
39
|
+
"}\n"
|
|
40
|
+
"\n"
|
|
41
|
+
"Currently supports:\n"
|
|
42
|
+
"\n"
|
|
43
|
+
"- skip_list_failures: Skip failed batches/lists and continue processing\n"
|
|
44
|
+
)
|
|
45
|
+
)
|
|
31
46
|
class_name: typing.Optional[str]
|
|
32
47
|
|
|
33
48
|
def json(self, **kwargs: typing.Any) -> str:
|
|
@@ -13,6 +13,7 @@ class ConfigurableDataSinkNames(str, enum.Enum):
|
|
|
13
13
|
AZUREAI_SEARCH = "AZUREAI_SEARCH"
|
|
14
14
|
MONGODB_ATLAS = "MONGODB_ATLAS"
|
|
15
15
|
MILVUS = "MILVUS"
|
|
16
|
+
ASTRA_DB = "ASTRA_DB"
|
|
16
17
|
|
|
17
18
|
def visit(
|
|
18
19
|
self,
|
|
@@ -22,6 +23,7 @@ class ConfigurableDataSinkNames(str, enum.Enum):
|
|
|
22
23
|
azureai_search: typing.Callable[[], T_Result],
|
|
23
24
|
mongodb_atlas: typing.Callable[[], T_Result],
|
|
24
25
|
milvus: typing.Callable[[], T_Result],
|
|
26
|
+
astra_db: typing.Callable[[], T_Result],
|
|
25
27
|
) -> T_Result:
|
|
26
28
|
if self is ConfigurableDataSinkNames.PINECONE:
|
|
27
29
|
return pinecone()
|
|
@@ -35,3 +37,5 @@ class ConfigurableDataSinkNames(str, enum.Enum):
|
|
|
35
37
|
return mongodb_atlas()
|
|
36
38
|
if self is ConfigurableDataSinkNames.MILVUS:
|
|
37
39
|
return milvus()
|
|
40
|
+
if self is ConfigurableDataSinkNames.ASTRA_DB:
|
|
41
|
+
return astra_db()
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from .cloud_astra_db_vector_store import CloudAstraDbVectorStore
|
|
5
6
|
from .cloud_azure_ai_search_vector_store import CloudAzureAiSearchVectorStore
|
|
6
7
|
from .cloud_milvus_vector_store import CloudMilvusVectorStore
|
|
7
8
|
from .cloud_mongo_db_atlas_vector_search import CloudMongoDbAtlasVectorSearch
|
|
@@ -17,4 +18,5 @@ DataSinkComponent = typing.Union[
|
|
|
17
18
|
CloudAzureAiSearchVectorStore,
|
|
18
19
|
CloudMongoDbAtlasVectorSearch,
|
|
19
20
|
CloudMilvusVectorStore,
|
|
21
|
+
CloudAstraDbVectorStore,
|
|
20
22
|
]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
+
from .cloud_astra_db_vector_store import CloudAstraDbVectorStore
|
|
5
6
|
from .cloud_azure_ai_search_vector_store import CloudAzureAiSearchVectorStore
|
|
6
7
|
from .cloud_milvus_vector_store import CloudMilvusVectorStore
|
|
7
8
|
from .cloud_mongo_db_atlas_vector_search import CloudMongoDbAtlasVectorSearch
|
|
@@ -17,4 +18,5 @@ DataSinkCreateComponent = typing.Union[
|
|
|
17
18
|
CloudAzureAiSearchVectorStore,
|
|
18
19
|
CloudMongoDbAtlasVectorSearch,
|
|
19
20
|
CloudMilvusVectorStore,
|
|
21
|
+
CloudAstraDbVectorStore,
|
|
20
22
|
]
|
|
@@ -4,6 +4,7 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .data_source_reader_version_metadata_reader_version import DataSourceReaderVersionMetadataReaderVersion
|
|
7
8
|
|
|
8
9
|
try:
|
|
9
10
|
import pydantic
|
|
@@ -15,7 +16,7 @@ except ImportError:
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class DataSourceReaderVersionMetadata(pydantic.BaseModel):
|
|
18
|
-
reader_version: typing.Optional[
|
|
19
|
+
reader_version: typing.Optional[DataSourceReaderVersionMetadataReaderVersion]
|
|
19
20
|
|
|
20
21
|
def json(self, **kwargs: typing.Any) -> str:
|
|
21
22
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 DataSourceReaderVersionMetadataReaderVersion(str, enum.Enum):
|
|
10
|
+
ONE_0 = "1.0"
|
|
11
|
+
TWO_0 = "2.0"
|
|
12
|
+
|
|
13
|
+
def visit(self, one_0: typing.Callable[[], T_Result], two_0: typing.Callable[[], T_Result]) -> T_Result:
|
|
14
|
+
if self is DataSourceReaderVersionMetadataReaderVersion.ONE_0:
|
|
15
|
+
return one_0()
|
|
16
|
+
if self is DataSourceReaderVersionMetadataReaderVersion.TWO_0:
|
|
17
|
+
return two_0()
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import datetime as dt
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
|
+
import typing_extensions
|
|
7
|
+
|
|
6
8
|
from ..core.datetime_utils import serialize_datetime
|
|
7
9
|
from .extract_agent_data_schema_value import ExtractAgentDataSchemaValue
|
|
8
10
|
from .extract_config import ExtractConfig
|
|
@@ -28,6 +30,7 @@ class ExtractAgent(pydantic.BaseModel):
|
|
|
28
30
|
description="The schema of the data."
|
|
29
31
|
)
|
|
30
32
|
config: ExtractConfig = pydantic.Field(description="The configuration parameters for the extraction agent.")
|
|
33
|
+
custom_configuration: typing.Optional[typing_extensions.Literal["default"]]
|
|
31
34
|
created_at: typing.Optional[dt.datetime]
|
|
32
35
|
updated_at: typing.Optional[dt.datetime]
|
|
33
36
|
|
|
@@ -38,9 +38,13 @@ class ExtractConfig(pydantic.BaseModel):
|
|
|
38
38
|
chunk_mode: typing.Optional[DocumentChunkMode] = pydantic.Field(
|
|
39
39
|
description="The mode to use for chunking the document."
|
|
40
40
|
)
|
|
41
|
+
high_resolution_mode: typing.Optional[bool] = pydantic.Field(
|
|
42
|
+
description="Whether to use high resolution mode for the extraction."
|
|
43
|
+
)
|
|
41
44
|
invalidate_cache: typing.Optional[bool] = pydantic.Field(
|
|
42
45
|
description="Whether to invalidate the cache for the extraction."
|
|
43
46
|
)
|
|
47
|
+
page_range: typing.Optional[str]
|
|
44
48
|
|
|
45
49
|
def json(self, **kwargs: typing.Any) -> str:
|
|
46
50
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 FailureHandlingConfig(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Configuration for handling different types of failures during data source processing.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
skip_list_failures: typing.Optional[bool] = pydantic.Field(
|
|
23
|
+
description="Whether to skip failed batches/lists and continue processing"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
27
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
28
|
+
return super().json(**kwargs_with_defaults)
|
|
29
|
+
|
|
30
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
31
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
32
|
+
return super().dict(**kwargs_with_defaults)
|
|
33
|
+
|
|
34
|
+
class Config:
|
|
35
|
+
frozen = True
|
|
36
|
+
smart_union = True
|
|
37
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 .classification_result import ClassificationResult
|
|
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 FileClassification(pydantic.BaseModel):
|
|
19
|
+
"""
|
|
20
|
+
A file classification.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
id: str = pydantic.Field(description="Unique identifier")
|
|
24
|
+
created_at: typing.Optional[dt.datetime]
|
|
25
|
+
updated_at: typing.Optional[dt.datetime]
|
|
26
|
+
classify_job_id: str = pydantic.Field(description="The ID of the classify job")
|
|
27
|
+
file_id: str = pydantic.Field(description="The ID of the classified file")
|
|
28
|
+
result: typing.Optional[ClassificationResult]
|
|
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}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 FileData(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Schema for file data with base64 content and MIME type.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
data: str = pydantic.Field(description="The file content as base64-encoded string")
|
|
23
|
+
mime_type: str = pydantic.Field(description="The MIME type of the file (e.g., 'application/pdf', 'text/plain')")
|
|
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}
|
|
@@ -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 .file_store_info_response_status import FileStoreInfoResponseStatus
|
|
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 FileStoreInfoResponse(pydantic.BaseModel):
|
|
19
|
+
available_buckets: typing.Optional[typing.Dict[str, str]]
|
|
20
|
+
unavailable_buckets: typing.Optional[typing.Dict[str, str]]
|
|
21
|
+
status: FileStoreInfoResponseStatus
|
|
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}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 FileStoreInfoResponseStatus(str, enum.Enum):
|
|
10
|
+
OK = "ok"
|
|
11
|
+
MISSING_BUCKETS = "missing_buckets"
|
|
12
|
+
MISSING_CREDENTIALS = "missing_credentials"
|
|
13
|
+
|
|
14
|
+
def visit(
|
|
15
|
+
self,
|
|
16
|
+
ok: typing.Callable[[], T_Result],
|
|
17
|
+
missing_buckets: typing.Callable[[], T_Result],
|
|
18
|
+
missing_credentials: typing.Callable[[], T_Result],
|
|
19
|
+
) -> T_Result:
|
|
20
|
+
if self is FileStoreInfoResponseStatus.OK:
|
|
21
|
+
return ok()
|
|
22
|
+
if self is FileStoreInfoResponseStatus.MISSING_BUCKETS:
|
|
23
|
+
return missing_buckets()
|
|
24
|
+
if self is FileStoreInfoResponseStatus.MISSING_CREDENTIALS:
|
|
25
|
+
return missing_credentials()
|
|
@@ -43,6 +43,9 @@ class LegacyParseJobConfig(pydantic.BaseModel):
|
|
|
43
43
|
preserve_layout_alignment_across_pages: typing.Optional[bool] = pydantic.Field(
|
|
44
44
|
alias="preserveLayoutAlignmentAcrossPages", description="Whether to preserve layout alignment across pages."
|
|
45
45
|
)
|
|
46
|
+
preserve_very_small_text: typing.Optional[bool] = pydantic.Field(
|
|
47
|
+
alias="preserveVerySmallText", description="Whether to preserve very small text lines."
|
|
48
|
+
)
|
|
46
49
|
invalidate_cache: bool = pydantic.Field(alias="invalidateCache", description="Whether to invalidate the cache.")
|
|
47
50
|
output_pdf_of_document: typing.Optional[bool] = pydantic.Field(alias="outputPDFOfDocument")
|
|
48
51
|
outlined_table_extraction: typing.Optional[bool] = pydantic.Field(alias="outlinedTableExtraction")
|
|
@@ -6,6 +6,7 @@ import typing
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
7
|
from .chunk_mode import ChunkMode
|
|
8
8
|
from .llama_parse_parameters import LlamaParseParameters
|
|
9
|
+
from .multimodal_parse_resolution import MultimodalParseResolution
|
|
9
10
|
from .struct_parse_conf import StructParseConf
|
|
10
11
|
|
|
11
12
|
try:
|
|
@@ -48,6 +49,9 @@ class LlamaExtractSettings(pydantic.BaseModel):
|
|
|
48
49
|
llama_parse_params: typing.Optional[LlamaParseParameters] = pydantic.Field(
|
|
49
50
|
description="LlamaParse related settings."
|
|
50
51
|
)
|
|
52
|
+
multimodal_parse_resolution: typing.Optional[MultimodalParseResolution] = pydantic.Field(
|
|
53
|
+
description="The resolution to use for multimodal parsing."
|
|
54
|
+
)
|
|
51
55
|
|
|
52
56
|
def json(self, **kwargs: typing.Any) -> str:
|
|
53
57
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
@@ -8,6 +8,7 @@ from .fail_page_mode import FailPageMode
|
|
|
8
8
|
from .llama_parse_parameters_priority import LlamaParseParametersPriority
|
|
9
9
|
from .parser_languages import ParserLanguages
|
|
10
10
|
from .parsing_mode import ParsingMode
|
|
11
|
+
from .webhook_configuration import WebhookConfiguration
|
|
11
12
|
|
|
12
13
|
try:
|
|
13
14
|
import pydantic
|
|
@@ -23,6 +24,7 @@ class LlamaParseParameters(pydantic.BaseModel):
|
|
|
23
24
|
Settings that can be configured for how to use LlamaParse to parse files within a LlamaCloud pipeline.
|
|
24
25
|
"""
|
|
25
26
|
|
|
27
|
+
webhook_configurations: typing.Optional[typing.List[WebhookConfiguration]]
|
|
26
28
|
priority: typing.Optional[LlamaParseParametersPriority]
|
|
27
29
|
languages: typing.Optional[typing.List[ParserLanguages]]
|
|
28
30
|
parsing_instruction: typing.Optional[str]
|
|
@@ -40,6 +42,7 @@ class LlamaParseParameters(pydantic.BaseModel):
|
|
|
40
42
|
fast_mode: typing.Optional[bool]
|
|
41
43
|
skip_diagonal_text: typing.Optional[bool]
|
|
42
44
|
preserve_layout_alignment_across_pages: typing.Optional[bool]
|
|
45
|
+
preserve_very_small_text: typing.Optional[bool]
|
|
43
46
|
gpt_4_o_mode: typing.Optional[bool] = pydantic.Field(alias="gpt4o_mode")
|
|
44
47
|
gpt_4_o_api_key: typing.Optional[str] = pydantic.Field(alias="gpt4o_api_key")
|
|
45
48
|
do_not_unroll_columns: typing.Optional[bool]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import typing_extensions
|
|
7
|
+
|
|
8
|
+
from ..core.datetime_utils import serialize_datetime
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import pydantic
|
|
12
|
+
if pydantic.__version__.startswith("1."):
|
|
13
|
+
raise ImportError
|
|
14
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
15
|
+
except ImportError:
|
|
16
|
+
import pydantic # type: ignore
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ManagedOpenAiEmbedding(pydantic.BaseModel):
|
|
20
|
+
model_name: typing.Optional[typing_extensions.Literal["openai-text-embedding-3-small"]]
|
|
21
|
+
embed_batch_size: typing.Optional[int] = pydantic.Field(description="The batch size for embedding calls.")
|
|
22
|
+
num_workers: typing.Optional[int]
|
|
23
|
+
class_name: typing.Optional[str]
|
|
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}
|
|
@@ -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 .managed_open_ai_embedding import ManagedOpenAiEmbedding
|
|
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 ManagedOpenAiEmbeddingConfig(pydantic.BaseModel):
|
|
19
|
+
component: typing.Optional[ManagedOpenAiEmbedding] = pydantic.Field(
|
|
20
|
+
description="Configuration for the Managed OpenAI embedding model."
|
|
21
|
+
)
|
|
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}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 MultimodalParseResolution(str, enum.Enum):
|
|
10
|
+
MEDIUM = "medium"
|
|
11
|
+
HIGH = "high"
|
|
12
|
+
|
|
13
|
+
def visit(self, medium: typing.Callable[[], T_Result], high: typing.Callable[[], T_Result]) -> T_Result:
|
|
14
|
+
if self is MultimodalParseResolution.MEDIUM:
|
|
15
|
+
return medium()
|
|
16
|
+
if self is MultimodalParseResolution.HIGH:
|
|
17
|
+
return high()
|
|
@@ -0,0 +1,36 @@
|
|
|
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 .quota_configuration import QuotaConfiguration
|
|
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 PaginatedResponseQuotaConfiguration(pydantic.BaseModel):
|
|
19
|
+
total: int
|
|
20
|
+
page: int
|
|
21
|
+
size: int
|
|
22
|
+
pages: int
|
|
23
|
+
items: typing.List[QuotaConfiguration]
|
|
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}
|
|
@@ -8,6 +8,7 @@ from .fail_page_mode import FailPageMode
|
|
|
8
8
|
from .parse_job_config_priority import ParseJobConfigPriority
|
|
9
9
|
from .parser_languages import ParserLanguages
|
|
10
10
|
from .parsing_mode import ParsingMode
|
|
11
|
+
from .webhook_configuration import WebhookConfiguration
|
|
11
12
|
|
|
12
13
|
try:
|
|
13
14
|
import pydantic
|
|
@@ -23,6 +24,7 @@ class ParseJobConfig(pydantic.BaseModel):
|
|
|
23
24
|
Configuration for llamaparse job
|
|
24
25
|
"""
|
|
25
26
|
|
|
27
|
+
webhook_configurations: typing.Optional[typing.List[WebhookConfiguration]]
|
|
26
28
|
priority: typing.Optional[ParseJobConfigPriority]
|
|
27
29
|
custom_metadata: typing.Optional[typing.Dict[str, typing.Any]]
|
|
28
30
|
resource_info: typing.Optional[typing.Dict[str, typing.Any]]
|
|
@@ -42,6 +44,7 @@ class ParseJobConfig(pydantic.BaseModel):
|
|
|
42
44
|
fast_mode: typing.Optional[bool]
|
|
43
45
|
skip_diagonal_text: typing.Optional[bool]
|
|
44
46
|
preserve_layout_alignment_across_pages: typing.Optional[bool]
|
|
47
|
+
preserve_very_small_text: typing.Optional[bool]
|
|
45
48
|
gpt_4_o_mode: typing.Optional[bool] = pydantic.Field(alias="gpt4o_mode")
|
|
46
49
|
gpt_4_o_api_key: typing.Optional[str] = pydantic.Field(alias="gpt4o_api_key")
|
|
47
50
|
do_not_unroll_columns: typing.Optional[bool]
|
|
@@ -11,6 +11,7 @@ from .bedrock_embedding_config import BedrockEmbeddingConfig
|
|
|
11
11
|
from .cohere_embedding_config import CohereEmbeddingConfig
|
|
12
12
|
from .gemini_embedding_config import GeminiEmbeddingConfig
|
|
13
13
|
from .hugging_face_inference_api_embedding_config import HuggingFaceInferenceApiEmbeddingConfig
|
|
14
|
+
from .managed_open_ai_embedding_config import ManagedOpenAiEmbeddingConfig
|
|
14
15
|
from .open_ai_embedding_config import OpenAiEmbeddingConfig
|
|
15
16
|
from .vertex_ai_embedding_config import VertexAiEmbeddingConfig
|
|
16
17
|
|
|
@@ -60,6 +61,15 @@ class PipelineEmbeddingConfig_HuggingfaceApiEmbedding(HuggingFaceInferenceApiEmb
|
|
|
60
61
|
allow_population_by_field_name = True
|
|
61
62
|
|
|
62
63
|
|
|
64
|
+
class PipelineEmbeddingConfig_ManagedOpenaiEmbedding(ManagedOpenAiEmbeddingConfig):
|
|
65
|
+
type: typing_extensions.Literal["MANAGED_OPENAI_EMBEDDING"]
|
|
66
|
+
|
|
67
|
+
class Config:
|
|
68
|
+
frozen = True
|
|
69
|
+
smart_union = True
|
|
70
|
+
allow_population_by_field_name = True
|
|
71
|
+
|
|
72
|
+
|
|
63
73
|
class PipelineEmbeddingConfig_OpenaiEmbedding(OpenAiEmbeddingConfig):
|
|
64
74
|
type: typing_extensions.Literal["OPENAI_EMBEDDING"]
|
|
65
75
|
|
|
@@ -84,6 +94,7 @@ PipelineEmbeddingConfig = typing.Union[
|
|
|
84
94
|
PipelineEmbeddingConfig_CohereEmbedding,
|
|
85
95
|
PipelineEmbeddingConfig_GeminiEmbedding,
|
|
86
96
|
PipelineEmbeddingConfig_HuggingfaceApiEmbedding,
|
|
97
|
+
PipelineEmbeddingConfig_ManagedOpenaiEmbedding,
|
|
87
98
|
PipelineEmbeddingConfig_OpenaiEmbedding,
|
|
88
99
|
PipelineEmbeddingConfig_VertexaiEmbedding,
|
|
89
100
|
]
|