Skip to content

Commit 66a2960

Browse files
committed
.
1 parent b53d599 commit 66a2960

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

sentry_sdk/integrations/openai_agents/patches/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def _create_get_model_wrapper(original_get_model):
2222
Wraps the agents.Runner._get_model method to wrap the get_response method of the model to create a AI client span.
2323
"""
2424

25+
@classmethod # type: ignore[misc]
2526
@wraps(original_get_model)
2627
def wrapped_get_model(cls, agent, run_config):
2728
# type: (agents.Runner, agents.Agent, agents.RunConfig) -> agents.Model

sentry_sdk/integrations/openai_agents/patches/runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def _create_run_wrapper(original_func):
2525
"""
2626
is_async = asyncio.iscoroutinefunction(original_func)
2727

28+
@classmethod # type: ignore[misc]
2829
@wraps(original_func)
2930
async def async_wrapper(cls, *args, **kwargs):
3031
# type: (agents.Runner, *Any, **Any) -> Any
@@ -36,6 +37,7 @@ async def async_wrapper(cls, *args, **kwargs):
3637

3738
return result
3839

40+
@classmethod # type: ignore[misc]
3941
@wraps(original_func)
4042
def sync_wrapper(cls, *args, **kwargs):
4143
# type: (agents.Runner, *Any, **Any) -> Any

sentry_sdk/integrations/openai_agents/patches/tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def _create_get_all_tools_wrapper(original_get_all_tools):
2121
Wraps the agents.Runner._get_all_tools method of the Runner class to wrap all function tools with Sentry instrumentation.
2222
"""
2323

24+
@classmethod # type: ignore[misc]
2425
@wraps(original_get_all_tools)
2526
async def wrapped_get_all_tools(cls, agent, context_wrapper):
2627
# type: (agents.Runner, agents.Agent, agents.RunContextWrapper) -> list[agents.Tool]

sentry_sdk/integrations/openai_agents/spans/agent_workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from typing import Any
1111

1212

13-
def agent_workflow_span(*args, **kwargs):
14-
# type: (*Any, **Any) -> sentry_sdk.tracing.Span
15-
agent = args[0]
13+
def agent_workflow_span(agent):
14+
# type: (Agent) -> sentry_sdk.tracing.Span
15+
1616
# Create a transaction or a span if an transaction is already active
1717
span = _get_start_span_function()(
1818
name=f"{agent.name} workflow",

0 commit comments

Comments
 (0)