diff --git a/src/agents/realtime/handoffs.py b/src/agents/realtime/handoffs.py index a3e5151f6..fa84b3a3f 100644 --- a/src/agents/realtime/handoffs.py +++ b/src/agents/realtime/handoffs.py @@ -13,10 +13,10 @@ from ..tracing.spans import SpanError from ..util import _error_tracing, _json from ..util._types import MaybeAwaitable +from . import RealtimeAgent if TYPE_CHECKING: from ..agent import AgentBase - from . import RealtimeAgent # The handoff input type is the type of data passed when the agent is called via a handoff. diff --git a/tests/realtime/test_realtime_handoffs.py b/tests/realtime/test_realtime_handoffs.py index a94c06bb0..7ada3db40 100644 --- a/tests/realtime/test_realtime_handoffs.py +++ b/tests/realtime/test_realtime_handoffs.py @@ -139,14 +139,6 @@ async def is_enabled(ctx, agent): h = realtime_handoff(rt, is_enabled=is_enabled) - # Patch missing symbol in module to satisfy isinstance in closure - import agents.realtime.handoffs as rh - - if not hasattr(rh, "RealtimeAgent"): - from agents.realtime import RealtimeAgent as _RT - - rh.RealtimeAgent = _RT # type: ignore[attr-defined] - from collections.abc import Awaitable from typing import cast as _cast