class GraphCallbackHandlerA path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
Extend this class and pass an instance through callbacks to observe graph
interrupts and resumes. Lifecycle methods are always awaited, including when
other callbacks run in the background. Set raiseError to propagate errors.
class Observer extends GraphCallbackHandler {
handleInterrupt(event: GraphInterruptEvent) {
console.log(event.runId, event.interrupts);
}
}
const observed = graph.withConfig({ callbacks: [new Observer()] });