Skip to content

EventHandlers

Defined in: agent/event-handlers.ts:21

Named event handlers for different event types.

optional onGadgetCall: (call) => void | Promise<void>

Defined in: agent/event-handlers.ts:26

Called when a gadget is about to be executed

string[]

string

string

Record<string, unknown>

string

void | Promise<void>


optional onGadgetResult: (result) => void | Promise<void>

Defined in: agent/event-handlers.ts:35

Called when a gadget execution completes

string

string

string

Record<string, unknown>

string

void | Promise<void>


optional onHumanInputRequired: (data) => void | Promise<void>

Defined in: agent/event-handlers.ts:44

Called when human input is required

string

string

void | Promise<void>


optional onOther: (event) => void | Promise<void>

Defined in: agent/event-handlers.ts:47

Called for any other event type

StreamEvent

void | Promise<void>


optional onText: (content) => void | Promise<void>

Defined in: agent/event-handlers.ts:23

Called when text is generated by the LLM

string

void | Promise<void>