Skip to content

Commit bb77759

Browse files
authored
Update agent.py
1 parent 64f558d commit bb77759

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/agents/agent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __post_init__(self):
256256

257257
if (
258258
self.prompt is not None
259-
and not isinstance(self.prompt, (Prompt, DynamicPromptFunction))
259+
and not isinstance(self.prompt, dict)
260260
and not callable(self.prompt)
261261
):
262262
raise TypeError(
@@ -297,10 +297,11 @@ def __post_init__(self):
297297
f"got {type(self.output_type).__name__}"
298298
)
299299

300+
# Fixed hooks validation - use AgentHooksBase instead of generic AgentHooks
300301
if self.hooks is not None:
301-
from .lifecycle import AgentHooks
302+
from .lifecycle import AgentHooksBase
302303

303-
if not isinstance(self.hooks, AgentHooks):
304+
if not isinstance(self.hooks, AgentHooksBase):
304305
raise TypeError(
305306
f"Agent hooks must be an AgentHooks instance or None, "
306307
f"got {type(self.hooks).__name__}"

0 commit comments

Comments
 (0)