diff --git a/changelog/3605.fixed.md b/changelog/3605.fixed.md new file mode 100644 index 000000000..405dc4db2 --- /dev/null +++ b/changelog/3605.fixed.md @@ -0,0 +1 @@ +- Fixed `GeminiLiveLLMService` transcription timeout handler not being scheduled by yielding to the event loop after task creation. diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index 895489955..e209f3d0a 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -1689,6 +1689,8 @@ class GeminiLiveLLMService(LLMService): self._transcription_timeout_task = self.create_task( self._transcription_timeout_handler() ) + # Let the event loop schedule the taks before it gets cancelled. + await asyncio.sleep(0) async def _handle_msg_output_transcription(self, message: LiveServerMessage): """Handle the output transcription message."""