You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a reusable type alias for agent instructions callbacks
### Summary
Add a reusable type alias for agent instructions callbacks and use it in `Agent.instructions` to improve readability and consistency.
### Changes Made
- Added `AgentInstructionsFunction` in `src/agents/agent.py`:
- `AgentInstructionsFunction = Callable[[RunContextWrapper[TContext], "Agent[TContext]"], MaybeAwaitable[str]]`
- Updated `Agent.instructions` type to:
- `instructions: str | AgentInstructionsFunction | None = None`
- No behavioral changes; typing/clarity only.
0 commit comments