Compare commits

...

6 Commits

Author SHA1 Message Date
Logan Markewich b706363f11 vbump 2024-09-10 11:45:07 -06:00
Logan Markewich f603f507b6 linting 2024-09-10 11:32:50 -06:00
Pierre-Loic Doulcet 8aa08c590c Update llama_parse/base.py
Co-authored-by: Logan <logan.markewich@live.com>
2024-09-10 10:30:53 -07:00
Pierre-Loic Doulcet 42a98f921a Update llama_parse/base.py
Co-authored-by: Logan <logan.markewich@live.com>
2024-09-10 10:30:48 -07:00
Pierre-Loic Doulcet 1c453397de trailing whitespaces 2024-09-10 10:30:28 -07:00
Pierre-Loic Doulcet 3207daa7bd do not attach a filepath when a stram of bytes is passed 2024-09-10 10:20:57 -07:00
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -416,12 +416,13 @@ class LlamaParse(BasePydanticReader):
job_id = await self._create_job(file_path, extra_info=extra_info)
if self.verbose:
print("Started parsing the file under job_id %s" % job_id)
result = await self._get_job_result(job_id, "json")
result["job_id"] = job_id
result["file_path"] = file_path
return [result]
if not isinstance(file_path, (bytes, BufferedIOBase)):
result["file_path"] = str(file_path)
return [result]
except Exception as e:
file_repr = file_path if isinstance(file_path, str) else "<bytes/buffer>"
print(f"Error while parsing the file '{file_repr}':", e)
@@ -506,7 +507,9 @@ class LlamaParse(BasePydanticReader):
image["path"] = image_path
image["job_id"] = job_id
image["original_pdf_path"] = result["file_path"]
image["original_file_path"] = result.get("file_path", None)
image["page_number"] = page["page"]
with open(image_path, "wb") as f:
image_url = f"{self.base_url}/api/parsing/job/{job_id}/result/image/{image_name}"
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "llama-parse"
version = "0.5.4"
version = "0.5.5"
description = "Parse files into RAG-Optimized formats."
authors = ["Logan Markewich <logan@llamaindex.ai>"]
license = "MIT"