llama-cloud 0.1.8__py3-none-any.whl → 0.1.10__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 (51) hide show
  1. llama_cloud/__init__.py +32 -22
  2. llama_cloud/client.py +0 -3
  3. llama_cloud/resources/__init__.py +14 -8
  4. llama_cloud/resources/chat_apps/client.py +99 -133
  5. llama_cloud/resources/files/client.py +34 -6
  6. llama_cloud/resources/llama_extract/__init__.py +16 -2
  7. llama_cloud/resources/llama_extract/client.py +238 -366
  8. llama_cloud/resources/llama_extract/types/__init__.py +14 -3
  9. llama_cloud/resources/llama_extract/types/extract_agent_create_data_schema.py +9 -0
  10. llama_cloud/resources/llama_extract/types/{extract_agent_create_data_schema_value.py → extract_agent_create_data_schema_zero_value.py} +1 -1
  11. llama_cloud/resources/llama_extract/types/extract_agent_update_data_schema.py +9 -0
  12. llama_cloud/resources/{extraction/types/extraction_schema_create_data_schema_value.py → llama_extract/types/extract_agent_update_data_schema_zero_value.py} +1 -1
  13. llama_cloud/resources/llama_extract/types/extract_schema_validate_request_data_schema.py +9 -0
  14. llama_cloud/resources/llama_extract/types/extract_schema_validate_request_data_schema_zero_value.py +7 -0
  15. llama_cloud/resources/organizations/client.py +8 -12
  16. llama_cloud/resources/parsing/client.py +146 -18
  17. llama_cloud/resources/reports/client.py +30 -26
  18. llama_cloud/resources/retrievers/client.py +16 -4
  19. llama_cloud/types/__init__.py +20 -12
  20. llama_cloud/types/chat_app.py +11 -9
  21. llama_cloud/types/chat_app_response.py +12 -10
  22. llama_cloud/types/cloud_mongo_db_atlas_vector_search.py +1 -0
  23. llama_cloud/types/extract_job.py +3 -1
  24. llama_cloud/types/extract_job_create.py +4 -2
  25. llama_cloud/types/extract_job_create_data_schema_override.py +9 -0
  26. llama_cloud/{resources/extraction/types/extraction_schema_update_data_schema_value.py → types/extract_job_create_data_schema_override_zero_value.py} +1 -1
  27. llama_cloud/types/extract_resultset.py +2 -6
  28. llama_cloud/types/extract_run.py +5 -0
  29. llama_cloud/types/extract_run_data.py +11 -0
  30. llama_cloud/types/extract_run_data_item_value.py +5 -0
  31. llama_cloud/types/extract_run_data_zero_value.py +5 -0
  32. llama_cloud/{resources/llama_extract/types/extract_agent_update_data_schema_value.py → types/extract_run_extraction_metadata_value.py} +1 -1
  33. llama_cloud/types/{extraction_job.py → extract_schema_validate_response.py} +3 -6
  34. llama_cloud/types/extract_schema_validate_response_data_schema_value.py +7 -0
  35. llama_cloud/types/extract_state.py +4 -4
  36. llama_cloud/types/llama_extract_settings.py +4 -0
  37. llama_cloud/types/llama_parse_parameters.py +11 -0
  38. llama_cloud/types/plan.py +4 -0
  39. llama_cloud/types/{extraction_result.py → preset_composite_retrieval_params.py} +5 -14
  40. llama_cloud/types/{extraction_schema.py → report_file_info.py} +5 -9
  41. llama_cloud/types/report_metadata.py +2 -1
  42. {llama_cloud-0.1.8.dist-info → llama_cloud-0.1.10.dist-info}/METADATA +2 -1
  43. {llama_cloud-0.1.8.dist-info → llama_cloud-0.1.10.dist-info}/RECORD +45 -42
  44. {llama_cloud-0.1.8.dist-info → llama_cloud-0.1.10.dist-info}/WHEEL +1 -1
  45. llama_cloud/resources/extraction/__init__.py +0 -5
  46. llama_cloud/resources/extraction/client.py +0 -756
  47. llama_cloud/resources/extraction/types/__init__.py +0 -6
  48. llama_cloud/types/extract_job_create_data_schema_override_value.py +0 -7
  49. llama_cloud/types/extraction_result_data_value.py +0 -5
  50. llama_cloud/types/extraction_schema_data_schema_value.py +0 -7
  51. {llama_cloud-0.1.8.dist-info → llama_cloud-0.1.10.dist-info}/LICENSE +0 -0
@@ -33,12 +33,18 @@ class RetrieversClient:
33
33
  self._client_wrapper = client_wrapper
34
34
 
35
35
  def list_retrievers(
36
- self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
36
+ self,
37
+ *,
38
+ name: typing.Optional[str] = None,
39
+ project_id: typing.Optional[str] = None,
40
+ organization_id: typing.Optional[str] = None,
37
41
  ) -> typing.List[Retriever]:
38
42
  """
39
43
  List Retrievers for a project.
40
44
 
41
45
  Parameters:
46
+ - name: typing.Optional[str].
47
+
42
48
  - project_id: typing.Optional[str].
43
49
 
44
50
  - organization_id: typing.Optional[str].
@@ -53,7 +59,7 @@ class RetrieversClient:
53
59
  _response = self._client_wrapper.httpx_client.request(
54
60
  "GET",
55
61
  urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/retrievers"),
56
- params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
62
+ params=remove_none_from_dict({"name": name, "project_id": project_id, "organization_id": organization_id}),
57
63
  headers=self._client_wrapper.get_headers(),
58
64
  timeout=60,
59
65
  )
@@ -346,12 +352,18 @@ class AsyncRetrieversClient:
346
352
  self._client_wrapper = client_wrapper
347
353
 
348
354
  async def list_retrievers(
349
- self, *, project_id: typing.Optional[str] = None, organization_id: typing.Optional[str] = None
355
+ self,
356
+ *,
357
+ name: typing.Optional[str] = None,
358
+ project_id: typing.Optional[str] = None,
359
+ organization_id: typing.Optional[str] = None,
350
360
  ) -> typing.List[Retriever]:
351
361
  """
352
362
  List Retrievers for a project.
353
363
 
354
364
  Parameters:
365
+ - name: typing.Optional[str].
366
+
355
367
  - project_id: typing.Optional[str].
356
368
 
357
369
  - organization_id: typing.Optional[str].
@@ -366,7 +378,7 @@ class AsyncRetrieversClient:
366
378
  _response = await self._client_wrapper.httpx_client.request(
367
379
  "GET",
368
380
  urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/retrievers"),
369
- params=remove_none_from_dict({"project_id": project_id, "organization_id": organization_id}),
381
+ params=remove_none_from_dict({"name": name, "project_id": project_id, "organization_id": organization_id}),
370
382
  headers=self._client_wrapper.get_headers(),
371
383
  timeout=60,
372
384
  )
@@ -110,7 +110,8 @@ from .extract_agent_data_schema_value import ExtractAgentDataSchemaValue
110
110
  from .extract_config import ExtractConfig
111
111
  from .extract_job import ExtractJob
112
112
  from .extract_job_create import ExtractJobCreate
113
- from .extract_job_create_data_schema_override_value import ExtractJobCreateDataSchemaOverrideValue
113
+ from .extract_job_create_data_schema_override import ExtractJobCreateDataSchemaOverride
114
+ from .extract_job_create_data_schema_override_zero_value import ExtractJobCreateDataSchemaOverrideZeroValue
114
115
  from .extract_mode import ExtractMode
115
116
  from .extract_resultset import ExtractResultset
116
117
  from .extract_resultset_data import ExtractResultsetData
@@ -118,13 +119,14 @@ from .extract_resultset_data_item_value import ExtractResultsetDataItemValue
118
119
  from .extract_resultset_data_zero_value import ExtractResultsetDataZeroValue
119
120
  from .extract_resultset_extraction_metadata_value import ExtractResultsetExtractionMetadataValue
120
121
  from .extract_run import ExtractRun
122
+ from .extract_run_data import ExtractRunData
123
+ from .extract_run_data_item_value import ExtractRunDataItemValue
121
124
  from .extract_run_data_schema_value import ExtractRunDataSchemaValue
125
+ from .extract_run_data_zero_value import ExtractRunDataZeroValue
126
+ from .extract_run_extraction_metadata_value import ExtractRunExtractionMetadataValue
127
+ from .extract_schema_validate_response import ExtractSchemaValidateResponse
128
+ from .extract_schema_validate_response_data_schema_value import ExtractSchemaValidateResponseDataSchemaValue
122
129
  from .extract_state import ExtractState
123
- from .extraction_job import ExtractionJob
124
- from .extraction_result import ExtractionResult
125
- from .extraction_result_data_value import ExtractionResultDataValue
126
- from .extraction_schema import ExtractionSchema
127
- from .extraction_schema_data_schema_value import ExtractionSchemaDataSchemaValue
128
130
  from .file import File
129
131
  from .file_permission_info_value import FilePermissionInfoValue
130
132
  from .file_resource_info_value import FileResourceInfoValue
@@ -243,6 +245,7 @@ from .pipeline_type import PipelineType
243
245
  from .plan import Plan
244
246
  from .playground_session import PlaygroundSession
245
247
  from .pooling import Pooling
248
+ from .preset_composite_retrieval_params import PresetCompositeRetrievalParams
246
249
  from .preset_retrieval_params import PresetRetrievalParams
247
250
  from .presigned_url import PresignedUrl
248
251
  from .progress_event import ProgressEvent
@@ -266,6 +269,7 @@ from .report_event_item_event_data import (
266
269
  ReportEventItemEventData_ReportStateUpdate,
267
270
  )
268
271
  from .report_event_type import ReportEventType
272
+ from .report_file_info import ReportFileInfo
269
273
  from .report_metadata import ReportMetadata
270
274
  from .report_plan import ReportPlan
271
275
  from .report_plan_block import ReportPlanBlock
@@ -409,7 +413,8 @@ __all__ = [
409
413
  "ExtractConfig",
410
414
  "ExtractJob",
411
415
  "ExtractJobCreate",
412
- "ExtractJobCreateDataSchemaOverrideValue",
416
+ "ExtractJobCreateDataSchemaOverride",
417
+ "ExtractJobCreateDataSchemaOverrideZeroValue",
413
418
  "ExtractMode",
414
419
  "ExtractResultset",
415
420
  "ExtractResultsetData",
@@ -417,13 +422,14 @@ __all__ = [
417
422
  "ExtractResultsetDataZeroValue",
418
423
  "ExtractResultsetExtractionMetadataValue",
419
424
  "ExtractRun",
425
+ "ExtractRunData",
426
+ "ExtractRunDataItemValue",
420
427
  "ExtractRunDataSchemaValue",
428
+ "ExtractRunDataZeroValue",
429
+ "ExtractRunExtractionMetadataValue",
430
+ "ExtractSchemaValidateResponse",
431
+ "ExtractSchemaValidateResponseDataSchemaValue",
421
432
  "ExtractState",
422
- "ExtractionJob",
423
- "ExtractionResult",
424
- "ExtractionResultDataValue",
425
- "ExtractionSchema",
426
- "ExtractionSchemaDataSchemaValue",
427
433
  "File",
428
434
  "FilePermissionInfoValue",
429
435
  "FileResourceInfoValue",
@@ -534,6 +540,7 @@ __all__ = [
534
540
  "Plan",
535
541
  "PlaygroundSession",
536
542
  "Pooling",
543
+ "PresetCompositeRetrievalParams",
537
544
  "PresetRetrievalParams",
538
545
  "PresignedUrl",
539
546
  "ProgressEvent",
@@ -555,6 +562,7 @@ __all__ = [
555
562
  "ReportEventItemEventData_ReportBlockUpdate",
556
563
  "ReportEventItemEventData_ReportStateUpdate",
557
564
  "ReportEventType",
565
+ "ReportFileInfo",
558
566
  "ReportMetadata",
559
567
  "ReportPlan",
560
568
  "ReportPlanBlock",
@@ -5,7 +5,7 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .llm_parameters import LlmParameters
8
- from .preset_retrieval_params import PresetRetrievalParams
8
+ from .preset_composite_retrieval_params import PresetCompositeRetrievalParams
9
9
 
10
10
  try:
11
11
  import pydantic
@@ -21,14 +21,16 @@ class ChatApp(pydantic.BaseModel):
21
21
  Schema for a chat app
22
22
  """
23
23
 
24
- id: str
25
- name: str
26
- pipeline_id: str
27
- project_id: str
28
- llm_config: LlmParameters
29
- retrieval_config: PresetRetrievalParams
30
- created_at: dt.datetime
31
- updated_at: dt.datetime
24
+ id: str = pydantic.Field(description="Unique identifier")
25
+ created_at: typing.Optional[dt.datetime]
26
+ updated_at: typing.Optional[dt.datetime]
27
+ name: str = pydantic.Field(description="Name of the chat app")
28
+ retriever_id: str = pydantic.Field(description="ID of the retriever to use for the chat app")
29
+ llm_config: LlmParameters = pydantic.Field(description="Configuration for the LLM model to use for the chat app")
30
+ retrieval_config: PresetCompositeRetrievalParams = pydantic.Field(
31
+ description="Configuration for the retrieval model to use for the chat app"
32
+ )
33
+ project_id: str = pydantic.Field(description="ID of the project the chat app belongs to")
32
34
 
33
35
  def json(self, **kwargs: typing.Any) -> str:
34
36
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -5,7 +5,7 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .llm_parameters import LlmParameters
8
- from .preset_retrieval_params import PresetRetrievalParams
8
+ from .preset_composite_retrieval_params import PresetCompositeRetrievalParams
9
9
 
10
10
  try:
11
11
  import pydantic
@@ -17,15 +17,17 @@ except ImportError:
17
17
 
18
18
 
19
19
  class ChatAppResponse(pydantic.BaseModel):
20
- id: str
21
- name: str
22
- pipeline_id: str
23
- project_id: str
24
- llm_config: LlmParameters
25
- retrieval_config: PresetRetrievalParams
26
- created_at: dt.datetime
27
- updated_at: dt.datetime
28
- pipeline_name: str
20
+ id: str = pydantic.Field(description="Unique identifier")
21
+ created_at: typing.Optional[dt.datetime]
22
+ updated_at: typing.Optional[dt.datetime]
23
+ name: str = pydantic.Field(description="Name of the chat app")
24
+ retriever_id: str = pydantic.Field(description="ID of the retriever to use for the chat app")
25
+ llm_config: LlmParameters = pydantic.Field(description="Configuration for the LLM model to use for the chat app")
26
+ retrieval_config: PresetCompositeRetrievalParams = pydantic.Field(
27
+ description="Configuration for the retrieval model to use for the chat app"
28
+ )
29
+ project_id: str = pydantic.Field(description="ID of the project the chat app belongs to")
30
+ retriever_name: str
29
31
 
30
32
  def json(self, **kwargs: typing.Any) -> str:
31
33
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -35,6 +35,7 @@ class CloudMongoDbAtlasVectorSearch(pydantic.BaseModel):
35
35
  collection_name: str
36
36
  vector_index_name: typing.Optional[str]
37
37
  fulltext_index_name: typing.Optional[str]
38
+ embedding_dimension: typing.Optional[int]
38
39
  class_name: typing.Optional[str]
39
40
 
40
41
  def json(self, **kwargs: typing.Any) -> str:
@@ -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 .extract_agent import ExtractAgent
7
8
  from .file import File
8
9
  from .status_enum import StatusEnum
9
10
 
@@ -18,8 +19,9 @@ except ImportError:
18
19
 
19
20
  class ExtractJob(pydantic.BaseModel):
20
21
  id: str = pydantic.Field(description="The id of the extraction job")
21
- run_id: str = pydantic.Field(description="The id of the extraction run")
22
+ extraction_agent: ExtractAgent = pydantic.Field(description="The agent that the job was run on.")
22
23
  status: StatusEnum = pydantic.Field(description="The status of the extraction job")
24
+ error: typing.Optional[str]
23
25
  file: File = pydantic.Field(description="The file that the extract was extracted from")
24
26
 
25
27
  def json(self, **kwargs: typing.Any) -> str:
@@ -5,7 +5,7 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .extract_config import ExtractConfig
8
- from .extract_job_create_data_schema_override_value import ExtractJobCreateDataSchemaOverrideValue
8
+ from .extract_job_create_data_schema_override import ExtractJobCreateDataSchemaOverride
9
9
 
10
10
  try:
11
11
  import pydantic
@@ -23,7 +23,9 @@ class ExtractJobCreate(pydantic.BaseModel):
23
23
 
24
24
  extraction_agent_id: str = pydantic.Field(description="The id of the extraction agent")
25
25
  file_id: str = pydantic.Field(description="The id of the file")
26
- data_schema_override: typing.Optional[typing.Dict[str, typing.Optional[ExtractJobCreateDataSchemaOverrideValue]]]
26
+ data_schema_override: typing.Optional[ExtractJobCreateDataSchemaOverride] = pydantic.Field(
27
+ description="The data schema to override the extraction agent's data schema with"
28
+ )
27
29
  config_override: typing.Optional[ExtractConfig]
28
30
 
29
31
  def json(self, **kwargs: typing.Any) -> str:
@@ -0,0 +1,9 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .extract_job_create_data_schema_override_zero_value import ExtractJobCreateDataSchemaOverrideZeroValue
6
+
7
+ ExtractJobCreateDataSchemaOverride = typing.Union[
8
+ typing.Dict[str, typing.Optional[ExtractJobCreateDataSchemaOverrideZeroValue]], str
9
+ ]
@@ -2,6 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- ExtractionSchemaUpdateDataSchemaValue = typing.Union[
5
+ ExtractJobCreateDataSchemaOverrideZeroValue = typing.Union[
6
6
  typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool
7
7
  ]
@@ -6,7 +6,6 @@ import typing
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .extract_resultset_data import ExtractResultsetData
8
8
  from .extract_resultset_extraction_metadata_value import ExtractResultsetExtractionMetadataValue
9
- from .extract_run import ExtractRun
10
9
 
11
10
  try:
12
11
  import pydantic
@@ -19,18 +18,15 @@ except ImportError:
19
18
 
20
19
  class ExtractResultset(pydantic.BaseModel):
21
20
  """
22
- Schema for an extraction result.
21
+ Schema for an extraction resultset.
23
22
  """
24
23
 
25
- id: str = pydantic.Field(description="Unique identifier")
26
- created_at: typing.Optional[dt.datetime]
27
- updated_at: typing.Optional[dt.datetime]
24
+ run_id: str = pydantic.Field(description="The id of the extraction run")
28
25
  extraction_agent_id: str = pydantic.Field(description="The id of the extraction agent")
29
26
  data: typing.Optional[ExtractResultsetData] = pydantic.Field(description="The data extracted from the file")
30
27
  extraction_metadata: typing.Dict[str, typing.Optional[ExtractResultsetExtractionMetadataValue]] = pydantic.Field(
31
28
  description="The metadata extracted from the file"
32
29
  )
33
- extraction_run: ExtractRun = pydantic.Field(description="The extraction run that produced the resultset.")
34
30
 
35
31
  def json(self, **kwargs: typing.Any) -> str:
36
32
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -5,7 +5,9 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .extract_config import ExtractConfig
8
+ from .extract_run_data import ExtractRunData
8
9
  from .extract_run_data_schema_value import ExtractRunDataSchemaValue
10
+ from .extract_run_extraction_metadata_value import ExtractRunExtractionMetadataValue
9
11
  from .extract_state import ExtractState
10
12
  from .file import File
11
13
 
@@ -34,6 +36,9 @@ class ExtractRun(pydantic.BaseModel):
34
36
  file: File = pydantic.Field(description="The file that the extract was extracted from")
35
37
  status: ExtractState = pydantic.Field(description="The status of the extraction run")
36
38
  error: typing.Optional[str]
39
+ job_id: typing.Optional[str]
40
+ data: typing.Optional[ExtractRunData] = pydantic.Field(description="The data extracted from the file")
41
+ extraction_metadata: typing.Optional[typing.Dict[str, typing.Optional[ExtractRunExtractionMetadataValue]]]
37
42
 
38
43
  def json(self, **kwargs: typing.Any) -> str:
39
44
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,11 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .extract_run_data_item_value import ExtractRunDataItemValue
6
+ from .extract_run_data_zero_value import ExtractRunDataZeroValue
7
+
8
+ ExtractRunData = typing.Union[
9
+ typing.Dict[str, typing.Optional[ExtractRunDataZeroValue]],
10
+ typing.List[typing.Dict[str, typing.Optional[ExtractRunDataItemValue]]],
11
+ ]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractRunDataItemValue = typing.Union[typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractRunDataZeroValue = typing.Union[typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool]
@@ -2,6 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- ExtractAgentUpdateDataSchemaValue = typing.Union[
5
+ ExtractRunExtractionMetadataValue = typing.Union[
6
6
  typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool
7
7
  ]
@@ -4,8 +4,7 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
- from .file import File
8
- from .status_enum import StatusEnum
7
+ from .extract_schema_validate_response_data_schema_value import ExtractSchemaValidateResponseDataSchemaValue
9
8
 
10
9
  try:
11
10
  import pydantic
@@ -16,10 +15,8 @@ except ImportError:
16
15
  import pydantic # type: ignore
17
16
 
18
17
 
19
- class ExtractionJob(pydantic.BaseModel):
20
- id: str = pydantic.Field(description="The id of the extraction job")
21
- status: StatusEnum = pydantic.Field(description="The status of the extraction job")
22
- file: File = pydantic.Field(description="The file that the extract was extracted from")
18
+ class ExtractSchemaValidateResponse(pydantic.BaseModel):
19
+ data_schema: typing.Dict[str, typing.Optional[ExtractSchemaValidateResponseDataSchemaValue]]
23
20
 
24
21
  def json(self, **kwargs: typing.Any) -> str:
25
22
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractSchemaValidateResponseDataSchemaValue = typing.Union[
6
+ typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool
7
+ ]
@@ -8,21 +8,21 @@ T_Result = typing.TypeVar("T_Result")
8
8
 
9
9
  class ExtractState(str, enum.Enum):
10
10
  CREATED = "CREATED"
11
- RUNNING = "RUNNING"
11
+ PENDING = "PENDING"
12
12
  SUCCESS = "SUCCESS"
13
13
  ERROR = "ERROR"
14
14
 
15
15
  def visit(
16
16
  self,
17
17
  created: typing.Callable[[], T_Result],
18
- running: typing.Callable[[], T_Result],
18
+ pending: typing.Callable[[], T_Result],
19
19
  success: typing.Callable[[], T_Result],
20
20
  error: typing.Callable[[], T_Result],
21
21
  ) -> T_Result:
22
22
  if self is ExtractState.CREATED:
23
23
  return created()
24
- if self is ExtractState.RUNNING:
25
- return running()
24
+ if self is ExtractState.PENDING:
25
+ return pending()
26
26
  if self is ExtractState.SUCCESS:
27
27
  return success()
28
28
  if self is ExtractState.ERROR:
@@ -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 .llama_parse_parameters import LlamaParseParameters
7
8
 
8
9
  try:
9
10
  import pydantic
@@ -30,6 +31,9 @@ class LlamaExtractSettings(pydantic.BaseModel):
30
31
  )
31
32
  extraction_prompt: typing.Optional[str] = pydantic.Field(description="The prompt to use for the extraction.")
32
33
  error_handling_prompt: typing.Optional[str] = pydantic.Field(description="The prompt to use for error handling.")
34
+ llama_parse_params: typing.Optional[LlamaParseParameters] = pydantic.Field(
35
+ description="LlamaParse related settings."
36
+ )
33
37
 
34
38
  def json(self, **kwargs: typing.Any) -> str:
35
39
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -57,7 +57,9 @@ class LlamaParseParameters(pydantic.BaseModel):
57
57
  premium_mode: typing.Optional[bool]
58
58
  continuous_mode: typing.Optional[bool]
59
59
  s_3_input_path: typing.Optional[str] = pydantic.Field(alias="s3_input_path")
60
+ input_s_3_region: typing.Optional[str] = pydantic.Field(alias="input_s3_region")
60
61
  s_3_output_path_prefix: typing.Optional[str] = pydantic.Field(alias="s3_output_path_prefix")
62
+ output_s_3_region: typing.Optional[str] = pydantic.Field(alias="output_s3_region")
61
63
  project_id: typing.Optional[str]
62
64
  azure_openai_deployment_name: typing.Optional[str]
63
65
  azure_openai_endpoint: typing.Optional[str]
@@ -79,6 +81,15 @@ class LlamaParseParameters(pydantic.BaseModel):
79
81
  formatting_instruction: typing.Optional[str]
80
82
  complemental_formatting_instruction: typing.Optional[str]
81
83
  content_guideline_instruction: typing.Optional[str]
84
+ spreadsheet_extract_sub_tables: typing.Optional[bool]
85
+ job_timeout_in_seconds: typing.Optional[float]
86
+ job_timeout_extra_time_per_page_in_seconds: typing.Optional[float]
87
+ strict_mode_image_extraction: typing.Optional[bool]
88
+ strict_mode_image_ocr: typing.Optional[bool]
89
+ strict_mode_reconstruction: typing.Optional[bool]
90
+ strict_mode_buggy_font: typing.Optional[bool]
91
+ ignore_document_elements_for_layout_detection: typing.Optional[bool]
92
+ output_tables_as_html: typing.Optional[bool] = pydantic.Field(alias="output_tables_as_HTML")
82
93
 
83
94
  def json(self, **kwargs: typing.Any) -> str:
84
95
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
llama_cloud/types/plan.py CHANGED
@@ -15,6 +15,8 @@ except ImportError:
15
15
 
16
16
 
17
17
  class Plan(pydantic.BaseModel):
18
+ id: str = pydantic.Field(description="The ID of the plan")
19
+ name: typing.Optional[str]
18
20
  total_users: typing.Optional[int]
19
21
  total_indexes: typing.Optional[int]
20
22
  total_indexed_pages: typing.Optional[int]
@@ -25,6 +27,8 @@ class Plan(pydantic.BaseModel):
25
27
  allowed_external_index: typing.Optional[bool] = pydantic.Field(
26
28
  description="If is allowed to use external data sources or sinks in indexes"
27
29
  )
30
+ starting_on: typing.Optional[dt.datetime]
31
+ ending_before: typing.Optional[dt.datetime]
28
32
 
29
33
  def json(self, **kwargs: typing.Any) -> str:
30
34
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -4,8 +4,7 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
- from .extraction_result_data_value import ExtractionResultDataValue
8
- from .file import File
7
+ from .composite_retrieval_mode import CompositeRetrievalMode
9
8
 
10
9
  try:
11
10
  import pydantic
@@ -16,19 +15,11 @@ except ImportError:
16
15
  import pydantic # type: ignore
17
16
 
18
17
 
19
- class ExtractionResult(pydantic.BaseModel):
20
- """
21
- Schema for an extraction result.
22
- """
23
-
24
- id: str = pydantic.Field(description="Unique identifier")
25
- created_at: typing.Optional[dt.datetime]
26
- updated_at: typing.Optional[dt.datetime]
27
- schema_id: str = pydantic.Field(description="The id of the schema")
28
- data: typing.Dict[str, typing.Optional[ExtractionResultDataValue]] = pydantic.Field(
29
- description="The data extracted from the file"
18
+ class PresetCompositeRetrievalParams(pydantic.BaseModel):
19
+ mode: typing.Optional[CompositeRetrievalMode] = pydantic.Field(description="The mode of composite retrieval.")
20
+ rerank_top_n: typing.Optional[int] = pydantic.Field(
21
+ description="The number of nodes to retrieve after reranking over retrieved nodes from all retrieval tools."
30
22
  )
31
- file: File = pydantic.Field(description="The file that the extract was extracted from")
32
23
 
33
24
  def json(self, **kwargs: typing.Any) -> str:
34
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -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 .extraction_schema_data_schema_value import ExtractionSchemaDataSchemaValue
8
7
 
9
8
  try:
10
9
  import pydantic
@@ -15,17 +14,13 @@ except ImportError:
15
14
  import pydantic # type: ignore
16
15
 
17
16
 
18
- class ExtractionSchema(pydantic.BaseModel):
17
+ class ReportFileInfo(pydantic.BaseModel):
19
18
  """
20
- Schema for extraction schema.
19
+ Information about a file stored in S3
21
20
  """
22
21
 
23
- id: str = pydantic.Field(description="Unique identifier")
24
- created_at: typing.Optional[dt.datetime]
25
- updated_at: typing.Optional[dt.datetime]
26
- name: str = pydantic.Field(description="The name of the extraction schema")
27
- project_id: str = pydantic.Field(description="The ID of the project that the extraction schema belongs to")
28
- data_schema: typing.Optional[typing.Dict[str, typing.Optional[ExtractionSchemaDataSchemaValue]]]
22
+ original_name: str = pydantic.Field(description="Original filename uploaded by user")
23
+ s_3_path: str = pydantic.Field(alias="s3_path", description="Path to file in S3")
29
24
 
30
25
  def json(self, **kwargs: typing.Any) -> str:
31
26
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -38,4 +33,5 @@ class ExtractionSchema(pydantic.BaseModel):
38
33
  class Config:
39
34
  frozen = True
40
35
  smart_union = True
36
+ allow_population_by_field_name = True
41
37
  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 .report_file_info import ReportFileInfo
7
8
  from .report_state import ReportState
8
9
 
9
10
  try:
@@ -25,7 +26,7 @@ class ReportMetadata(pydantic.BaseModel):
25
26
  report_metadata: typing.Dict[str, typing.Any] = pydantic.Field(description="The metadata for the report")
26
27
  state: ReportState = pydantic.Field(description="The state of the report")
27
28
  input_files: typing.Optional[typing.List[str]]
28
- template_file: typing.Optional[str]
29
+ template_file: typing.Optional[ReportFileInfo]
29
30
  template_text: typing.Optional[str]
30
31
  template_instructions: typing.Optional[str]
31
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-cloud
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Logan Markewich
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
16
17
  Requires-Dist: certifi (>=2024.7.4,<2025.0.0)
17
18
  Requires-Dist: httpx (>=0.20.0)
18
19
  Requires-Dist: pydantic (>=1.10)