AgentHookEvents
type AgentHookEvents<TContext, TOutput> = object;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
|
|
|
|
|
Properties
Section titled “Properties”agent_end
Section titled “agent_end”agent_end: [RunContext<TContext>, string];Note that the second argument is not consistent with the run hooks here. Changing the list is a breaking change, so we don’t make changes for it in the short term If we revisit the argument data structure (e.g., migrating to a single object instead), more properties could be easily added later on.
context
The context of the run
output
The output of the agent
agent_handoff
Section titled “agent_handoff”agent_handoff: [RunContext<TContext>, Agent<any, any>];context
The context of the run
agent
The agent that is handing off
nextAgent
The next agent to run
agent_start
Section titled “agent_start”agent_start: [RunContext<TContext>, Agent<TContext, TOutput>, AgentInputItem[]];context
The context of the run
agent
The agent that is starting
turnInput
The input items for the current turn
agent_tool_end
Section titled “agent_tool_end”agent_tool_end: [RunContext<TContext>, Tool<any>, string, object];context
The context of the run
agent
The agent that is ending a tool
tool
The tool that is ending
result
The result of the tool
agent_tool_start
Section titled “agent_tool_start”agent_tool_start: [RunContext<TContext>, Tool<any>, object];context
The context of the run
agent
The agent that is starting a tool
tool
The tool that is starting