Skip to content

Commit

Permalink
Merge branch 'main' into pierre/new_option_cache_diag
Browse files Browse the repository at this point in the history
  • Loading branch information
hexapode authored May 23, 2024
2 parents b62c5a5 + d19b35c commit a49de41
Show file tree
Hide file tree
Showing 6 changed files with 1,261 additions and 2 deletions.
Binary file added examples/caltrain/caltrain_schedule_weekend.pdf
Binary file not shown.
529 changes: 529 additions & 0 deletions examples/caltrain/caltrain_text_mode.ipynb

Large diffs are not rendered by default.

Binary file not shown.
720 changes: 720 additions & 0 deletions examples/test_tesla_impact_report/test_gpt4o.ipynb

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion llama_parse/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ class LlamaParse(BasePydanticReader):
invalidate_cache: Optional[bool] = Field(
default=False,
description="If set to true, the cache will be ignored and the document re-processes. All document are kept in cache for 48hours after the job was completed to avoid processing 2 time the same document."
gpt4o_mode: bool = Field(
default=False,
description="Whether to use gpt-4o extract text from documents.",
)
gpt4o_api_key: Optional[str] = Field(
default=None,
description="The API key for the GPT-4o API. Lowers the cost of parsing.",
)
ignore_errors: bool = Field(
default=True,
Expand Down Expand Up @@ -123,6 +130,8 @@ async def _create_job(
"parsing_instruction": self.parsing_instruction,
"invalidate_cache": self.invalidate_cache,
"skip_diagonal_text": self.skip_diagonal_text,
"gpt4o_mode": self.gpt4o_mode,
"gpt4o_api_key": self.gpt4o_api_key,
},
)
if not response.is_success:
Expand Down Expand Up @@ -341,7 +350,8 @@ def get_images(self, json_result: List[dict], download_path: str) -> List[dict]:

# get a valid image path
if not image_path.endswith(".png"):
image_path += ".png"
if not image_path.endswith(".jpg"):
image_path += ".png"

image["path"] = image_path
image["job_id"] = job_id
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "llama-parse"
version = "0.4.2"
version = "0.4.3"
description = "Parse files into RAG-Optimized formats."
authors = ["Logan Markewich <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit a49de41

Please sign in to comment.