a few fixes for new output queue format
This commit is contained in:
@@ -246,8 +246,8 @@ class Orchestrator(EventHandler):
|
|||||||
self.story_started = True
|
self.story_started = True
|
||||||
|
|
||||||
def on_participant_left(self, participant, reason):
|
def on_participant_left(self, participant, reason):
|
||||||
|
self.logger.info(f"Participant {participant} left")
|
||||||
if len(self.client.participants()) < 2:
|
if len(self.client.participants()) < 2:
|
||||||
self.logger.info(f"Participant {participant} left")
|
|
||||||
self.participant_left = True
|
self.participant_left = True
|
||||||
|
|
||||||
def on_app_message(self, message, sender):
|
def on_app_message(self, message, sender):
|
||||||
@@ -392,7 +392,7 @@ class Orchestrator(EventHandler):
|
|||||||
self.logger.info(f"Lag to stop stream after interruption {time.perf_counter() - self.interrupt_time}")
|
self.logger.info(f"Lag to stop stream after interruption {time.perf_counter() - self.interrupt_time}")
|
||||||
self.interrupt_time = None
|
self.interrupt_time = None
|
||||||
|
|
||||||
if frame["type"] == "start_stream":
|
if frame.frame_type == FrameType.START_STREAM:
|
||||||
self.is_interrupted.clear()
|
self.is_interrupted.clear()
|
||||||
|
|
||||||
self.output_queue.task_done()
|
self.output_queue.task_done()
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class AnimatedSpriteLLMResponse(LLMResponse):
|
|||||||
self.image_bytes = []
|
self.image_bytes = []
|
||||||
|
|
||||||
def start_preparation(self) -> None:
|
def start_preparation(self) -> None:
|
||||||
|
super().start_preparation()
|
||||||
|
|
||||||
for filename in self.filenames:
|
for filename in self.filenames:
|
||||||
full_path = os.path.join(os.path.dirname(__file__), "sprites/", filename)
|
full_path = os.path.join(os.path.dirname(__file__), "sprites/", filename)
|
||||||
print(full_path)
|
print(full_path)
|
||||||
@@ -72,7 +74,7 @@ class AnimatedSpriteLLMResponse(LLMResponse):
|
|||||||
def get_frames_from_tts_response(self, audio_frame) -> list[OutputQueueFrame]:
|
def get_frames_from_tts_response(self, audio_frame) -> list[OutputQueueFrame]:
|
||||||
return [
|
return [
|
||||||
OutputQueueFrame(FrameType.AUDIO_FRAME, audio_frame),
|
OutputQueueFrame(FrameType.AUDIO_FRAME, audio_frame),
|
||||||
random.choice(self.image_bytes)
|
OutputQueueFrame(FrameType.IMAGE_FRAME, random.choice(self.image_bytes))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -119,14 +121,9 @@ def add_bot_to_room(room_url, token, expiration) -> None:
|
|||||||
expiration=expiration,
|
expiration=expiration,
|
||||||
)
|
)
|
||||||
|
|
||||||
FORMAT = f"%(levelno)s %(asctime)s %(message)s"
|
logging.basicConfig(format=f"%(levelno)s %(asctime)s %(message)s")
|
||||||
# Remove any handlers added by imported modules so we can use our formatting
|
|
||||||
while logging.root.handlers:
|
|
||||||
logging.root.removeHandler(logging.root.handlers[-1])
|
|
||||||
logging.basicConfig(format=FORMAT)
|
|
||||||
logger: logging.Logger = logging.getLogger("dailyai")
|
logger: logging.Logger = logging.getLogger("dailyai")
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
logger.info("hello world")
|
|
||||||
|
|
||||||
orchestrator = Orchestrator(
|
orchestrator = Orchestrator(
|
||||||
orchestrator_config,
|
orchestrator_config,
|
||||||
|
|||||||
Reference in New Issue
Block a user