From a11fa05370a9596073651d8054718b5e47d1ae44 Mon Sep 17 00:00:00 2001 From: James Hush Date: Thu, 2 Jan 2025 08:35:05 +0800 Subject: [PATCH] Save progress --- .../batch_dialout_bot.py | 10 ++- .../batch_dialout_demo.py | 2 +- examples/batch-dialout-chatbot/output.csv | 80 +++++++++---------- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/examples/batch-dialout-chatbot/batch_dialout_bot.py b/examples/batch-dialout-chatbot/batch_dialout_bot.py index b78c86e51..e8cc31aca 100644 --- a/examples/batch-dialout-chatbot/batch_dialout_bot.py +++ b/examples/batch-dialout-chatbot/batch_dialout_bot.py @@ -13,6 +13,7 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.services.cartesia import CartesiaTTSService +from pipecat.services.deepgram import DeepgramTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport from pipecat.transports.services.helpers.daily_rest import DailyRESTHelper @@ -54,6 +55,11 @@ class DialoutBot: api_key=os.getenv("CARTESIA_API_KEY"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22", # British Lady ) + + tts = DeepgramTTSService( + api_key=os.getenv("DEEPGRAM_API_KEY"), + voice="aura-helios-en", + ) llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") @@ -81,8 +87,8 @@ class DialoutBot: task = PipelineTask(pipeline, PipelineParams(allow_interruptions=True)) def get_phone_number(callId: int, run_number: int) -> str: - if self.phone_number: - return self.phone_number + # if self.phone_number: + # return self.phone_number if run_number % 2 == 0: phone_numbers = [ diff --git a/examples/batch-dialout-chatbot/batch_dialout_demo.py b/examples/batch-dialout-chatbot/batch_dialout_demo.py index 096e2a3a4..eb6113ab7 100644 --- a/examples/batch-dialout-chatbot/batch_dialout_demo.py +++ b/examples/batch-dialout-chatbot/batch_dialout_demo.py @@ -25,7 +25,7 @@ async def run_bot(id: int, run_number: int, bot_run_time: int, phone_number: str ) # Create daily.co room with dialin and dialout enabled - exp = time.time() + bot_run_time + 600 + exp = time.time() + bot_run_time + 600 + 60 room_params = DailyRoomParams( properties=DailyRoomProperties( exp=exp, diff --git a/examples/batch-dialout-chatbot/output.csv b/examples/batch-dialout-chatbot/output.csv index d3f18ffe9..5e622e28b 100644 --- a/examples/batch-dialout-chatbot/output.csv +++ b/examples/batch-dialout-chatbot/output.csv @@ -1,41 +1,41 @@ bot_id,enable_dialout,timestamp -0,True,2024-12-20 15:16:38.801 -2,True,2024-12-20 15:16:38.804 -3,True,2024-12-20 15:16:38.835 -1,True,2024-12-20 15:16:38.940 -0,True,2024-12-20 15:17:55.016 -2,True,2024-12-20 15:17:55.038 -1,True,2024-12-20 15:17:55.102 -3,True,2024-12-20 15:17:55.174 -0,True,2024-12-20 15:19:11.256 -2,True,2024-12-20 15:19:11.294 -3,True,2024-12-20 15:19:11.320 -1,True,2024-12-20 15:19:11.336 -0,True,2024-12-20 15:20:27.439 -1,True,2024-12-20 15:20:27.461 -3,True,2024-12-20 15:20:27.465 -2,True,2024-12-20 15:20:27.472 -3,True,2024-12-20 15:21:43.567 -0,True,2024-12-20 15:21:43.592 -1,True,2024-12-20 15:21:43.606 -2,True,2024-12-20 15:21:43.750 -3,True,2024-12-20 15:22:59.818 -2,True,2024-12-20 15:22:59.825 -0,True,2024-12-20 15:22:59.844 -1,True,2024-12-20 15:22:59.853 -2,True,2024-12-20 15:24:15.971 -3,True,2024-12-20 15:24:15.976 -0,True,2024-12-20 15:24:16.035 -1,True,2024-12-20 15:24:16.099 -2,True,2024-12-20 15:25:32.202 -0,True,2024-12-20 15:25:32.223 -3,True,2024-12-20 15:25:32.276 -1,True,2024-12-20 15:25:32.334 -3,True,2024-12-20 15:26:48.410 -0,True,2024-12-20 15:26:48.449 -1,True,2024-12-20 15:26:48.504 -2,True,2024-12-20 15:26:48.540 -3,True,2024-12-20 15:28:04.604 -0,True,2024-12-20 15:28:04.604 -2,True,2024-12-20 15:28:04.614 -1,True,2024-12-20 15:28:04.648 +0,True,2024-12-20 17:18:47.197 +1,True,2024-12-20 17:18:47.247 +0,True,2024-12-20 17:20:03.366 +1,True,2024-12-20 17:20:03.392 +1,True,2024-12-20 17:21:19.477 +0,True,2024-12-20 17:21:19.514 +0,True,2024-12-20 17:22:35.613 +1,True,2024-12-20 17:22:35.637 +3,True,2024-12-20 17:10:15.329 +2,True,2024-12-20 17:10:15.356 +1,True,2024-12-20 17:10:15.359 +0,True,2024-12-20 17:10:15.389 +3,True,2024-12-20 17:11:31.428 +0,True,2024-12-20 17:11:31.469 +2,True,2024-12-20 17:11:31.511 +1,True,2024-12-20 17:11:31.670 +0,True,2024-12-20 17:12:47.680 +3,True,2024-12-20 17:12:47.753 +1,True,2024-12-20 17:12:47.770 +2,True,2024-12-20 17:12:47.779 +3,True,2024-12-20 17:14:03.844 +1,True,2024-12-20 17:14:03.847 +2,True,2024-12-20 17:14:03.883 +0,True,2024-12-20 17:14:03.977 +3,True,2024-12-20 17:15:20.026 +0,True,2024-12-20 17:15:20.069 +1,True,2024-12-20 17:15:20.071 +2,True,2024-12-20 17:15:20.127 +0,True,2024-12-20 17:16:36.155 +1,True,2024-12-20 17:16:36.166 +3,True,2024-12-20 17:16:36.217 +2,True,2024-12-20 17:16:36.248 +3,True,2024-12-20 17:17:52.320 +2,True,2024-12-20 17:17:52.357 +0,True,2024-12-20 17:17:52.401 +1,True,2024-12-20 17:17:52.477 +1,True,2024-12-20 17:19:08.543 +3,True,2024-12-20 17:19:08.553 +2,True,2024-12-20 17:19:08.578 +0,True,2024-12-20 17:19:08.656