Skip to content

feat(skills-next): add python SDK references#248

Open
evanpurkhiser wants to merge 1 commit into
mainfrom
evanpurkhiser/feat-skills-next-add-python-sdk-references
Open

feat(skills-next): add python SDK references#248
evanpurkhiser wants to merge 1 commit into
mainfrom
evanpurkhiser/feat-skills-next-add-python-sdk-references

Conversation

@evanpurkhiser

Copy link
Copy Markdown
Member

Direct LLM port of the existing python SDK skill into the skills-next per-SDK reference layout under skills-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.

Comment thread skills-next/references/sdks/python/index.md
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-skills-next-add-python-sdk-references branch from bf4b990 to 2a8e75f Compare July 2, 2026 21:14
Comment thread skills-next/references/sdks/python/index.md Outdated
Comment thread skills-next/references/sdks/python/index.md Outdated
@dingsdax dingsdax requested a review from a team July 6, 2026 08:49
| 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this beta?

Comment on lines +189 to +198
### `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)
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use this API

Suggested change
sentry_sdk.ai.set_conversation_id("conv_abc123")
sentry_sdk.set_attribute("gen_ai.conversation.id", "conv_abc123")

@alexander-alderman-webb alexander-alderman-webb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is just a port, that's fine then

@evanpurkhiser

Copy link
Copy Markdown
Member Author

Well, I'm trying to get these as correct as we can :)

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-skills-next-add-python-sdk-references branch from 2a8e75f to 059df49 Compare July 7, 2026 15:16
@evanpurkhiser

Copy link
Copy Markdown
Member Author

Automated fixes pushed addressing the review feedback on this PR:

  • index.md + tracing.md: added the missing import os to snippets that use os.environ.
  • index.md: fixed the "Auto-enabled vs Explicit" table — AI integrations map to OpenAIIntegration/AnthropicIntegration/etc. (not OpenTelemetryIntegration), and logging is auto-enabled (not paired with WSGI/ASGI); reworded the Django "before any imports" note.
  • ai-monitoring.md: removed the gen_ai.handoff section (a handoff is just a special tool execution); replaced the discouraged API with sentry_sdk.set_attribute("gen_ai.conversation.id", ...).

Note: the "why is this beta?" labels (OpenAI Agents SDK, Pydantic AI) were verified correct against the docs and left as-is.

Comment on lines +198 to +205
| 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 | — |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants