From 032c8173f4676ead22a73b4672d3d9d0a97cf2a0 Mon Sep 17 00:00:00 2001 From: Pierre-Loic Doulcet Date: Wed, 18 Dec 2024 16:20:04 +0100 Subject: [PATCH] Extract layout, audio files --- llama_parse/base.py | 7 +++++++ llama_parse/utils.py | 7 +++++++ pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/llama_parse/base.py b/llama_parse/base.py index 5ca42eb..9eb3cc0 100644 --- a/llama_parse/base.py +++ b/llama_parse/base.py @@ -157,6 +157,10 @@ class LlamaParse(BasePydanticReader): default=False, description="If set to true, the parser will extract/tag charts from the document.", ) + extract_layout: Optional[bool] = Field( + default=False, + description="If set to true, the parser will extract the layout information of the document. Cost 1 credit per page.", + ) fast_mode: Optional[bool] = Field( default=False, description="Note: Non compatible with gpt-4o. If set to true, the parser will use a faster mode to extract text from documents. This mode will skip OCR of images, and table/heading reconstruction.", @@ -457,6 +461,9 @@ async def _create_job( if self.extract_charts: data["extract_charts"] = self.extract_charts + if self.extract_layout: + data["extract_layout"] = self.extract_layout + if self.fast_mode: data["fast_mode"] = self.fast_mode diff --git a/llama_parse/utils.py b/llama_parse/utils.py index 84fdcea..1da25d5 100644 --- a/llama_parse/utils.py +++ b/llama_parse/utils.py @@ -191,4 +191,11 @@ class Language(str, Enum): ".xlr", ".eth", ".tsv", + ".mp3", + ".mp4", + ".mpeg", + ".mpga", + ".m4a", + ".wav", + ".webm", ] diff --git a/pyproject.toml b/pyproject.toml index 576fa66..ad910e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "llama-parse" -version = "0.5.17" +version = "0.5.18" description = "Parse files into RAG-Optimized formats." authors = ["Logan Markewich "] license = "MIT"