From 3f1bb7cac1cab4b979b0ebdaa8ff4d45bb9146a8 Mon Sep 17 00:00:00 2001 From: Moishe Lettvin Date: Wed, 27 Dec 2023 19:11:49 -0500 Subject: [PATCH] fixing up the response --- src/dailyai/async_processor/async_processor.py | 7 ------- src/dailyai/orchestrator.py | 10 +++++++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/dailyai/async_processor/async_processor.py b/src/dailyai/async_processor/async_processor.py index cc0980e99..4b2cab6ec 100644 --- a/src/dailyai/async_processor/async_processor.py +++ b/src/dailyai/async_processor/async_processor.py @@ -214,11 +214,6 @@ class AsyncProcessor: pass -class ResponseArgs(TypedDict): - services: AIServiceConfig - message_handler: MessageHandler - output_queue: Queue - class Response(AsyncProcessor): def __init__( self, @@ -234,8 +229,6 @@ class Response(AsyncProcessor): self.chunks_in_preparation = Queue() - # self.sprite_loader = sprite_loader.SpriteLoader() - self.llm_responses: list[str] = [] def get_preparation_iterator(self) -> Iterator: diff --git a/src/dailyai/orchestrator.py b/src/dailyai/orchestrator.py index 45423526d..93f1b34b4 100644 --- a/src/dailyai/orchestrator.py +++ b/src/dailyai/orchestrator.py @@ -69,6 +69,7 @@ class Orchestrator(EventHandler): self.story_started = False self.message_handler = message_handler + self.conversation_processors: ConversationProcessorCollection = conversation_processors if conversation_processors.introduction is not None: intro = conversation_processors.introduction( @@ -303,7 +304,10 @@ class Orchestrator(EventHandler): self.display_thinking() self.message_handler.add_user_message(fragment) - new_response = Response(self.services, self.message_handler, self.output_queue) + response_type = self.conversation_processors.response or Response + new_response: Response = response_type( + self.services, self.message_handler, self.output_queue + ) new_response.set_state_callback( AsyncProcessorState.DONE, self.on_response_played ) @@ -360,7 +364,7 @@ class Orchestrator(EventHandler): "sc-listen-1", "sc-listen-1", ] - #self.display_images(listening_images) + # self.display_images(listening_images) def display_thinking(self): thinking_images = [ @@ -373,7 +377,7 @@ class Orchestrator(EventHandler): "sc-think-4", "sc-think-4", ] - #self.display_images(thinking_images) + # self.display_images(thinking_images) def action(self): self.logger.info("starting camera thread")