class BaseOperator(object):
Initialize the operator with empty interaction state and a template
that defines valid interaction types.
- textual_instruction: natural-language commands or prompts.
- visual_instruction: image/video-based guidance signals.
- action_instruction: mouse, keyboard, or gamepad inputs used to
control trajectory and viewpoint.
self.current_interaction = []
self.interaction_template = []
def get_interaction(self, interaction_list):
Receive and validate a batch of interaction commands. Each element
in `interaction_list` is checked against `self.interaction_template`
before being appended to the current interaction buffer.
interaction_list (list): A list of interaction commands
(e.g., ["forward", "camera_up"]).
ValueError: If any interaction is not found in the template.
for act in interaction_list:
self.check_interaction(act)
self.current_interaction.append(interaction_list)
def check_interaction(self, interaction):
Validate a single interaction command against the allowed template.
interaction (str): The interaction command to validate.
bool: True if the interaction is valid.
ValueError: If the interaction is not in the template.
if interaction not in self.interaction_template:
raise ValueError(f"{interaction} not in template")
def process_interaction(self):
Convert the buffered raw interactions into a model-ready format.
This method handles encoding, tokenization, or any task-specific
transformation of interaction signals.
Called by Pipeline.process() before generation.
def process_perception(self):
Process incoming visual and audio perception signals. Unlike
process_interaction(), this method is designed for real-time,
continuously updated sensory streams (e.g., live camera feeds
Called by Pipeline.process() when real-time perception updates