async def _listen_for_host_stopped(self):
        """Listen for host stopped speaking and reconnect if a reset is pending."""
        while True:
            # Wait for host stopped speaking notification
            await self._host_stopped_speaking_notifier.wait()

            # If we have a pending reset, reconnect now
            if self._pending_reset:
                logger.info(f"{self}: Host finished speaking, completing the LLM reset")

                # Reconnect
                await self._connect()

                # Reset the flag
                self._pending_reset = False

                logger.info(f"{self}: LLM reset complete")
Listen for host stopped speaking and reconnect if a reset is pending.
examples/word-wrangler-gemini-live/server/bot_phone_twilio.py