Skip to content

feat(mistral): extract PDF images as files and expose table format in Mistral Parser - #9856

Merged
waleedlatif1 merged 4 commits into
stagingfrom
feat/mistral-parser-extract-images
Nov 10, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
feat/mistral-parser-extract-images

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Mistral Parser (v3) gets an Extract Images switch: images Mistral OCR finds in the PDF (figures, logos, photos) come back as stored files on a new images (file[]) output, so an agent can pick the ones it wants and pass them on
  • Image bytes never travel through block outputs: each page image keeps its bounding box and gets a file_name matching its stored file, and image_base64 is stripped
  • Caps: at most 100 images per parse (image_limit is clamped), a 20 MB per-image cap (bigger images are skipped, not failed), and the shared 100 MB buffered-transfer budget across all images
  • New Tables option passes Mistral's table_format (markdown / html), so pages[].tables is populated instead of always empty; default stays inline
  • Advanced Max Images / Min Image Size fields, validated with the shared parseOptionalNumberInput
  • Only mistral_parser_v3 extracts images; v1/v2 never request them, and the knowledge-base OCR path (executeMistralParse) is unchanged

Type of Change

  • New feature

Testing

  • New lib/internal/mistral/images.test.ts and 4 new cases in operations.test.ts: base64 stripped and files named, 100-image cap, oversized image skipped, image_limit clamp (above cap / unset / zero), v3-only gate. Each guard was reverted and its test went red
  • bunx vitest run lib/internal/mistral tools/mistral blocks — 851 passed
  • check-block-registry.ts origin/staging, check:canvas-sentences, check:integration-catalog, check:docs; regenerated tool metadata and integration docs
  • lint:check + type-check via the pre-push hook; full check:audits and bun run test left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 10, 2026 10:23pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain from this review.

Summary

Adds image files and separate-table options to Mistral Parser v3.

  • Mistral Parser v3 returns extracted PDF images as files.
  • Mistral Parser v3 can return tables separately as Markdown or HTML.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Mistral Parser v3] --> B[Mistral OCR]
  B --> C{Extract Images enabled?}
  C -->|No| D[Return structured pages]
  C -->|Yes| E[Remove base64 and apply image caps]
  E --> F[Store image files]
  F --> G[Return pages and file references]
Loading

Reviews (4) · Last reviewed commit: "docs(mistral): describe Extract Images a..." · Reviewed by Greptile

Comment thread apps/sim/lib/internal/mistral/images.ts Resolved
Comment thread apps/sim/tools/mistral/parser.ts Resolved
Comment thread apps/sim/blocks/blocks/mistral_parse.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/blocks/blocks/mistral_parse.ts Resolved
Comment thread apps/sim/lib/internal/mistral/images.ts Resolved
Comment thread apps/sim/tools/mistral/types.ts Resolved
Comment thread apps/sim/blocks/blocks/mistral_parse.ts Resolved
…e format, align image switch with tool param
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 14 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/blocks/blocks/mistral_parse.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — e8cf711a Deployed Nov 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant