some progress on the sprite sample app

This commit is contained in:
Moishe Lettvin
2023-12-30 08:45:25 -05:00
parent 0fc585a690
commit 9304cb3a7a
12 changed files with 43 additions and 8 deletions

View File

@@ -80,7 +80,7 @@ class AsyncProcessor:
self.was_interrupted = False
self.logger: logging.Logger = logging.getLogger("bot-instance")
self.logger: logging.Logger = logging.getLogger("dailyai")
def set_state(self, state: int) -> None:
if state in AsyncProcessorState.state_transitions[self.state]:

View File

@@ -67,7 +67,7 @@ class IndexingMessageHandler(MessageHandler):
self.index_writer_thread = Thread(target=self.storage_writer, daemon=True)
self.index_writer_thread.start()
self.logger = logging.getLogger("bot-instance")
self.logger = logging.getLogger("dailyai")
def shutdown(self):
self.finalize_user_message()

View File

@@ -67,7 +67,7 @@ class Orchestrator(EventHandler):
self.token: str = daily_config.token
self.expiration: float = daily_config.expiration
self.logger: logging.Logger = logging.getLogger("bot-instance")
self.logger: logging.Logger = logging.getLogger("dailyai")
self.tracer = tracer or trace.get_tracer("orchestrator")
self.ctx: Context = context.get_current()
@@ -203,11 +203,12 @@ class Orchestrator(EventHandler):
self.logger.info("Orchestrator stopped.")
def on_intro_played(self, intro):
self.logger.info(f"Introduction has played")
self.can_interrupt = True
intro.finalize()
def on_intro_finished(self, intro):
pass
self.logger.info(f"Introduction has finished")
def on_response_played(self, response):
response.finalize()
@@ -366,6 +367,7 @@ class Orchestrator(EventHandler):
frame:OutputQueueFrame = self.output_queue.get()
if frame.frame_type == FrameType.END_STREAM:
self.logger.info("Stopping frame consumer thread")
return
# if interrupted, we just pull frames off the queue and discard them
if not self.is_interrupted.is_set():

View File

@@ -8,7 +8,7 @@ from PIL import Image
class AIService:
def __init__(self):
self.logger = logging.getLogger("bot-instance")
self.logger = logging.getLogger("dailyai")
def close(self):
pass