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
{{ message }}
Repository navigation
Commit 81c10c9
Browse filesBrowse the repository at this point in the historyBrowse files
feat(mistral): extract PDF images as files and expose table format in Mistral Parser (#9856)
* feat(mistral): extract PDF images as files and expose table format in Mistral Parser
* fix(mistral): type the v3 images output as optional for the shared v2 base
* fix(mistral): name extracted images as storage does, drop inline table format, align image switch with tool param
* docs(mistral): describe Extract Images and Tables options in the Mistral Parser page
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/mistral_parse.mdx
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Mistral Parser
3
-
description: Extract text from PDF documents
3
+
description: Extract text, tables, and images from PDF documents
4
4
integration:
5
5
type: "mistral_parse_v3"
6
6
color: "#000000"
@@ -10,12 +10,12 @@ import { ReferenceDetails } from "@/components/ui/reference-details"
10
10
11
11
12
12
{/* MANUAL-CONTENT-START:intro */}
13
-
Use [Mistral's OCR API](https://mistral.ai/) to extract text and page structure from a PDF uploaded to Sim or supplied by URL. The current parser returns page Markdown, image metadata, the model, and usage information. **Specific Pages** accepts zero-based indices such as `0,1,2`; leave it empty to process all pages. The block offers Markdown, plain-text, and JSON format values, but its current result uses the structured page output documented below. Base64 image data is a hidden tool input and has no block control.
13
+
Use [Mistral's OCR API](https://mistral.ai/) to extract text and page structure from a PDF uploaded to Sim or supplied by URL. The current parser returns page Markdown, image metadata, the model, and usage information. **Specific Pages** accepts zero-based indices such as `0,1,2`; leave it empty to process all pages. The block offers Markdown, plain-text, and JSON format values, but its current result uses the structured page output documented below. Turn on **Extract Images** to get the images Mistral finds in the document (figures, logos, photos) as files on the `images` output, up to 100 per parse; each page's image entry carries a `file_name` matching its file. **Max Images**and **Min Image Size** (advanced) narrow what is extracted. **Tables** keeps tables inline in the page Markdown by default, or returns them separately as Markdown or HTML in each page's `tables` list.
14
14
{/* MANUAL-CONTENT-END */}
15
15
16
16
## Use the block [#usage-instructions]
17
17
18
-
Extract textfrom uploaded PDF documents, or from a URL.
18
+
Extract text, tables, and images from uploaded PDF documents, or from a URL. Images come back as files an agent can pass on.
19
19
20
20
## Actions
21
21
@@ -31,7 +31,11 @@ Parse PDF documents using Mistral OCR API
31
31
| --------- | ---- | -------- | ----------- |
32
32
|`file`| file | Yes | Normalized UserFile from file upload or file reference |
33
33
|`resultType`| string | No | Legacy parser output format \(markdown, text, or json; default markdown\). Versions 2 and 3 return structured OCR pages regardless of this value. |
34
+
|`includeImageBase64`| boolean | No | Extract the images in the document \(figures, logos, photos\) as files on the images output |
34
35
|`pages`| array | No | Specific pages to process \(array of page numbers, starting from 0\)|
36
+
|`imageLimit`| number | No | Maximum number of images to extract \(at most 100\)|
37
+
|`imageMinSize`| number | No | Minimum height and width of images to extract from the PDF |
38
+
|`tableFormat`| string | No | Return tables separately on each page as markdown or html instead of inline in the page markdown |
35
39
|`apiKey`| string | Yes | Mistral API key \(MISTRAL_API_KEY\)|
36
40
37
41
#### Output
@@ -47,20 +51,21 @@ Parse PDF documents using Mistral OCR API
47
51
| ↳ `top_left_y`| number | Top-left Y coordinate in pixels |
48
52
| ↳ `bottom_right_x`| number | Bottom-right X coordinate in pixels |
49
53
| ↳ `bottom_right_y`| number | Bottom-right Y coordinate in pixels |
50
-
| ↳ `image_base64`| string |Base64-encoded image data; returned only when the hidden includeImageBase64 input is enabled|
54
+
| ↳ `file_name`| string |Name of this image in the images output; present only when image extraction is on|
51
55
| ↳ `dimensions`| object | Page dimensions |
52
56
| ↳ `dpi`| number | Dots per inch |
53
57
| ↳ `height`| number | Page height in pixels |
54
58
| ↳ `width`| number | Page width in pixels |
55
-
| ↳ `tables`| array | Separate table objects, referenced from the markdown via placeholders like \[tbl-0.html\]. Mistral populates these only when table_format is "markdown" or "html"; Sim never sets it, so tables stay inline in the markdown and this list is empty |
56
-
| ↳ `hyperlinks`| array | Array of URL strings detected in the page \(e.g., \["https://...", "mailto:..."\]\)|
59
+
| ↳ `tables`| array | Separate table objects\(\{ id, content, format \}\), referenced from the markdown via placeholders like \[tbl-0.html\]. Populated only when tableFormat is markdown or html; otherwise tables stay inline in the markdown and this list is empty |
60
+
| ↳ `hyperlinks`| array | Array of URL strings detected in the page |
57
61
| ↳ `header`| string | Page header content. Mistral returns it only when extract_header is true \(it defaults to false\); Sim never sets it, so this is not returned |
58
62
| ↳ `footer`| string | Page footer content. Mistral returns it only when extract_footer is true \(it defaults to false\); Sim never sets it, so this is not returned |
59
63
|`model`| string | Mistral OCR model identifier \(e.g., mistral-ocr-latest\)|
60
64
|`usage_info`| object | Usage and processing statistics |
61
65
| ↳ `pages_processed`| number | Total number of pages processed |
62
66
| ↳ `doc_size_bytes`| number | Document file size in bytes |
63
67
|`document_annotation`| string | Structured annotation data as JSON string \(when applicable\)|
68
+
|`images`| file[]| Images extracted from the document, named page-<index>-<image id>; empty unless image extraction is on |
0 commit comments