Skip to content

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

feat: add effort parameter to command options for enhanced control over OCR processing

myhloli14815964e610
diff --git a/mineru/kit/main.py b/mineru/kit/main.py
index af4bf16f..f847effe 100644
--- a/mineru/kit/main.py
+++ b/mineru/kit/main.py
@@ -47,6 +47,7 @@ def parse_command(
api_key: str | None = typer.Option(None, "--api-key", help="API key for remote parse service"),
language: str = typer.Option("ch", "--language", help="Parser language hint"),
ocr_mode: str = typer.Option("auto", "--ocr-mode", help="OCR mode: auto, txt, ocr"),
+ effort: str = typer.Option("medium", "--effort", help="Hybrid effort: medium, high"),
disable_table: bool = typer.Option(False, "--disable-table", help="Disable table recognition"),
disable_formula: bool = typer.Option(False, "--disable-formula", help="Disable formula recognition"),
disable_image_analysis: bool = typer.Option(False, "--disable-image-analysis", help="Disable image analysis"),
@@ -65,6 +66,7 @@ def parse_command(
api_key=api_key,
language=language,
ocr_mode=ocr_mode, # type: ignore[arg-type]
+ effort=effort, # type: ignore[arg-type]
disable_table=disable_table,
disable_formula=disable_formula,
disable_image_analysis=disable_image_analysis,
@@ -83,6 +85,7 @@ def api_server_command(
max_wait: int = typer.Option(600, "--max-wait", help="Maximum seconds for wait parameter"),
language: str = typer.Option("ch", "--language", help="Parser language hint"),
ocr_mode: str = typer.Option("auto", "--ocr-mode", help="OCR mode: auto, txt, ocr"),
+ effort: str = typer.Option("medium", "--effort", help="Hybrid effort: medium, high"),
disable_table: bool = typer.Option(False, "--disable-table", help="Disable table recognition"),
disable_formula: bool = typer.Option(False, "--disable-formula", help="Disable formula recognition"),
disable_image_analysis: bool = typer.Option(False, "--disable-image-analysis", help="Disable image analysis"),
@@ -100,6 +103,7 @@ def api_server_command(
max_wait=max_wait,
language=language,
ocr_mode=ocr_mode, # type: ignore[arg-type]
+ effort=effort, # type: ignore[arg-type]
disable_table=disable_table,
disable_formula=disable_formula,
disable_image_analysis=disable_image_analysis,