Please add the option to include extra info in async batch processing #336

Open
opened 2026-02-16 00:17:32 -05:00 by yindo · 2 comments
Owner

Originally created by @MemoonaTahira on GitHub (Nov 18, 2024).

# async batch
documents = await parser.aload_data(["./my_file1.pdf", "./my_file2.pdf"])

When I run this, I get parsed text chunks and no metadata whatsoever, unlike running SimpleDirectoryReader for PDFs.
I need to append filename and path to the parsed results.

However, using the extra info option seems to work only for a single file:

file_name = "my_file1.pdf"
extra_info = {"file_name": file_name}

with open(f"./{file_name}", "rb") as f:
    # must provide extra_info with file_name key with passing file object
    documents = parser.load_data(f, extra_info=extra_info)

E.g. I have 180 files that give me about 600 chunks, I have no way of identifying which chunk belongs to which file.

And async processing is fast, I don't wish to use the SimpleDirectoryReader because it is very slow.

Originally created by @MemoonaTahira on GitHub (Nov 18, 2024). ``` # async batch documents = await parser.aload_data(["./my_file1.pdf", "./my_file2.pdf"]) ``` When I run this, I get parsed text chunks and no metadata whatsoever, unlike running SimpleDirectoryReader for PDFs. I need to append filename and path to the parsed results. However, using the extra info option seems to work only for a single file: ``` file_name = "my_file1.pdf" extra_info = {"file_name": file_name} with open(f"./{file_name}", "rb") as f: # must provide extra_info with file_name key with passing file object documents = parser.load_data(f, extra_info=extra_info) ``` E.g. I have 180 files that give me about 600 chunks, I have no way of identifying which chunk belongs to which file. And async processing is fast, I don't wish to use the SimpleDirectoryReader because it is very slow.
yindo added the enhancement label 2026-02-16 00:17:32 -05:00
Author
Owner

@adreichert commented on GitHub (Apr 25, 2025):

Running into the same issue.

@adreichert commented on GitHub (Apr 25, 2025): Running into the same issue.
Author
Owner

@adreichert commented on GitHub (Apr 25, 2025):

@MemoonaTahira After running into the issue, I noticed new methods parse/aparse return JobResults, which retain the path. Please take a look at these function. These are in the 0.6.16.

lp = LlamaParse(
        ...
    )
res = lp.parse("foo.pdf")
res.file_name # ->  foo.pdf
@adreichert commented on GitHub (Apr 25, 2025): @MemoonaTahira After running into the issue, I noticed new methods [`parse/aparse`](https://github.com/run-llama/llama_cloud_services/blob/main/llama_cloud_services/parse/base.py#L1154-L1159) return `JobResult`s, which retain the path. Please take a look at these function. These are in the 0.6.16. ``` lp = LlamaParse( ... ) res = lp.parse("foo.pdf") res.file_name # -> foo.pdf ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#336