Skip to content

Add audioStreamEnd support for realtimeInput in GeminiLlmConnection - #6442

Closed
Yashas1600 wants to merge 1 commit into
google:mainfrom
Yashas1600:fix/issue-2887-2395
Closed

Add audioStreamEnd support for realtimeInput in GeminiLlmConnection#6442
Yashas1600 wants to merge 1 commit into
google:mainfrom
Yashas1600:fix/issue-2887-2395

Conversation

@Yashas1600

Copy link
Copy Markdown

The Gemini Live API's realtimeInput message supports an audioStreamEnd field
that signals the microphone has been turned off, allowing the model to force-flush
any buffered audio when VAD (voice activity detection) is enabled. Previously,
GeminiLlmConnection.send_realtime() handled ActivityStart and ActivityEnd
but had no path for audioStreamEnd.

This change adds audio_stream_end: Optional[bool] to LiveRequest, a
send_audio_stream_end() convenience method to LiveRequestQueue, and extends
GeminiLlmConnection.send_realtime() to forward a True value as
send_realtime_input(audio_stream_end=True). The base_llm_flow dispatch loop
is updated to route live_request.audio_stream_end through the new code path.

Fixes#2887.

The Gemini Live API's `realtimeInput` message supports an `audioStreamEnd` field
Signed-off-by: Yashas Shashidhara <yashas22@g.ucla.edu>
@adk-botadk-bot added the live [Component] This issue is related to live, voice and video chat label Jul 22, 2026
@wuliang229

Copy link
Copy Markdown
Collaborator

We'll go with pr #4490. Thanks for the contribution.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live[Component] This issue is related to live, voice and video chat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support gemini audioStreamEnd for realtimeInput

3 participants

@Yashas1600@wuliang229@adk-bot