Compare commits

...

1 Commits

Author SHA1 Message Date
Pierre-Loic Doulcet 04e887dad9 header footer control in llamaparse 2025-06-30 15:21:00 +08:00
4 changed files with 51 additions and 10 deletions
+46 -5
View File
@@ -465,6 +465,34 @@ class LlamaParse(BasePydanticReader):
default=None,
description="A URL that needs to be called at the end of the parsing job.",
)
partition_pages: Optional[int] = Field(
default=None,
description="If set, documents will automatically be partitioned into segments containing the specified number of pages at most. Parsing will be split into separate jobs for each partition segment. Can be used in combination with targetPages and maxPages.",
)
hide_headers: Optional[bool] = Field(
default=False,
description="Whether to hide page header in output markdown.",
)
hide_footers: Optional[bool] = Field(
default=False,
description="Whether to hide page footers in output markdown.",
)
page_header_suffix: Optional[str] = Field(
default=None,
description="A suffix to add to the page header in the output markdown.",
)
page_header_prefix: Optional[str] = Field(
default=None,
description="A prefix to add to the page header in the output markdown.",
)
page_footer_suffix: Optional[str] = Field(
default=None,
description="A suffix to add to the page footer in the output markdown.",
)
page_footer_prefix: Optional[str] = Field(
default=None,
description="A prefix to add to the page footer in the output markdown.",
)
# Deprecated
bounding_box: Optional[str] = Field(
@@ -504,11 +532,6 @@ class LlamaParse(BasePydanticReader):
description="Whether to use the vendor multimodal API.",
)
partition_pages: Optional[int] = Field(
default=None,
description="If set, documents will automatically be partitioned into segments containing the specified number of pages at most. Parsing will be split into separate jobs for each partition segment. Can be used in combination with targetPages and maxPages.",
)
@model_validator(mode="before")
@classmethod
def warn_extra_params(cls, data: Dict[str, Any]) -> Dict[str, Any]:
@@ -836,6 +859,24 @@ class LlamaParse(BasePydanticReader):
if self.page_prefix is not None:
data["page_prefix"] = self.page_prefix
if self.hide_headers:
data["hide_headers"] = self.hide_headers
if self.hide_footers:
data["hide_footers"] = self.hide_footers
if self.page_header_suffix is not None:
data["page_header_suffix"] = self.page_header_suffix
if self.page_header_prefix is not None:
data["page_header_prefix"] = self.page_header_prefix
if self.page_footer_suffix is not None:
data["page_footer_suffix"] = self.page_footer_suffix
if self.page_footer_prefix is not None:
data["page_footer_prefix"] = self.page_footer_prefix
# only send page separator to server if it is not None
# as if a null, "" string is sent the server will then ignore the page separator instead of using the default
if self.page_separator is not None:
+2 -2
View File
@@ -15,7 +15,7 @@ class JobMetadata(BaseModel):
"""Metadata about the job."""
job_pages: int = Field(description="The number of pages in the job.")
job_auto_mode_triggered_pages: int = Field(
job_auto_mode_triggered_pages: Optional[int] = Field(
description="The number of pages that triggered auto mode (thus increasing the cost)."
)
job_is_cache_hit: bool = Field(description="Whether the job was a cache hit.")
@@ -130,7 +130,7 @@ class Page(BaseModel):
)
width: Optional[float] = Field(default=None, description="The width of the page.")
height: Optional[float] = Field(default=None, description="The height of the page.")
triggeredAutoMode: bool = Field(
triggeredAutoMode: Optional[bool] = Field(
default=False,
description="Whether the page triggered auto mode (thus increasing the cost).",
)
+2 -2
View File
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "llama-parse"
version = "0.6.39"
version = "0.6.40"
description = "Parse files into RAG-Optimized formats."
authors = ["Logan Markewich <logan@llamaindex.ai>"]
license = "MIT"
@@ -13,7 +13,7 @@ packages = [{include = "llama_parse"}]
[tool.poetry.dependencies]
python = ">=3.9,<4.0"
llama-cloud-services = ">=0.6.39"
llama-cloud-services = ">=0.6.40"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
+1 -1
View File
@@ -8,7 +8,7 @@ python_version = "3.10"
[tool.poetry]
name = "llama-cloud-services"
version = "0.6.39"
version = "0.6.40"
description = "Tailored SDK clients for LlamaCloud services."
authors = ["Logan Markewich <logan@runllama.ai>"]
license = "MIT"