From aab06f444117bd7a268c0d996a85d19b318a87a9 Mon Sep 17 00:00:00 2001 From: Moishe Lettvin Date: Tue, 2 Jan 2024 10:46:48 -0500 Subject: [PATCH] a few tweaks to the prompt --- src/dailyai/orchestrator.py | 3 +++ src/samples/simple-sample/simple-sample.py | 11 +++-------- src/samples/static-sprite/sprite-sample.py | 5 +++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/dailyai/orchestrator.py b/src/dailyai/orchestrator.py index 861e9569b..19b885d1c 100644 --- a/src/dailyai/orchestrator.py +++ b/src/dailyai/orchestrator.py @@ -209,6 +209,9 @@ class Orchestrator(EventHandler): def on_intro_finished(self, intro): self.logger.info(f"Introduction has finished") + waiting = self.conversation_processors.waiting(self.services, self.message_handler, self.output_queue) + waiting.prepare() + waiting.play() def on_response_played(self, response): response.finalize() diff --git a/src/samples/simple-sample/simple-sample.py b/src/samples/simple-sample/simple-sample.py index c6310c3f1..324c21603 100644 --- a/src/samples/simple-sample/simple-sample.py +++ b/src/samples/simple-sample/simple-sample.py @@ -19,10 +19,11 @@ def add_bot_to_room(room_url, token, expiration) -> None: # A simple prompt for a simple sample. message_handler = MessageHandler( """ - You are a sample bot, meant to demonstrate how to use an LLM with transcription at TTS. + You are a sample bot in a WebRTC session. You'll receive input as transcriptions of user's + speech, and your responses will be converted to audio via a TTS service. Answer user's questions and be friendly, and if you can, give some ideas about how someone could use a bot like you in a more in-depth way. Because your responses will be spoken, - try to keep them short and sweet. + try to keep them short. """ ) @@ -33,12 +34,6 @@ def add_bot_to_room(room_url, token, expiration) -> None: # - AZURE_CHATGPT_KEY # - AZURE_CHATGPT_ENDPOINT # - AZURE_CHATGPT_DEPLOYMENT_ID - # - # This demo doesn't use image generation, but if you extend it to do so, - # you'll also need to set: - # - AZURE_DALLE_KEY - # - AZURE_DALLE_ENDPOINT - # - AZURE_DALLE_DEPLOYMENT_ID services = AIServiceConfig( tts=AzureTTSService(), image=None, llm=AzureLLMService() diff --git a/src/samples/static-sprite/sprite-sample.py b/src/samples/static-sprite/sprite-sample.py index f361ce931..b5ec4f5f0 100644 --- a/src/samples/static-sprite/sprite-sample.py +++ b/src/samples/static-sprite/sprite-sample.py @@ -83,10 +83,11 @@ def add_bot_to_room(room_url, token, expiration) -> None: # A simple prompt for a simple sample. message_handler = MessageHandler( """ - You are a sample bot, meant to demonstrate how to use an LLM with transcription at TTS. + You are a sample bot in a WebRTC session. You'll receive input as transcriptions of user's + speech, and your responses will be converted to audio via a TTS service. Answer user's questions and be friendly, and if you can, give some ideas about how someone could use a bot like you in a more in-depth way. Because your responses will be spoken, - try to keep them short and sweet. + try to keep them short. """ )