diff --git a/livekit-agents/livekit/agents/multimodal/agent_playout.py b/livekit-agents/livekit/agents/multimodal/agent_playout.py index a01d5b0ea..4ce66cae1 100644 --- a/livekit-agents/livekit/agents/multimodal/agent_playout.py +++ b/livekit-agents/livekit/agents/multimodal/agent_playout.py @@ -74,8 +74,8 @@ def __init__( self, *, audio_source: rtc.AudioSource, - stt: stt.STT, - stt_forwarder: stt.STTForwarder, + stt: stt.STT | None, + stt_forwarder: transcription.STTSegmentsForwarder | None, ) -> None: super().__init__() self._source = audio_source @@ -180,7 +180,7 @@ async def _stt_stream_co() -> None: done, _ = await asyncio.wait( [asyncio.gather(*tasks), handle._int_fut], return_when=asyncio.FIRST_COMPLETED, - ) + ) # type: ignore handle._total_played_time = ( handle._pushed_duration - self._source.queued_duration diff --git a/livekit-agents/livekit/agents/multimodal/multimodal_agent.py b/livekit-agents/livekit/agents/multimodal/multimodal_agent.py index afc65cdee..2d24cfd85 100644 --- a/livekit-agents/livekit/agents/multimodal/multimodal_agent.py +++ b/livekit-agents/livekit/agents/multimodal/multimodal_agent.py @@ -179,7 +179,7 @@ def __init__( transcription=transcription, ) - if stt is not None and not stt.capabilities.streaming: + if stt and vad and not stt.capabilities.streaming: from .. import stt as speech_to_text stt = speech_to_text.StreamAdapter( @@ -488,7 +488,7 @@ def _subscribe_to_microphone(self, *args, **kwargs) -> None: self._subscribed_track = publication.track # type: ignore stream_24khz = rtc.AudioStream( self._subscribed_track, sample_rate=24000, num_channels=1 - ) + ) # type: ignore self._stt_forwarder = STTSegmentsForwarder( room=self._room, participant=self._linked_participant, diff --git a/livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime/stt.py b/livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime/stt.py index 9153039a7..4b791f408 100644 --- a/livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime/stt.py +++ b/livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime/stt.py @@ -26,8 +26,8 @@ utils, ) -from google import genai -from google.genai import types +from google import genai # type: ignore +from google.genai import types # type: ignore from .api_proto import LiveAPIModels