Skip to content

Commit e197187

Browse files
authored
Fix style and wording issues in handoffs.py (#1356)
1 parent 5c73311 commit e197187

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/agents/handoffs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ class Handoff(Generic[TContext, TAgent]):
119119
True, as it increases the likelihood of correct JSON input.
120120
"""
121121

122-
is_enabled: bool | Callable[[RunContextWrapper[Any], AgentBase[Any]], MaybeAwaitable[bool]] = (
123-
True
124-
)
122+
is_enabled: bool | Callable[
123+
[RunContextWrapper[Any], AgentBase[Any]], MaybeAwaitable[bool]
124+
] = True
125125
"""Whether the handoff is enabled. Either a bool or a Callable that takes the run context and
126126
agent and returns whether the handoff is enabled. You can use this to dynamically enable/disable
127127
a handoff based on your context/state."""
@@ -264,7 +264,7 @@ async def _invoke_handoff(
264264
async def _is_enabled(ctx: RunContextWrapper[Any], agent_base: AgentBase[Any]) -> bool:
265265
from .agent import Agent
266266

267-
assert callable(is_enabled), "is_enabled must be non-null here"
267+
assert callable(is_enabled), "is_enabled must be callable here"
268268
assert isinstance(agent_base, Agent), "Can't handoff to a non-Agent"
269269
result = is_enabled(ctx, agent_base)
270270

0 commit comments

Comments
 (0)