Skip to content

[bot] Mistral classifiers.moderate() and related classification endpoints not instrumented #1917

@braintrust-bot

Description

@braintrust-bot

Summary

The @mistralai/mistralai TypeScript SDK exposes a classifiers resource with four model-execution endpoints for content moderation and classification. None are instrumented — no channels, no plugin handler, no wrapper proxy, and no auto-instrumentation config. Calls to any classifiers.* method produce no Braintrust spans.

This is directly comparable to OpenAI's moderations.create(), which is fully instrumented across all layers in this repo (wrapper, auto-instrumentation, channel, plugin).

What instrumentation is missing

SDK Method Description Model
client.classifiers.moderate() Moderate text content against policy categories mistral-moderation-2603
client.classifiers.moderateChat() Moderate chat conversation content mistral-moderation-2603
client.classifiers.classify() Classify text with custom/system categories Classification model
client.classifiers.classifyChat() Classify chat content with custom/system categories Classification model

All four are model inference endpoints — they accept input, run a model, and return generated classification/moderation scores. They are not CRUD or admin endpoints.

No coverage in any instrumentation layer:

  • Wrapper (js/src/wrappers/mistral.ts, lines 78–88): The mistralProxy switch only handles chat, fim, agents, and embeddings. No classifiers case.
  • Auto-instrumentation config (js/src/auto-instrumentations/configs/mistral.ts): No config for any Classifiers.* methods. Only Chat, Fim, Agents, and Embeddings classes are configured.
  • Channels (js/src/instrumentation/plugins/mistral-channels.ts): No channel definitions for classifier endpoints.
  • Plugin (js/src/instrumentation/plugins/mistral-plugin.ts): No handler for classifier calls.
  • Vendor types (js/src/vendor-sdk-types/mistral.ts, lines 181–187): MistralClient type only declares chat, fim, agents, embeddings. No classifiers property.

A grep for classif or moderate across js/src/wrappers/mistral.ts and js/src/instrumentation/plugins/mistral-plugin.ts returns zero matches.

Precedent in this repo

OpenAI moderations.create() — the directly comparable moderation API from a different provider — is fully instrumented:

Layer OpenAI Moderations Mistral Classifiers
Wrapper oai.ts (moderationProxy) Missing
Auto-instrumentation openai.ts config Missing
Channel moderationsCreate Missing
Plugin handler openai-plugin.ts Missing
Vendor types OpenAIModerationCreateParams / Response Missing

Braintrust docs status

not_found — The Braintrust Mistral integration page at https://www.braintrust.dev/docs/integrations/ai-providers/mistral documents chat completions, FIM, embeddings, agents, audio, and OCR. Classifiers/moderation are not mentioned.

Upstream references

Local files inspected

  • js/src/wrappers/mistral.ts — lines 78–88: proxy switch (no classifiers case)
  • js/src/auto-instrumentations/configs/mistral.ts — full file: no classifier configs
  • js/src/instrumentation/plugins/mistral-channels.ts — no classifier channels
  • js/src/instrumentation/plugins/mistral-plugin.ts — no classifier handlers
  • js/src/vendor-sdk-types/mistral.ts — lines 181–187: MistralClient missing classifiers
  • e2e/scenarios/mistral-instrumentation/ — no classifier test scenarios

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions