Skip to content

Commit 92a4383

Browse files
authored
fix(openai-agents): add support for realtime (#3533)
1 parent 73913ea commit 92a4383

File tree

13 files changed

+2908
-525
lines changed

13 files changed

+2908
-525
lines changed

packages/opentelemetry-instrumentation-openai-agents/opentelemetry/instrumentation/openai_agents/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,20 @@ def _instrument(self, **kwargs):
4141
# Silently handle import errors - OpenAI Agents SDK may not be available
4242
pass
4343

44+
try:
45+
from ._realtime_wrappers import wrap_realtime_session
46+
47+
wrap_realtime_session(tracer)
48+
except Exception:
49+
pass
50+
4451
def _uninstrument(self, **kwargs):
45-
# Hook-based approach: cleanup happens automatically when processors are removed
46-
pass
52+
try:
53+
from ._realtime_wrappers import unwrap_realtime_session
54+
55+
unwrap_realtime_session()
56+
except Exception:
57+
pass
4758

4859

4960
def is_metrics_enabled() -> bool:

0 commit comments

Comments
 (0)