Skip to content

Commit dbdebfd

Browse files
committed
rename to claude agent sdk
1 parent 50fa3c4 commit dbdebfd

File tree

7 files changed

+86
-86
lines changed

7 files changed

+86
-86
lines changed

scripts/populate_tox/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
},
7979
"num_versions": 2,
8080
},
81-
"claude_code_sdk": {
81+
"claude_agent_sdk": {
8282
"package": "claude-agent-sdk",
8383
"deps": {
8484
"*": ["pytest-asyncio"],

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"fastmcp",
7575
],
7676
"Agents": [
77-
"claude_code_sdk",
77+
"claude_agent_sdk",
7878
"openai_agents",
7979
"pydantic_ai",
8080
],

sentry_sdk/integrations/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def iter_default_integrations(
6767
_AUTO_ENABLING_INTEGRATIONS = [
6868
"sentry_sdk.integrations.aiohttp.AioHttpIntegration",
6969
"sentry_sdk.integrations.anthropic.AnthropicIntegration",
70-
"sentry_sdk.integrations.claude_code_sdk.ClaudeCodeSDKIntegration",
70+
"sentry_sdk.integrations.claude_agent_sdk.ClaudeCodeSDKIntegration",
7171
"sentry_sdk.integrations.ariadne.AriadneIntegration",
7272
"sentry_sdk.integrations.arq.ArqIntegration",
7373
"sentry_sdk.integrations.asyncpg.AsyncPGIntegration",
@@ -128,7 +128,7 @@ def iter_default_integrations(
128128
"celery": (4, 4, 7),
129129
"chalice": (1, 16, 0),
130130
"clickhouse_driver": (0, 2, 0),
131-
"claude_code_sdk": (0, 1, 0),
131+
"claude_agent_sdk": (0, 1, 0),
132132
"cohere": (5, 4, 0),
133133
"django": (1, 8),
134134
"dramatiq": (1, 9),

sentry_sdk/integrations/claude_code_sdk.py renamed to sentry_sdk/integrations/claude_agent_sdk.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
Usage:
1212
import sentry_sdk
13-
from sentry_sdk.integrations.claude_code_sdk import ClaudeCodeSDKIntegration
13+
from sentry_sdk.integrations.claude_agent_sdk import ClaudeCodeSDKIntegration
1414
1515
sentry_sdk.init(
1616
dsn="...",
@@ -57,7 +57,7 @@
5757
from sentry_sdk.tracing import Span
5858

5959

60-
class ClaudeCodeSDKIntegration(Integration):
60+
class ClaudeAgentSDKIntegration(Integration):
6161
"""
6262
Integration for Claude Agent SDK.
6363
@@ -66,7 +66,7 @@ class ClaudeCodeSDKIntegration(Integration):
6666
Requires send_default_pii=True in Sentry init. Defaults to True.
6767
"""
6868

69-
identifier = "claude_code_sdk"
69+
identifier = "claude_agent_sdk"
7070
origin = f"auto.ai.{identifier}"
7171

7272
def __init__(self, include_prompts: bool = True) -> None:
@@ -75,7 +75,7 @@ def __init__(self, include_prompts: bool = True) -> None:
7575
@staticmethod
7676
def setup_once() -> None:
7777
version = package_version("claude_agent_sdk")
78-
_check_minimum_version(ClaudeCodeSDKIntegration, version)
78+
_check_minimum_version(ClaudeAgentSDKIntegration, version)
7979

8080
# Patch the query function
8181
claude_agent_sdk.query = _wrap_query(original_query)
@@ -97,7 +97,7 @@ def _capture_exception(exc: "Any") -> None:
9797
event, hint = event_from_exception(
9898
exc,
9999
client_options=sentry_sdk.get_client().options,
100-
mechanism={"type": "claude_code_sdk", "handled": False},
100+
mechanism={"type": "claude_agent_sdk", "handled": False},
101101
)
102102
sentry_sdk.capture_event(event, hint=hint)
103103

@@ -106,10 +106,10 @@ def _set_span_input_data(
106106
span: "Span",
107107
prompt: "str",
108108
options: "Optional[Any]",
109-
integration: "ClaudeCodeSDKIntegration",
109+
integration: "ClaudeAgentSDKIntegration",
110110
) -> None:
111111
"""Set input data on the span."""
112-
set_data_normalized(span, SPANDATA.GEN_AI_SYSTEM, "claude-code")
112+
set_data_normalized(span, SPANDATA.GEN_AI_SYSTEM, "claude-agent-sdk-python")
113113
set_data_normalized(span, SPANDATA.GEN_AI_OPERATION_NAME, "chat")
114114

115115
# Extract configuration from options if available
@@ -187,7 +187,7 @@ def _extract_tool_calls(message: "Any") -> "Optional[list]":
187187
def _set_span_output_data(
188188
span: "Span",
189189
messages: "list",
190-
integration: "ClaudeCodeSDKIntegration",
190+
integration: "ClaudeAgentSDKIntegration",
191191
) -> None:
192192
"""Set output data on the span from collected messages."""
193193
response_texts = []
@@ -273,7 +273,7 @@ def _wrap_query(original_func: "Any") -> "Any":
273273
async def wrapper(
274274
*, prompt: str, options: "Optional[Any]" = None, **kwargs: "Any"
275275
) -> "AsyncGenerator[Any, None]":
276-
integration = sentry_sdk.get_client().get_integration(ClaudeCodeSDKIntegration)
276+
integration = sentry_sdk.get_client().get_integration(ClaudeAgentSDKIntegration)
277277
if integration is None:
278278
async for message in original_func(prompt=prompt, options=options, **kwargs):
279279
yield message
@@ -285,8 +285,8 @@ async def wrapper(
285285

286286
span = get_start_span_function()(
287287
op=OP.GEN_AI_CHAT,
288-
name=f"claude-code query {model}".strip(),
289-
origin=ClaudeCodeSDKIntegration.origin,
288+
name=f"claude-agent-sdk query {model}".strip(),
289+
origin=ClaudeAgentSDKIntegration.origin,
290290
)
291291
span.__enter__()
292292

@@ -315,7 +315,7 @@ def _wrap_client_query(original_method: "Any") -> "Any":
315315

316316
@wraps(original_method)
317317
async def wrapper(self: "Any", prompt: str, **kwargs: "Any") -> "Any":
318-
integration = sentry_sdk.get_client().get_integration(ClaudeCodeSDKIntegration)
318+
integration = sentry_sdk.get_client().get_integration(ClaudeAgentSDKIntegration)
319319
if integration is None:
320320
return await original_method(self, prompt, **kwargs)
321321

@@ -330,8 +330,8 @@ async def wrapper(self: "Any", prompt: str, **kwargs: "Any") -> "Any":
330330

331331
span = get_start_span_function()(
332332
op=OP.GEN_AI_CHAT,
333-
name=f"claude-code client {model}".strip(),
334-
origin=ClaudeCodeSDKIntegration.origin,
333+
name=f"claude-agent-sdk client {model}".strip(),
334+
origin=ClaudeAgentSDKIntegration.origin,
335335
)
336336
span.__enter__()
337337

@@ -367,7 +367,7 @@ def _wrap_receive_response(original_method: "Any") -> "Any":
367367

368368
@wraps(original_method)
369369
async def wrapper(self: "Any", **kwargs: "Any") -> "AsyncGenerator[Any, None]":
370-
integration = sentry_sdk.get_client().get_integration(ClaudeCodeSDKIntegration)
370+
integration = sentry_sdk.get_client().get_integration(ClaudeAgentSDKIntegration)
371371
if integration is None:
372372
async for message in original_method(self, **kwargs):
373373
yield message

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_file_text(file_name):
5252
"celery": ["celery>=3"],
5353
"celery-redbeat": ["celery-redbeat>=2"],
5454
"chalice": ["chalice>=1.16.0"],
55-
"claude_code_sdk": ["claude-agent-sdk>=0.1.0"],
55+
"claude_agent_sdk": ["claude-agent-sdk>=0.1.0"],
5656
"clickhouse-driver": ["clickhouse-driver>=0.2.0"],
5757
"django": ["django>=1.8"],
5858
"falcon": ["falcon>=1.4"],
File renamed without changes.

0 commit comments

Comments
 (0)