From a107b1cb4b40c0d2ed6d5c0d35a8eae1ac6e139c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 14 Feb 2025 15:57:18 -0800 Subject: [PATCH] examples(06a): use CartesiaTTSService --- examples/foundational/06a-image-sync.py | 4 ++-- src/pipecat/processors/aggregators/llm_response.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index 841c335f6..03a7fd3b8 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -27,7 +27,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.processors.frame_processor import FrameDirection, FrameProcessor -from pipecat.services.cartesia import CartesiaHttpTTSService +from pipecat.services.cartesia import CartesiaTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -91,7 +91,7 @@ async def main(): ), ) - tts = CartesiaHttpTTSService( + tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22", # British Lady ) diff --git a/src/pipecat/processors/aggregators/llm_response.py b/src/pipecat/processors/aggregators/llm_response.py index ca73649b2..2de3ebae4 100644 --- a/src/pipecat/processors/aggregators/llm_response.py +++ b/src/pipecat/processors/aggregators/llm_response.py @@ -10,7 +10,6 @@ from abc import abstractmethod from typing import List from pipecat.frames.frames import ( - BotInterruptionFrame, CancelFrame, EmulateUserStartedSpeakingFrame, EmulateUserStoppedSpeakingFrame, @@ -281,6 +280,7 @@ class LLMUserContextAggregator(LLMContextResponseAggregator): await self._cancel_aggregation_task() async def _handle_user_started_speaking(self, _: UserStartedSpeakingFrame): + self._last_user_speaking_time = time.time() self._user_speaking = True async def _handle_user_stopped_speaking(self, _: UserStoppedSpeakingFrame):