on_debug_event
on_debug_event
Register a callback for debug events received at the /debug_events endpoint.
Use as a decorator. Both sync and async handlers are supported.
enable_debug_events() must be called before events will be delivered.
Parameters
handler
Callback function with signature (event_type: str, data: dict).
event_type— Event label string (e.g.,"barge","llm_error","session_start","step_change")data— Full event payload includingcall_id,label, and event-specific fields
Returns
Callable — The handler function, unchanged. This allows on_debug_event to be used as a
decorator.