llama-cloud 0.1.42__py3-none-any.whl → 0.1.43__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.

Files changed (29) hide show
  1. llama_cloud/__init__.py +13 -19
  2. llama_cloud/resources/__init__.py +6 -0
  3. llama_cloud/resources/beta/client.py +555 -0
  4. llama_cloud/resources/jobs/client.py +0 -8
  5. llama_cloud/resources/llama_extract/__init__.py +6 -0
  6. llama_cloud/resources/llama_extract/client.py +825 -941
  7. llama_cloud/resources/llama_extract/types/__init__.py +6 -0
  8. llama_cloud/types/__init__.py +10 -22
  9. llama_cloud/types/{prompt_conf.py → delete_response.py} +6 -9
  10. llama_cloud/types/extract_config.py +1 -0
  11. llama_cloud/types/extract_models.py +4 -0
  12. llama_cloud/types/{extract_job_create.py → extracted_table.py} +8 -14
  13. llama_cloud/types/paginated_response_spreadsheet_job.py +34 -0
  14. llama_cloud/types/public_model_name.py +4 -0
  15. llama_cloud/types/spreadsheet_job.py +50 -0
  16. llama_cloud/types/spreadsheet_parsing_config.py +35 -0
  17. {llama_cloud-0.1.42.dist-info → llama_cloud-0.1.43.dist-info}/METADATA +1 -1
  18. {llama_cloud-0.1.42.dist-info → llama_cloud-0.1.43.dist-info}/RECORD +23 -26
  19. llama_cloud/types/chunk_mode.py +0 -29
  20. llama_cloud/types/llama_extract_settings.py +0 -67
  21. llama_cloud/types/multimodal_parse_resolution.py +0 -17
  22. llama_cloud/types/schema_relax_mode.py +0 -25
  23. llama_cloud/types/struct_mode.py +0 -33
  24. llama_cloud/types/struct_parse_conf.py +0 -63
  25. /llama_cloud/{types → resources/llama_extract/types}/extract_job_create_data_schema_override.py +0 -0
  26. /llama_cloud/{types → resources/llama_extract/types}/extract_job_create_data_schema_override_zero_value.py +0 -0
  27. /llama_cloud/{types → resources/llama_extract/types}/extract_job_create_priority.py +0 -0
  28. {llama_cloud-0.1.42.dist-info → llama_cloud-0.1.43.dist-info}/LICENSE +0 -0
  29. {llama_cloud-0.1.42.dist-info → llama_cloud-0.1.43.dist-info}/WHEEL +0 -0
@@ -1,67 +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 .chunk_mode import ChunkMode
8
- from .llama_parse_parameters import LlamaParseParameters
9
- from .multimodal_parse_resolution import MultimodalParseResolution
10
- from .struct_parse_conf import StructParseConf
11
-
12
- try:
13
- import pydantic
14
- if pydantic.__version__.startswith("1."):
15
- raise ImportError
16
- import pydantic.v1 as pydantic # type: ignore
17
- except ImportError:
18
- import pydantic # type: ignore
19
-
20
-
21
- class LlamaExtractSettings(pydantic.BaseModel):
22
- """
23
- All settings for the extraction agent. Only the settings in ExtractConfig
24
- are exposed to the user.
25
- """
26
-
27
- max_file_size: typing.Optional[int] = pydantic.Field(
28
- description="The maximum file size (in bytes) allowed for the document."
29
- )
30
- max_file_size_ui: typing.Optional[int] = pydantic.Field(
31
- description="The maximum file size (in bytes) allowed for the document."
32
- )
33
- max_pages: typing.Optional[int] = pydantic.Field(
34
- description="The maximum number of pages allowed for the document."
35
- )
36
- chunk_mode: typing.Optional[ChunkMode] = pydantic.Field(description="The mode to use for chunking the document.")
37
- max_chunk_size: typing.Optional[int] = pydantic.Field(
38
- description="The maximum size of the chunks (in tokens) to use for chunking the document."
39
- )
40
- extraction_agent_config: typing.Optional[typing.Dict[str, StructParseConf]] = pydantic.Field(
41
- description="The configuration for the extraction agent."
42
- )
43
- use_multimodal_parsing: typing.Optional[bool] = pydantic.Field(
44
- description="Whether to use experimental multimodal parsing."
45
- )
46
- use_pixel_extraction: typing.Optional[bool] = pydantic.Field(
47
- description="DEPRECATED: Whether to use extraction over pixels for multimodal mode."
48
- )
49
- llama_parse_params: typing.Optional[LlamaParseParameters] = pydantic.Field(
50
- description="LlamaParse related settings."
51
- )
52
- multimodal_parse_resolution: typing.Optional[MultimodalParseResolution] = pydantic.Field(
53
- description="The resolution to use for multimodal parsing."
54
- )
55
-
56
- def json(self, **kwargs: typing.Any) -> str:
57
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
58
- return super().json(**kwargs_with_defaults)
59
-
60
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
61
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
62
- return super().dict(**kwargs_with_defaults)
63
-
64
- class Config:
65
- frozen = True
66
- smart_union = True
67
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,17 +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 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()
@@ -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 SchemaRelaxMode(str, enum.Enum):
10
- FULL = "FULL"
11
- TOP_LEVEL = "TOP_LEVEL"
12
- LEAF = "LEAF"
13
-
14
- def visit(
15
- self,
16
- full: typing.Callable[[], T_Result],
17
- top_level: typing.Callable[[], T_Result],
18
- leaf: typing.Callable[[], T_Result],
19
- ) -> T_Result:
20
- if self is SchemaRelaxMode.FULL:
21
- return full()
22
- if self is SchemaRelaxMode.TOP_LEVEL:
23
- return top_level()
24
- if self is SchemaRelaxMode.LEAF:
25
- return leaf()
@@ -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 StructMode(str, enum.Enum):
10
- STRUCT_PARSE = "STRUCT_PARSE"
11
- JSON_MODE = "JSON_MODE"
12
- FUNC_CALL = "FUNC_CALL"
13
- STRUCT_RELAXED = "STRUCT_RELAXED"
14
- UNSTRUCTURED = "UNSTRUCTURED"
15
-
16
- def visit(
17
- self,
18
- struct_parse: typing.Callable[[], T_Result],
19
- json_mode: typing.Callable[[], T_Result],
20
- func_call: typing.Callable[[], T_Result],
21
- struct_relaxed: typing.Callable[[], T_Result],
22
- unstructured: typing.Callable[[], T_Result],
23
- ) -> T_Result:
24
- if self is StructMode.STRUCT_PARSE:
25
- return struct_parse()
26
- if self is StructMode.JSON_MODE:
27
- return json_mode()
28
- if self is StructMode.FUNC_CALL:
29
- return func_call()
30
- if self is StructMode.STRUCT_RELAXED:
31
- return struct_relaxed()
32
- if self is StructMode.UNSTRUCTURED:
33
- return unstructured()
@@ -1,63 +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 .extract_models import ExtractModels
8
- from .prompt_conf import PromptConf
9
- from .schema_relax_mode import SchemaRelaxMode
10
- from .struct_mode import StructMode
11
-
12
- try:
13
- import pydantic
14
- if pydantic.__version__.startswith("1."):
15
- raise ImportError
16
- import pydantic.v1 as pydantic # type: ignore
17
- except ImportError:
18
- import pydantic # type: ignore
19
-
20
-
21
- class StructParseConf(pydantic.BaseModel):
22
- """
23
- Configuration for the structured parsing agent.
24
- """
25
-
26
- model: typing.Optional[ExtractModels] = pydantic.Field(description="The model to use for the structured parsing.")
27
- temperature: typing.Optional[float] = pydantic.Field(
28
- description="The temperature to use for the structured parsing."
29
- )
30
- relaxation_mode: typing.Optional[SchemaRelaxMode] = pydantic.Field(
31
- description="The relaxation mode to use for the structured parsing."
32
- )
33
- struct_mode: typing.Optional[StructMode] = pydantic.Field(
34
- description="The struct mode to use for the structured parsing."
35
- )
36
- fetch_logprobs: typing.Optional[bool] = pydantic.Field(
37
- description="Whether to fetch logprobs for the structured parsing."
38
- )
39
- handle_missing: typing.Optional[bool] = pydantic.Field(
40
- description="Whether to handle missing fields in the schema."
41
- )
42
- use_reasoning: typing.Optional[bool] = pydantic.Field(
43
- description="Whether to use reasoning for the structured extraction."
44
- )
45
- cite_sources: typing.Optional[bool] = pydantic.Field(
46
- description="Whether to cite sources for the structured extraction."
47
- )
48
- prompt_conf: typing.Optional[PromptConf] = pydantic.Field(
49
- description="The prompt configuration for the structured parsing."
50
- )
51
-
52
- def json(self, **kwargs: typing.Any) -> str:
53
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
54
- return super().json(**kwargs_with_defaults)
55
-
56
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
57
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
58
- return super().dict(**kwargs_with_defaults)
59
-
60
- class Config:
61
- frozen = True
62
- smart_union = True
63
- json_encoders = {dt.datetime: serialize_datetime}