Save progress

This commit is contained in:
James Hush
2025-01-02 08:35:05 +08:00
parent ed7b512f40
commit a11fa05370
3 changed files with 49 additions and 43 deletions

View File

@@ -13,6 +13,7 @@ from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.services.cartesia import CartesiaTTSService from pipecat.services.cartesia import CartesiaTTSService
from pipecat.services.deepgram import DeepgramTTSService
from pipecat.services.openai import OpenAILLMService from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport from pipecat.transports.services.daily import DailyParams, DailyTransport
from pipecat.transports.services.helpers.daily_rest import DailyRESTHelper from pipecat.transports.services.helpers.daily_rest import DailyRESTHelper
@@ -55,6 +56,11 @@ class DialoutBot:
voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22", # British Lady 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") llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o")
messages = [ messages = [
@@ -81,8 +87,8 @@ class DialoutBot:
task = PipelineTask(pipeline, PipelineParams(allow_interruptions=True)) task = PipelineTask(pipeline, PipelineParams(allow_interruptions=True))
def get_phone_number(callId: int, run_number: int) -> str: def get_phone_number(callId: int, run_number: int) -> str:
if self.phone_number: # if self.phone_number:
return self.phone_number # return self.phone_number
if run_number % 2 == 0: if run_number % 2 == 0:
phone_numbers = [ phone_numbers = [

View File

@@ -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 # 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( room_params = DailyRoomParams(
properties=DailyRoomProperties( properties=DailyRoomProperties(
exp=exp, exp=exp,

View File

@@ -1,41 +1,41 @@
bot_id,enable_dialout,timestamp bot_id,enable_dialout,timestamp
0,True,2024-12-20 15:16:38.801 0,True,2024-12-20 17:18:47.197
2,True,2024-12-20 15:16:38.804 1,True,2024-12-20 17:18:47.247
3,True,2024-12-20 15:16:38.835 0,True,2024-12-20 17:20:03.366
1,True,2024-12-20 15:16:38.940 1,True,2024-12-20 17:20:03.392
0,True,2024-12-20 15:17:55.016 1,True,2024-12-20 17:21:19.477
2,True,2024-12-20 15:17:55.038 0,True,2024-12-20 17:21:19.514
1,True,2024-12-20 15:17:55.102 0,True,2024-12-20 17:22:35.613
3,True,2024-12-20 15:17:55.174 1,True,2024-12-20 17:22:35.637
0,True,2024-12-20 15:19:11.256 3,True,2024-12-20 17:10:15.329
2,True,2024-12-20 15:19:11.294 2,True,2024-12-20 17:10:15.356
3,True,2024-12-20 15:19:11.320 1,True,2024-12-20 17:10:15.359
1,True,2024-12-20 15:19:11.336 0,True,2024-12-20 17:10:15.389
0,True,2024-12-20 15:20:27.439 3,True,2024-12-20 17:11:31.428
1,True,2024-12-20 15:20:27.461 0,True,2024-12-20 17:11:31.469
3,True,2024-12-20 15:20:27.465 2,True,2024-12-20 17:11:31.511
2,True,2024-12-20 15:20:27.472 1,True,2024-12-20 17:11:31.670
3,True,2024-12-20 15:21:43.567 0,True,2024-12-20 17:12:47.680
0,True,2024-12-20 15:21:43.592 3,True,2024-12-20 17:12:47.753
1,True,2024-12-20 15:21:43.606 1,True,2024-12-20 17:12:47.770
2,True,2024-12-20 15:21:43.750 2,True,2024-12-20 17:12:47.779
3,True,2024-12-20 15:22:59.818 3,True,2024-12-20 17:14:03.844
2,True,2024-12-20 15:22:59.825 1,True,2024-12-20 17:14:03.847
0,True,2024-12-20 15:22:59.844 2,True,2024-12-20 17:14:03.883
1,True,2024-12-20 15:22:59.853 0,True,2024-12-20 17:14:03.977
2,True,2024-12-20 15:24:15.971 3,True,2024-12-20 17:15:20.026
3,True,2024-12-20 15:24:15.976 0,True,2024-12-20 17:15:20.069
0,True,2024-12-20 15:24:16.035 1,True,2024-12-20 17:15:20.071
1,True,2024-12-20 15:24:16.099 2,True,2024-12-20 17:15:20.127
2,True,2024-12-20 15:25:32.202 0,True,2024-12-20 17:16:36.155
0,True,2024-12-20 15:25:32.223 1,True,2024-12-20 17:16:36.166
3,True,2024-12-20 15:25:32.276 3,True,2024-12-20 17:16:36.217
1,True,2024-12-20 15:25:32.334 2,True,2024-12-20 17:16:36.248
3,True,2024-12-20 15:26:48.410 3,True,2024-12-20 17:17:52.320
0,True,2024-12-20 15:26:48.449 2,True,2024-12-20 17:17:52.357
1,True,2024-12-20 15:26:48.504 0,True,2024-12-20 17:17:52.401
2,True,2024-12-20 15:26:48.540 1,True,2024-12-20 17:17:52.477
3,True,2024-12-20 15:28:04.604 1,True,2024-12-20 17:19:08.543
0,True,2024-12-20 15:28:04.604 3,True,2024-12-20 17:19:08.553
2,True,2024-12-20 15:28:04.614 2,True,2024-12-20 17:19:08.578
1,True,2024-12-20 15:28:04.648 0,True,2024-12-20 17:19:08.656
1 bot_id enable_dialout timestamp
2 0 True 2024-12-20 15:16:38.801 2024-12-20 17:18:47.197
3 2 1 True 2024-12-20 15:16:38.804 2024-12-20 17:18:47.247
4 3 0 True 2024-12-20 15:16:38.835 2024-12-20 17:20:03.366
5 1 True 2024-12-20 15:16:38.940 2024-12-20 17:20:03.392
6 0 1 True 2024-12-20 15:17:55.016 2024-12-20 17:21:19.477
7 2 0 True 2024-12-20 15:17:55.038 2024-12-20 17:21:19.514
8 1 0 True 2024-12-20 15:17:55.102 2024-12-20 17:22:35.613
9 3 1 True 2024-12-20 15:17:55.174 2024-12-20 17:22:35.637
10 0 3 True 2024-12-20 15:19:11.256 2024-12-20 17:10:15.329
11 2 True 2024-12-20 15:19:11.294 2024-12-20 17:10:15.356
12 3 1 True 2024-12-20 15:19:11.320 2024-12-20 17:10:15.359
13 1 0 True 2024-12-20 15:19:11.336 2024-12-20 17:10:15.389
14 0 3 True 2024-12-20 15:20:27.439 2024-12-20 17:11:31.428
15 1 0 True 2024-12-20 15:20:27.461 2024-12-20 17:11:31.469
16 3 2 True 2024-12-20 15:20:27.465 2024-12-20 17:11:31.511
17 2 1 True 2024-12-20 15:20:27.472 2024-12-20 17:11:31.670
18 3 0 True 2024-12-20 15:21:43.567 2024-12-20 17:12:47.680
19 0 3 True 2024-12-20 15:21:43.592 2024-12-20 17:12:47.753
20 1 True 2024-12-20 15:21:43.606 2024-12-20 17:12:47.770
21 2 True 2024-12-20 15:21:43.750 2024-12-20 17:12:47.779
22 3 True 2024-12-20 15:22:59.818 2024-12-20 17:14:03.844
23 2 1 True 2024-12-20 15:22:59.825 2024-12-20 17:14:03.847
24 0 2 True 2024-12-20 15:22:59.844 2024-12-20 17:14:03.883
25 1 0 True 2024-12-20 15:22:59.853 2024-12-20 17:14:03.977
26 2 3 True 2024-12-20 15:24:15.971 2024-12-20 17:15:20.026
27 3 0 True 2024-12-20 15:24:15.976 2024-12-20 17:15:20.069
28 0 1 True 2024-12-20 15:24:16.035 2024-12-20 17:15:20.071
29 1 2 True 2024-12-20 15:24:16.099 2024-12-20 17:15:20.127
30 2 0 True 2024-12-20 15:25:32.202 2024-12-20 17:16:36.155
31 0 1 True 2024-12-20 15:25:32.223 2024-12-20 17:16:36.166
32 3 True 2024-12-20 15:25:32.276 2024-12-20 17:16:36.217
33 1 2 True 2024-12-20 15:25:32.334 2024-12-20 17:16:36.248
34 3 True 2024-12-20 15:26:48.410 2024-12-20 17:17:52.320
35 0 2 True 2024-12-20 15:26:48.449 2024-12-20 17:17:52.357
36 1 0 True 2024-12-20 15:26:48.504 2024-12-20 17:17:52.401
37 2 1 True 2024-12-20 15:26:48.540 2024-12-20 17:17:52.477
38 3 1 True 2024-12-20 15:28:04.604 2024-12-20 17:19:08.543
39 0 3 True 2024-12-20 15:28:04.604 2024-12-20 17:19:08.553
40 2 True 2024-12-20 15:28:04.614 2024-12-20 17:19:08.578
41 1 0 True 2024-12-20 15:28:04.648 2024-12-20 17:19:08.656