Mistral AI for Deno
Adds instrumentation for the Mistral AI SDK. (default)
Requires SDK version 11.0.0 or higher.
Import name: Sentry.mistralAIIntegration
This integration is enabled by default when tracing is enabled. If you'd like to modify your default integrations, read this.
The mistralAIIntegration adds instrumentation for the @mistralai/mistralai SDK to capture agent tracing gen_ai spans, recording model, token usage, latency, and (when enabled) inputs and outputs.
Sentry.init({
dsn: "___PUBLIC_DSN___",
// Tracing must be enabled for agent tracing to work.
// `mistralAIIntegration` is then on by default; add it to `integrations` only to change its options.
tracesSampleRate: 1.0,
});
Sentry.init({
dsn: "___PUBLIC_DSN___",
// Tracing must be enabled for agent tracing to work.
// `mistralAIIntegration` is then on by default; add it to `integrations` only to change its options.
tracesSampleRate: 1.0,
});
To group multi-turn chats in Conversations and show who started them, set a conversation ID and user in every request that makes AI calls. See Tracking Conversations.
On Deno, preload Sentry's import hook so the Mistral SDK can be instrumented:
deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preload=npm:@sentry/deno/import app.ts
deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preload=npm:@sentry/deno/import app.ts
By default, tracing support is added to the following Mistral AI SDK calls:
chat.complete()/chat.parse()- Chat completion requestschat.stream()/chat.parseStream()- Streaming chat completionsembeddings.create()- Embedding requestsagents.complete()- Agent completion requestsagents.stream()- Streaming agent completions
Streaming and non-streaming requests are automatically detected and handled appropriately.
@mistralai/mistralai:>=2.0.0 <3
Type: boolean (optional)
Records inputs to Mistral AI SDK calls (such as prompts and messages).
Defaults to true if dataCollection.genAI.inputs is true, which is the default.
Type: boolean (optional)
Records outputs from Mistral AI SDK calls (such as generated text and responses).
Defaults to true if dataCollection.genAI.outputs is true, which is the default.
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
integrations: [
Sentry.mistralAIIntegration({
recordInputs: false,
recordOutputs: false,
}),
],
});
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
integrations: [
Sentry.mistralAIIntegration({
recordInputs: false,
recordOutputs: false,
}),
],
});
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").