Skip to main content
Pass on_event to receive structured lifecycle events while a run executes.
Useful events cover run start/completion/failure, model attempts, text and reasoning deltas, tool start/progress/completion/failure, and human checkpoints. Keep handlers fast. Queue slow persistence work and redact sensitive tool inputs before forwarding events externally.
Last modified on July 26, 2026