Skip to content

[BOT ISSUE] Mistral OCR API (client.ocr.process()) not instrumented #1748

@braintrust-bot

Description

@braintrust-bot

Summary

The @mistralai/mistralai TypeScript SDK provides a stable client.ocr.process() method for document understanding using the Mistral OCR model. This repo has zero instrumentation for the OCR API surface — no channels, no plugin handler, no wrapper proxy, and no auto-instrumentation config. Users calling client.ocr.process() get no Braintrust spans.

What instrumentation is missing

  • Wrapper (js/src/wrappers/mistral.ts): Only proxies chat, embeddings, fim, and agents properties (lines 78–95). No proxy for ocr.
  • Auto-instrumentation config (js/src/auto-instrumentations/configs/mistral.ts): Only defines configs for chat, embeddings, FIM, and agents methods. No config for ocr.process.
  • Channels (js/src/instrumentation/plugins/mistral-channels.ts): No channel definition for OCR.
  • Plugin (js/src/instrumentation/plugins/mistral-plugin.ts): No handler for OCR calls.
  • Vendor types (js/src/vendor-sdk-types/mistral.ts): MistralClient only declares chat, fim, agents, and embeddings properties. No ocr property.

A grep for ocr (case-insensitive) across js/src/ returns zero matches.

Why this is a concrete gap

Mistral OCR is a dedicated model execution API — it sends document/image input to a model and receives generated structured text output (markdown with bounding boxes, extracted images, and page metadata). This is directly comparable to how generateContent works for Google GenAI. It uses a specific model (mistral-ocr-2503-completion) and returns token-like processing results. It is not a CRUD or management endpoint.

Braintrust docs status

not_found — The Braintrust Mistral integration page at https://www.braintrust.dev/docs/integrations/ai-providers/mistral documents chat completions only. OCR is not mentioned.

Upstream references

Precedent in this repo

This repo instruments 8 other Mistral SDK methods across 4 API categories (chat, embeddings, FIM, agents). OCR is a comparable model execution surface. Additionally, Google GenAI's generateContent (which processes multimodal input and returns structured text) is instrumented with the same depth.

Local files inspected

  • js/src/wrappers/mistral.ts
  • js/src/auto-instrumentations/configs/mistral.ts
  • js/src/instrumentation/plugins/mistral-channels.ts
  • js/src/instrumentation/plugins/mistral-plugin.ts
  • js/src/vendor-sdk-types/mistral.ts
  • e2e/scenarios/mistral-instrumentation/

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions