Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

feat: update file upload handling to use unique filenames based on document stems

myhlolid4f1710e426c
diff --git a/mineru/cli/client.py b/mineru/cli/client.py
index fd42f2cb..75fd2821 100644
--- a/mineru/cli/client.py
+++ b/mineru/cli/client.py
@@ -677,11 +677,12 @@ def submit_task_sync(
for document in planned_task.documents:
mime_type = mimetypes.guess_type(document.path.name)[0] or "application/octet-stream"
file_handle = stack.enter_context(open(document.path, "rb"))
+ upload_filename = f"{document.stem}{document.path.suffix}"
files.append(
(
"files",
(
- document.path.name,
+ upload_filename,
file_handle,
mime_type,
),