Google Gen AI for Nuxt
Adds instrumentation for the Google Gen AI SDK. (default)
Requires SDK version 11.0.0 or higher. On earlier versions, see the Agent Tracing setup for your SDK.
Import name: Sentry.googleGenAIIntegration
This integration is enabled by default when tracing is enabled. If you'd like to modify your default integrations, read this.
The googleGenAIIntegration adds instrumentation for the @google/genai 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
tracesSampleRate: 1.0,
integrations: [Sentry.googleGenAIIntegration()],
});
Sentry.init({
dsn: "___PUBLIC_DSN___",
// Tracing must be enabled for agent tracing to work
tracesSampleRate: 1.0,
integrations: [Sentry.googleGenAIIntegration()],
});
By default, tracing support is added to the following Google Gen AI SDK calls:
models.generateContent()- Generate content with a given modelmodels.generateContentStream()- Stream content generation with a given modelmodels.embedContent()- Generate embeddings with a given modelchats.create()- Create chat sessionssendMessage()- Send messages in chat sessionssendMessageStream()- Stream messages in chat sessions
Streaming and non-streaming requests are automatically detected and handled appropriately.
@google/genai:>=0.10.0 <3
Type: boolean (optional)
Records inputs to Google Gen 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 Google Gen 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.googleGenAIIntegration({
recordInputs: false,
recordOutputs: false,
}),
],
});
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
integrations: [
Sentry.googleGenAIIntegration({
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").