File tree Expand file tree Collapse file tree 3 files changed +5
-19
lines changed
sentry_sdk/integrations/openai_agents Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Original file line number Diff line number Diff line change 44
55import sentry_sdk
66
7- from ..spans import (
8- agent_workflow_span ,
9- update_agent_workflow_span ,
10- )
7+ from ..spans import agent_workflow_span
118from ..utils import _capture_exception
129
1310from typing import TYPE_CHECKING
@@ -27,7 +24,7 @@ def _create_run_wrapper(original_func):
2724 async def async_wrapper (* args , ** kwargs ):
2825 # type: (*Any, **Any) -> Any
2926 agent = args [0 ]
30- with agent_workflow_span (agent ) as span :
27+ with agent_workflow_span (agent ):
3128 result = None
3229 try :
3330 result = await original_func (* args , ** kwargs )
@@ -41,8 +38,6 @@ async def async_wrapper(*args, **kwargs):
4138 current_span .__exit__ (None , None , None )
4239
4340 raise exc from None
44- finally :
45- update_agent_workflow_span (span , agent , result )
4641
4742 @wraps (original_func )
4843 def sync_wrapper (* args , ** kwargs ):
Original file line number Diff line number Diff line change 1- from .agent_workflow import ( # noqa: F401
2- agent_workflow_span ,
3- update_agent_workflow_span ,
4- )
1+ from .agent_workflow import agent_workflow_span # noqa: F401
52from .ai_client import ai_client_span , update_ai_client_span # noqa: F401
63from .execute_tool import execute_tool_span , update_execute_tool_span # noqa: F401
74from .handoff import handoff_span # noqa: F401
Original file line number Diff line number Diff line change 66from typing import TYPE_CHECKING
77
88if TYPE_CHECKING :
9- from agents import Agent
10- from typing import Any
9+ import agents
1110
1211
1312def agent_workflow_span (agent ):
14- # type: (Agent) -> sentry_sdk.tracing.Span
13+ # type: (agents. Agent) -> sentry_sdk.tracing.Span
1514
1615 # Create a transaction or a span if an transaction is already active
1716 span = _get_start_span_function ()(
@@ -20,8 +19,3 @@ def agent_workflow_span(agent):
2019 )
2120
2221 return span
23-
24-
25- def update_agent_workflow_span (span , agent , result ):
26- # type: (sentry_sdk.tracing.Span, Agent, Any) -> None
27- pass
You can’t perform that action at this time.
0 commit comments