|
import pyarrow as pa |
|
from dora import DoraStatus |
|
from utils import speak |
|
from time import sleep |
|
|
|
|
|
class Operator: |
|
def __init__(self): |
|
self.location = ["KITCHEN", "OFFICE"] |
|
self.current_location = "KITCHEN" |
|
|
|
def speak(self, text: str): |
|
speak(text) |
|
|
|
def on_event(self, event, send_output): |
|
if event["type"] == "INPUT": |
|
id = event["id"] |
|
|
|
if id == "speech": |
|
text: str = event["value"][0].as_py().lower() |
|
if "stop" in text: |
|
return DoraStatus.STOP |
|
|
|
elif id == "reached_office": |
|
pass |
|
elif id == "reached_kitchen": |
|
pass |
|
|
|
return DoraStatus.CONTINUE |
|
|