diff --git a/docs/product/insights/ai/agents/getting-started.mdx b/docs/product/insights/ai/agents/getting-started.mdx index c390ea6ab88346..a1e5e125ba86bd 100644 --- a/docs/product/insights/ai/agents/getting-started.mdx +++ b/docs/product/insights/ai/agents/getting-started.mdx @@ -8,193 +8,11 @@ Sentry AI Agent Monitoring helps you track and debug AI agent applications using To start sending AI agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow one of the guides below: -## Supported SDKs +- [Python](/platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module) +- [Node.js](/platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module/) -### JavaScript - Vercel AI SDK -The Sentry JavaScript SDK supports AI agent monitoring through the Vercel AI integration, which works with Node.js and Bun runtimes. This integration automatically captures spans for your AI agent workflows using the AI SDK's built-in telemetry. - -#### Supported Platforms - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -#### Quick Start with Vercel AI SDK - -```javascript -import * as Sentry from "@sentry/node"; - -// Sentry init needs to be above everything else -Sentry.init({ - tracesSampleRate: 1.0, - integrations: [Sentry.vercelAIIntegration()], -}); - -import { generateText } from "ai"; -import { openai } from "@ai-sdk/openai"; - -// Your AI agent function -async function aiAgent(userQuery) { - const result = await generateText({ - model: openai("gpt-4o"), - prompt: userQuery, - experimental_telemetry: { - isEnabled: true, - functionId: "ai-agent-main", - recordInputs: true, - recordOutputs: true, - }, - }); - - return result.text; -} -``` - - - -We'll be adding AI agent integrations continuously. Please vote on [GitHub](https://github.com/getsentry/sentry-javascript/issues/16960) which one you'd like to see next. You can also instrument AI agents manually by following our [manual instrumentation guide](/platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module). - - - -### Python - OpenAI Agents - -The Sentry Python SDK supports OpenAI Agents SDK. - -#### Supported Platforms - -- - -#### Quick Start with OpenAI Agents - -```python -import sentry_sdk -import agents -from pydantic import BaseModel - -sentry_sdk.init( - dsn="YOUR_DSN", - traces_sample_rate=1.0, - send_default_pii=True, # Include LLM inputs/outputs -) - -# Create your AI agent -my_agent = agents.Agent( - name="My Agent", - instructions="You are a helpful assistant.", - model="gpt-4o-mini", -) - -# Your AI agent function -result = await agents.Runner.run( - my_agent, - input=user_query, -) - -``` - - + You can also instrument AI agents manually by following our [manual instrumentation guides](/platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module).