The Python SDK provides decorators as an idiomatic alternative toDocumentation Index
Fetch the complete documentation index at: https://docs.reactor.inc/llms.txt
Use this file to discover all available pages before exploring further.
reactor.on(event, handler). Both approaches are equivalent. Use whichever you prefer.
@reactor.on_frame
Registers a callback to receive video frames as NumPy arrays.
Signature
frame is a NumPy array with shape (H, W, 3), dtype uint8, in RGB color order.
Example
@reactor.on_message
Registers a handler for messages from the model.
Signature
message is the payload sent by the model (typically a dictionary). Shape depends on the model.
Example
@reactor.on_status
Registers a handler for connection status changes. Supports three usage patterns.
Signature
Example
@reactor.on_error
Registers a handler for errors.
Signature
error is a ReactorError with fields code, message, timestamp, recoverable, component, and optional retry_after.
Example
@reactor.on_track
Registers a handler for a named media track received from the model.
Signature
The track name to listen for (e.g.,
"main_video").Example
For most use cases,
@reactor.on_frame is simpler since it delivers decoded NumPy frames directly. Use @reactor.on_track when you need access to the raw MediaStreamTrack.