콘텐츠로 이동

AgentHookEvents

이 콘텐츠는 아직 번역되지 않았습니다.

type AgentHookEvents<TContext, TOutput> = object;
Type Parameter Default type

TContext

UnknownContext

TOutput extends AgentOutputType

TextOutput

agent_end: [context: RunContext<TContext>, output: 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: [context: RunContext<TContext>, nextAgent: Agent<any, any>];

context

The context of the run

agent

The agent that is handing off

nextAgent

The next agent to run


agent_start: [context: RunContext<TContext>, agent: Agent<TContext, TOutput>, turnInput?: AgentInputItem[]];

context

The context of the run

agent

The agent that is starting

turnInput

The input items for the current turn


agent_tool_end: [context: RunContext<TContext>, tool: Tool<any>, result: string, details: 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: [context: RunContext<TContext>, tool: Tool<any>, details: object];

context

The context of the run

agent

The agent that is starting a tool

tool

The tool that is starting