From 3d702a5c39b929a0e15325ea0bb871eb677f9b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 9 May 2025 09:16:10 -0700 Subject: [PATCH] minor examples cleanup --- examples/news-chatbot/server/news_bot.py | 1 - examples/simple-chatbot/server/bot-gemini.py | 2 +- examples/simple-chatbot/server/bot-openai.py | 1 + .../word-wrangler-gemini-live/server/bot_phone_local.py | 6 ++---- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/news-chatbot/server/news_bot.py b/examples/news-chatbot/server/news_bot.py index db2cb0835..c78752dfb 100644 --- a/examples/news-chatbot/server/news_bot.py +++ b/examples/news-chatbot/server/news_bot.py @@ -153,7 +153,6 @@ async def main(): @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): logger.debug("First participant joined: {}", participant["id"]) - await transport.capture_participant_transcription(participant["id"]) @transport.event_handler("on_participant_left") async def on_participant_left(transport, participant, reason): diff --git a/examples/simple-chatbot/server/bot-gemini.py b/examples/simple-chatbot/server/bot-gemini.py index 70dfccf2d..a38dc11d3 100644 --- a/examples/simple-chatbot/server/bot-gemini.py +++ b/examples/simple-chatbot/server/bot-gemini.py @@ -187,7 +187,7 @@ async def main(): @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): - await transport.capture_participant_transcription(participant["id"]) + print(f"Participant joined: {participant}") @transport.event_handler("on_participant_left") async def on_participant_left(transport, participant, reason): diff --git a/examples/simple-chatbot/server/bot-openai.py b/examples/simple-chatbot/server/bot-openai.py index 07c56aa28..63226396e 100644 --- a/examples/simple-chatbot/server/bot-openai.py +++ b/examples/simple-chatbot/server/bot-openai.py @@ -215,6 +215,7 @@ async def main(): @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): + print(f"Participant joined: {participant}") await transport.capture_participant_transcription(participant["id"]) @transport.event_handler("on_participant_left") diff --git a/examples/word-wrangler-gemini-live/server/bot_phone_local.py b/examples/word-wrangler-gemini-live/server/bot_phone_local.py index 7c86a6895..69a23623c 100644 --- a/examples/word-wrangler-gemini-live/server/bot_phone_local.py +++ b/examples/word-wrangler-gemini-live/server/bot_phone_local.py @@ -30,7 +30,7 @@ from loguru import logger from pipecatcloud.agent import DailySessionArguments from word_list import generate_game_words -from pipecat.audio.resamplers.soxr_resampler import SOXRAudioResampler +from pipecat.audio.utils import create_default_resampler from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.frames.frames import ( BotStoppedSpeakingFrame, @@ -524,7 +524,7 @@ async def tts_audio_raw_frame_filter(frame: Frame): # Create a resampler instance once -resampler = SOXRAudioResampler() +resampler = create_default_resampler() async def tts_to_input_audio_transformer(frame: Frame): @@ -689,8 +689,6 @@ Important guidelines: @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): logger.info("First participant joined: {}", participant["id"]) - # Capture the participant's transcription - await transport.capture_participant_transcription(participant["id"]) # Kick off the conversation await task.queue_frames([context_aggregator.user().get_context_frame()]) # Start the game timer