Merge pull request #3429 from lukepayyapilli/fix/gemini-live-interrupted-signal

feat: handle server_content.interrupted for faster interruptions
This commit is contained in:
kompfner
2026-01-28 10:25:36 -05:00
committed by GitHub
2 changed files with 15 additions and 1 deletions

1
changelog/3429.added.md Normal file
View File

@@ -0,0 +1 @@
- Added handling for `server_content.interrupted` signal in the Gemini Live service for faster interruption response in the case where there isn't already turn tracking in the pipeline, e.g. local VAD + context aggregators. When there is already turn tracking in the pipeline, the additional interruption does no harm.

View File

@@ -1198,7 +1198,20 @@ class GeminiLiveLLMService(LLMService):
# Reset failure counter if connection has been stable
self._check_and_reset_failure_counter()
if message.server_content and message.server_content.model_turn:
if message.server_content and message.server_content.interrupted:
# NOTE: while the service triggers interruptions in
# the specific case of barge-ins, it does *not*
# emit UserStarted/StoppedSpeakingFrames, as the
# Gemini Live API does not give us broadly reliable
# signals to base those off of. Pipelines that
# require turn tracking (like those using context
# aggregators) still need an independent way to
# track turns, such as local Silero VAD in
# combination with the context aggregator default
# turn strategies.
logger.debug("Gemini VAD: interrupted signal received")
await self.push_interruption_task_frame_and_wait()
elif message.server_content and message.server_content.model_turn:
await self._handle_msg_model_turn(message)
elif (
message.server_content