HookRunner
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HookRunner(hooks?, errorHandler?): HookRunner;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”HookRunner
Methods
Section titled “Methods”getHooks()
Section titled “getHooks()”getHooks(): HarnessHooks;Returns
Section titled “Returns”has(hookName): boolean;Check if a specific hook is configured.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”boolean
merge()
Section titled “merge()”merge(additionalHooks): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void
onAgentEnd()
Section titled “onAgentEnd()”onAgentEnd(context, agentId): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onAgentStart()
Section titled “onAgentStart()”onAgentStart(context, agentId): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onConversationEnd()
Section titled “onConversationEnd()”onConversationEnd(session, outcome): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onEnd()
Section titled “onEnd()”onEnd(context, result): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
{ |
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onError()
Section titled “onError()”onError(context, error): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onHandoff()
Section titled “onHandoff()”onHandoff( context, from, to,reason): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onMessage()
Section titled “onMessage()”onMessage(context, message): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onSessionEnd()
Section titled “onSessionEnd()”onSessionEnd(session, metadata): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onStart()
Section titled “onStart()”onStart(context): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<void>
onStepEnd()
Section titled “onStepEnd()”onStepEnd( context, step,result): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onStepStart()
Section titled “onStepStart()”onStepStart(context, step): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onStreamPart()
Section titled “onStreamPart()”onStreamPart(context, part): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onTokensUpdate()
Section titled “onTokensUpdate()”onTokensUpdate(context, turn): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onToolCall()
Section titled “onToolCall()”onToolCall(context, call): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onToolError()
Section titled “onToolError()”onToolError( context, call,error): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onToolResult()
Section titled “onToolResult()”onToolResult(context, call): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void>
onTurnEnd()
Section titled “onTurnEnd()”onTurnEnd(context, summary): Promise<void | TurnEndHookResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<void | TurnEndHookResult>
run<K>(hookName, ...args): Promise<void>;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”Promise<void>
setHooks()
Section titled “setHooks()”setHooks(hooks): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void