Graphrt

Mistral AI

Chat and FIM completions (non-streaming), embeddings, moderation, OCR of PDFs and images to markdown, models, files and batch jobs (deletes and cancels are node only)

Beta v0.1.0 Node.js 18 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the Mistral AI API. It is meant for workflows that need a second model next to the agent's own: chat and code completion, embeddings, moderation, and Mistral OCR to turn PDFs and images into markdown. Requests are non-streaming. Every operation is a workflow node, deletes and batch cancellation are node only.

What it can do

  • create_chat_completion: messages, response_format (JSON mode, JSON schema), tools, safe_prompt
  • create_fim_completion: Codestral fill-in-the-middle (prompt + suffix)
  • create_embeddings: mistral-embed or codestral-embed (with output_dimension, output_dtype)
  • Moderation: moderate_text (texts) and moderate_chat (the last message in its conversation)
  • ocr_document: a PDF or image (URL, data URL or uploaded file id) to markdown per page, with tables, headers, footers and an optional JSON-schema document_annotation_format
  • Models: list_models, get_model
  • Files: list_files (paginated), upload_file, get_file, download_file_content (saved to disk), delete_file
  • Batch jobs: create_batch_job (files or inline requests), get_batch_job, list_batch_jobs, cancel_batch_job

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Create chat completion mistral.create_chat_completion
  • Fill in the middle (code) mistral.create_fim_completion
  • Create embeddings mistral.create_embeddings
  • Moderate text mistral.moderate_text
  • Moderate conversation mistral.moderate_chat
  • OCR document mistral.ocr_document
  • List models mistral.list_models
  • Get model mistral.get_model
  • List files mistral.list_files
  • Upload file mistral.upload_file
Show all 18 actions
  • Get file mistral.get_file
  • Download file content mistral.download_file_content
  • Delete file mistral.delete_file
  • Create batch job mistral.create_batch_job
  • Get batch job mistral.get_batch_job
  • List batch jobs mistral.list_batch_jobs
  • Cancel batch job mistral.cancel_batch_job
  • Mistral AI API request mistral.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • MISTRAL_API_KEY Required
    API key, sent as Authorization: Bearer
  • MISTRAL_UPLOAD_DIR Optional
    Directory upload_file may read local files from (absolute path). Without it, file must be an https URL
  • MISTRAL_TOOL_ALLOW_BATCH Optional
    1 lets agent tools call create_batch_job (off by default: one call can queue thousands of paid requests)
  • MISTRAL_OUTPUT_DIR For download_file_content
    Absolute directory where file content is saved

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Mistral AI.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install mistral
workflow.yaml
- id: ocr
  type: mistral.ocr_document
  document: { type: document_url, document_url: "{{#start.pdf_url#}}" }
- id: fields
  type: mistral.create_chat_completion
  model: mistral-small-latest
  response_format: { type: json_object }
  messages:
    - { role: system, content: "Return JSON with invoice_number and total." }
    - { role: user, content: "{{#ocr.data.pages.0.markdown#}}" }
Plugins in the docs