Merge pull request #3429 from lukepayyapilli/fix/gemini-live-interrupted-signal
feat: handle server_content.interrupted for faster interruptions
This commit is contained in:
1
changelog/3429.added.md
Normal file
1
changelog/3429.added.md
Normal 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.
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user