Events
History Structure
HistoryStep Structure
agent.on(events.AI_MESSAGE, async ({ state }) => {
const triggerStep = state.history.find((step) => step.type === 'TRIGGER_NODE' || step.type === 'APP_TRIGGER_NODE');
const toolSteps = state.history.filter((step) => step.type === 'TOOL_NODE');
console.log(`Trigger: ${triggerStep?.nodeDisplayName}, Tools used: ${toolSteps.length}`);
});INIT
AI_MESSAGE
TRIGGER_EVENT
ERROR
ON_LOGICAL_CONDITION
ON_LOGICAL_CONDITION_RESULT
ANALYTICS_EVENT
TURN_END
Last updated