reactor.sendCommand(), the events the model emits back, and an end-to-end example. For the
conceptual model and a quick start, see the overview.
LongLive-2.0 outputs a single video track, main_video, in chunks of 29 frames (~1.2s at
24fps). Transitions take effect on chunk boundaries. See
Chunks, scenes, and length for
how the per-scene 48-chunk budget and the cumulative session_chunk clock work.
Commands
Send commands to the model usingreactor.sendCommand(). Below are all available commands:
Refusals
A refused command fails your own call with a stable code. In JavaScript, the awaited call resolvesundefined, and the error event fires with operation: "sendCommand" and the code. In Python,
send_command() raises a ReactorError with the code.
reset and set_seed always succeed.
command_error message to every client when it refuses a command. Read
the refusal off the call instead. The broadcast reaches clients that did not send the command, and a
future major release removes it.
- set_shot
- scene_cut
- schedule_shot
- schedule_scene_cut
- start / pause / resume / reset
- set_seed
set_shot
Set the opening shot beforestart, or queue a soft shot change mid-stream. A shot keeps the
scene’s attention memory (the “sink tokens”) and continuity, swapping the prompt conditioning.
Use it for a new beat within the same world (a camera move, an action, a time skip). Mid-stream it
activates at the next chunk boundary and spends from the current scene’s 48-chunk budget.sendCommand() resolves with the shot_set message once the shot is accepted. When the prompt
is empty, the call fails with empty_prompt. When the previous run finished, it fails with
run_finished. See Refusals.Parameters:Example:
Messages from model
The model emits these events. Subscribe withreactor.on("message", ...) (or the generated React
hooks). Every message is delivered as JSON { "type": "<name>", "data": { … } }.
state payload
state is the single source of truth for the session’s observable state. Subscribe once and treat
it as the authoritative session snapshot; you generally do not need to track individual command
acknowledgements and chunk_complete events yourself.