Run context
RunContextWrapper
dataclass
Bases: Generic[TContext]
This wraps the context object that you passed to Runner.run(). It also contains
information about the usage of the agent run so far.
NOTE: Contexts are not passed to the LLM. They're a way to pass dependencies and data to code you implement, like tool functions, callbacks, hooks, etc.
Source code in src/agents/run_context.py
context
instance-attribute
The context object (or None), passed by you to Runner.run()
AgentHookContext
dataclass
Bases: RunContextWrapper[TContext]
Context passed to agent hooks (on_start, on_end).
Source code in src/agents/run_context.py
turn_input
class-attribute
instance-attribute
turn_input: list[TResponseInputItem] = field(
default_factory=list
)
The input items for the current turn.
context
instance-attribute
The context object (or None), passed by you to Runner.run()