← 返回 Skills 市场
tristanmanchester

Mistral PDF OCR

作者 Tristan Manchester · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
573
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install extracting-mistral-ocr
功能描述
Extracts text, tables, and images from PDFs (including scanned PDFs) using the Mistral OCR API. Use when user asks to OCR a PDF/image, extract text from a PD...
使用说明 (SKILL.md)

Mistral OCR PDF extraction

Quick start (default)

Run the bundled script to OCR a local PDF and write Markdown + JSON outputs:

python {baseDir}/scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr

Output directory layout:

  • combined.md (all pages concatenated)
  • pages/page-000.md (per-page markdown)
  • raw_response.json (full OCR response)
  • images/ (decoded embedded images, if requested)
  • tables/ (separate tables, if requested)

Workflow

  1. Pick input mode

    • Local PDF (most common): upload via Files API, then OCR via file_id.
    • Public URL: OCR directly via document_url.
  2. Choose output fidelity (defaults are safe for RAG)

    • Keep table_format=inline unless the user explicitly wants tables split out.
    • Set --include-image-base64 when the user needs figures/diagrams extracted.
    • Use --extract-header/--extract-footer if header/footer noise hurts downstream search.
  3. Run OCR

    • Use scripts/mistral_ocr_extract.py to produce a deterministic on-disk artefact set.
  4. (Optional) Structured extraction from the whole document

    • If the user wants fields (invoice totals, contract parties, etc.), provide an annotation prompt.
    • The OCR API can return a document-level document_annotation in addition to page markdown.

    Example:

    python {baseDir}/scripts/mistral_ocr_extract.py \
      --input invoice.pdf \
      --out out/invoice \
      --annotation-prompt "Extract supplier_name, invoice_number, invoice_date (ISO-8601), currency, total_amount. Return JSON." \
      --annotation-format json_object
    

Decision rules

  • If the PDF is local and not publicly accessible, upload it (the script does this automatically).
  • If the PDF URL is private or requires authentication, do not pass it as document_url; upload instead.
  • If output quality is critical, prefer table_format=html for downstream parsing over brittle regex.

Common failure modes

  • Missing MISTRAL_API_KEY: set it in the environment before running.
  • URL OCR fails: the URL likely is not publicly accessible; upload the file.
  • Large files: upload supports large files, but very large PDFs may need page selection (--pages) or batch processing.

References

  • API + parameters: references/mistral_ocr_api.md
  • Output mapping rules (placeholders to extracted images/tables): references/output_mapping.md
  • Example annotation prompts for common document types: references/annotation_prompts.md
安全使用建议
What to consider before installing: - The code and SKILL.md require MISTRAL_API_KEY and network access; the registry metadata incorrectly omits that. Do not assume no credentials are needed. Ask the publisher to fix the metadata if unclear. - This skill uploads documents (including private or scanned PDFs) to Mistral's API. If your documents contain sensitive data (PII, secrets, financial data), review Mistral's privacy/retention policy and legal terms before using. - The script optionally includes embedded images (base64) in requests and can request document-level annotations that extract structured fields — these increase data sent to the API. - Uploaded files may remain on the provider if the SDK/version doesn't support deletion; the script's cleanup is best-effort. If you need guaranteed removal, verify deletion behavior with a test upload or contact Mistral. - The dependency is a normal PyPI package (mistralai). Install in an isolated environment and inspect the package if you need higher assurance. - If you plan to use this skill in automated agents, ensure the MISTRAL_API_KEY has least-privilege scope (if supported) and rotate/revoke it as needed. - If anything is unclear (why metadata omitted the API key, or about retention/deletion), ask the skill owner to clarify before enabling it for sensitive documents.
功能分析
Type: OpenClaw Skill Name: extracting-mistral-ocr Version: 1.0.0 The OpenClaw skill 'extracting-mistral-ocr' is benign. Its `SKILL.md` clearly defines its purpose (OCR via Mistral API) and requests `Read,Write,Bash(python:*)` permissions, which are necessary for its function. The Python script `scripts/mistral_ocr_extract.py` correctly handles input files/URLs by uploading them to or referencing them with the Mistral API, and writes outputs to a specified directory. There is no evidence of prompt injection, data exfiltration, unauthorized network calls, persistence mechanisms, or other malicious intent. Input sanitization for file paths and API parameters appears robust, relying on the Mistral API for processing and returning safe identifiers.
能力评估
Purpose & Capability
The skill's name and description (OCR PDFs via Mistral) match the code and docs: the script uploads local files or calls a public URL and invokes Mistral's OCR. However the registry metadata claims no required environment variables or primary credential while both SKILL.md and the script require MISTRAL_API_KEY. This mismatch is an incoherence in the declared purpose/capability surface.
Instruction Scope
The SKILL.md and bundled script are narrowly scoped to OCR: uploading files to Mistral Files API, calling Mistral OCR, and writing deterministic outputs (markdown, images, JSON). The instructions do not attempt to read unrelated system files or secrets. They do instruct uploading documents (including private PDFs) to an external API, which is expected for OCR but has privacy implications.
Install Mechanism
There is no download-from-URL install; the bundle includes a requirements.txt specifying mistralai>=1.0.0. That is a standard PyPI dependency and proportionate for this task. No suspicious remote install URLs or archive extraction were found.
Credentials
The script and SKILL.md require the MISTRAL_API_KEY environment variable (and network access) to call the third-party OCR API. The registry metadata incorrectly lists no required env vars/credentials — this is inconsistent and could mislead users into installing without supplying the key. Requesting a single API key for the external OCR service is proportionate, but the metadata mismatch is a red flag. Also be aware the skill will transmit full document content (and optional embedded images) to the Mistral service.
Persistence & Privilege
The skill does not request permanent 'always' presence and doesn't modify other skills or system-wide agent settings. It runs a local script and uses the Mistral SDK; no elevated platform privileges are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install extracting-mistral-ocr
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /extracting-mistral-ocr 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of extracting-mistral-ocr. - Supports extracting text, tables, and images from PDFs (including scanned PDFs) via the Mistral OCR API. - Outputs Markdown, JSON, and extracted assets (images, tables) to organized directories. - Allows structured field extraction using annotation prompts. - Requires Python 3.9+, the mistralai package, network access, and a MISTRAL_API_KEY.
元数据
Slug extracting-mistral-ocr
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Mistral PDF OCR 是什么?

Extracts text, tables, and images from PDFs (including scanned PDFs) using the Mistral OCR API. Use when user asks to OCR a PDF/image, extract text from a PD... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 573 次。

如何安装 Mistral PDF OCR?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install extracting-mistral-ocr」即可一键安装,无需额外配置。

Mistral PDF OCR 是免费的吗?

是的,Mistral PDF OCR 完全免费(开源免费),可自由下载、安装和使用。

Mistral PDF OCR 支持哪些平台?

Mistral PDF OCR 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mistral PDF OCR?

由 Tristan Manchester(@tristanmanchester)开发并维护,当前版本 v1.0.0。

💬 留言讨论