diff --git a/.changeset/brown-plants-search.md b/.changeset/brown-plants-search.md new file mode 100644 index 000000000..c39431c3c --- /dev/null +++ b/.changeset/brown-plants-search.md @@ -0,0 +1,5 @@ +--- +"livekit-agents": patch +--- + +fix uninitialized SpeechHandle error on interruption diff --git a/livekit-agents/livekit/agents/voice_assistant/voice_assistant.py b/livekit-agents/livekit/agents/voice_assistant/voice_assistant.py index 18d0b8cb2..f30c7cb9a 100644 --- a/livekit-agents/livekit/agents/voice_assistant/voice_assistant.py +++ b/livekit-agents/livekit/agents/voice_assistant/voice_assistant.py @@ -567,7 +567,7 @@ def _commit_user_question_if_needed() -> None: _commit_user_question_if_needed() collected_text = speech_handle.synthesis_handle.tts_forwarder.played_text - interrupted = speech_handle.synthesis_handle.interrupted + interrupted = speech_handle.interrupted is_using_tools = isinstance(speech_handle.source, LLMStream) and len( speech_handle.source.function_calls ) @@ -722,7 +722,7 @@ def _interrupt_if_possible(self) -> None: if ( self._playing_speech is None or not self._playing_speech.allow_interruptions - or self._playing_speech.synthesis_handle.interrupted + or self._playing_speech.interrupted ): return