feat(skills-next): add python SDK references#248
Conversation
bf4b990 to
2a8e75f
Compare
| | Anthropic | `sentry-sdk` | anthropic 0.16.0+ | ✅ Yes | Stable | | ||
| | LangChain | `sentry-sdk` | langchain 0.1.0+ | ✅ Yes | Stable | | ||
| | LangGraph | `sentry-sdk` | langgraph 0.6.6+ | ✅ Yes | Stable | | ||
| | OpenAI Agents SDK | `sentry-sdk` | agents 0.0.19+ | ✅ Yes | ⚠️ Beta | |
| | HuggingFace Hub | `sentry-sdk` | huggingface_hub 0.24.7+ | ✅ Yes | Stable | | ||
| | LiteLLM | `sentry-sdk` | litellm 1.77.5+ | ❌ **No** | Stable | | ||
| | MCP | `sentry-sdk` | mcp 1.15.0+ | ✅ Yes | Stable | | ||
| | Pydantic AI | `sentry-sdk` | pydantic-ai 1.0.0+ | ✅ Yes | ⚠️ Beta | |
| ### `gen_ai.handoff` — Agent-to-agent transition | ||
|
|
||
| ```python | ||
| import sentry_sdk | ||
|
|
||
| with sentry_sdk.start_span(op="gen_ai.handoff", | ||
| name="handoff Billing → Refund Agent") as span: | ||
| span.set_data("gen_ai.agent.name", "Refund Agent") | ||
| result = refund_agent.run(context=billing_context) | ||
| ``` |
There was a problem hiding this comment.
Please remove, a handoff is a just a special tool execution.
| import sentry_sdk.ai | ||
|
|
||
| # Set at the start of a conversation | ||
| sentry_sdk.ai.set_conversation_id("conv_abc123") |
There was a problem hiding this comment.
Don't use this API
| sentry_sdk.ai.set_conversation_id("conv_abc123") | |
| sentry_sdk.set_attribute("gen_ai.conversation.id", "conv_abc123") |
alexander-alderman-webb
left a comment
There was a problem hiding this comment.
I guess this is just a port, that's fine then
|
Well, I'm trying to get these as correct as we can :) |
2a8e75f to
059df49
Compare
|
Automated fixes pushed addressing the review feedback on this PR:
Note: the "why is this beta?" labels (OpenAI Agents SDK, Pydantic AI) were verified correct against the docs and left as-is. |
| | Auto-enabled | Explicit required | | ||
| |-------------|-------------------| | ||
| | Django, Flask, FastAPI, Starlette, AIOHTTP, Tornado, Quart, Falcon, Pyramid, Sanic, Bottle | `DramatiqIntegration` | | ||
| | Celery, RQ, Huey, ARQ | `GRPCIntegration` | | ||
| | SQLAlchemy, Redis, asyncpg, pymongo | `StrawberryIntegration` | | ||
| | Requests, HTTPX, httpx2, aiohttp-client | `AsyncioIntegration` | | ||
| | OpenAI, Anthropic, LangChain, Pydantic AI, MCP | `OpenAIIntegration` / `AnthropicIntegration` / etc. | | ||
| | Python `logging`, Loguru | — | |
There was a problem hiding this comment.
Bug: The "Auto-Enabled vs Explicit Integrations" table incorrectly implies that AI integrations like OpenAI and LangChain require explicit registration, contradicting other documentation.
Severity: LOW
Suggested Fix
Update the table in index.md. Remove the AI integration classes (OpenAIIntegration, AnthropicIntegration, etc.) from the "Explicit required" column for the row concerning OpenAI, Anthropic, and others. The "Explicit required" cell for that row should be empty (e.g., '—'), similar to the row for Python logging. This will align the documentation with the actual behavior where these integrations are auto-enabled.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: skills-next/references/sdks/python/index.md#L198-L205
Potential issue: The "Auto-Enabled vs Explicit Integrations" table in `index.md` is
misleading. It lists several AI integrations (OpenAI, Anthropic, LangChain, Pydantic AI,
MCP) in the "Auto-enabled" column, but in the same row, it lists their corresponding
integration classes under the "Explicit required" column. This incorrectly suggests that
these integrations must be explicitly added. In reality, as confirmed by
`ai-monitoring.md` in the same pull request, these integrations are auto-enabled and do
not require explicit registration. This discrepancy will confuse users and could lead to
unnecessary boilerplate code.
Direct LLM port of the existing
pythonSDK skill into the skills-next per-SDK reference layout underskills-next/references/sdks/python/. This content has NOT been reviewed at all — it is a machine-generated port of the existing SDK skill, and every file should be treated as unverified.