You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(document-to-markdown): update docs for unpdf default provider
Reflect the provider abstraction with unpdf as default and Mistral
as opt-in. Add format support matrix, provider resolution order,
REST endpoint, and per-provider capability details.
Convert PDF, DOCX, and PPTX documents to Markdown using configurable OCR providers.
3
+
Convert PDF, DOCX, and PPTX documents to Markdown using configurable conversion providers.
4
4
5
5
## Overview
6
6
7
-
The `document-to-markdown` MCP tool uses OCR (Optical Character Recognition) to extract text and images from documents and convert them to well-structured Markdown format. Extracted images are stored as separate blobs alongside the markdown output.
7
+
The `document-to-markdown` MCP tool extracts text and images from documents and converts them to well-structured Markdown. Extracted images are stored as separate blobs alongside the markdown output.
8
8
9
-
The tool supports a **provider abstraction** pattern, allowing you to switch between different OCR backends. The default provider is **Mistral OCR**.
9
+
The tool supports a **provider abstraction** pattern, allowing you to switch between different conversion backends.
10
10
11
-
## Requirements
11
+
## Available Providers
12
12
13
-
### Environment Variables
13
+
| Provider | Name | Formats | Images | API Key Required |
@@ -42,10 +62,12 @@ Get your Mistral API key from [Mistral AI Console](https://console.mistral.ai/).
42
62
43
63
| Option | Type | Default | Description |
44
64
|--------|------|---------|-------------|
45
-
|`pageStart`| number | 1 | First page to process (1-indexed) |
46
-
|`pageEnd`| number | Last page | Last page to process (inclusive) |
65
+
|`pageStart`| number | 1 | First page to process (1-indexed, inclusive) |
66
+
|`pageEnd`| number | Last page | Last page to process (1-indexed, inclusive) |
47
67
|`includeImages`| boolean | true | Whether to extract and store images |
48
68
69
+
Page range values are automatically clamped to valid bounds — out-of-range values are silently adjusted.
70
+
49
71
### Example: Using blob ID
50
72
51
73
```json
@@ -75,18 +97,22 @@ Get your Mistral API key from [Mistral AI Console](https://console.mistral.ai/).
75
97
}
76
98
```
77
99
100
+
### REST Endpoint
101
+
102
+
`POST /document-to-markdown` accepts `multipart/form-data` with a `file` field. Returns the same response structure as the MCP tool.
103
+
78
104
## Output Structure
79
105
80
106
### Response Format
81
107
82
108
The tool returns a text response containing:
83
109
84
-
1.**Status message**- Success or failure indication
85
-
2.**Output folder ID**- UUID of the folder containing all outputs
86
-
3.**Markdown blob ID**- ID of the generated markdown file
87
-
4.**Page count**- Number of pages processed
88
-
5.**Image count**- Number of images extracted (if any)
89
-
6.**Markdown content**- The full converted markdown
110
+
1.**Status message**— Success or failure indication
111
+
2.**Output folder ID**— UUID of the folder containing all outputs
112
+
3.**Markdown blob ID**— ID of the generated markdown file
113
+
4.**Page count**— Number of pages in the document
114
+
5.**Image count**— Number of images extracted (if any)
115
+
6.**Markdown content**— The full converted markdown
90
116
91
117
### File Organization
92
118
@@ -101,10 +127,6 @@ document-conversions/
101
127
└── ...
102
128
```
103
129
104
-
-**Folder ID**: Generated UUID to group related files
105
-
-**Markdown file**: Named after the original document (e.g., `report.md`)
106
-
-**Images**: Named by Mistral (e.g., `img-0.jpeg`, `img-1.jpeg`), format preserved
107
-
108
130
### Image References
109
131
110
132
Images in the markdown reference their blob URLs:
@@ -115,55 +137,45 @@ Images in the markdown reference their blob URLs:
115
137
116
138
### Storage Location
117
139
118
-
All outputs (markdown files and extracted images) are stored in the DKG node's configured blob storage under the `document-conversions/` prefix for organized grouping. The physical location depends on your blob storage backend:
140
+
All outputs are stored in blob storage under the `document-conversions/` prefix:
0 commit comments