Skip to content

fix(google): align realtime behavior for Gemini 3.1 and harden session/tool handling - #1189

Merged
toubatbrian merged 3 commits into
mainfrom
brian/gemini-fix
Apr 1, 2026
Merged

fix(google): align realtime behavior for Gemini 3.1 and harden session/tool handling#1189
toubatbrian merged 3 commits into
mainfrom
brian/gemini-fix

Conversation

@toubatbrian

Copy link
Copy Markdown
Contributor

What changed

  • Added gemini-3.1-flash-live-preview to supported LiveAPIModels.
  • Migrated outbound audio input in pushAudio() from mediaChunks to audio.
  • Kept realtime input handling backward compatible by accepting both mediaChunks and audio.
  • Added a gate in generateReply() for gemini-3.1-flash-live-preview:
    • log warning
    • throw explicit error (unsupported flow for this model)
  • Made tools connect config conditional so it is omitted when empty.
  • Kept session resumption explicitly enabled on first connect with {} and uses { handle } on resumed sessions.
  • Finalized generation after server tool calls by invoking markCurrentGenerationDone() to avoid stalled tool-call flows.

Changes verified.

@changeset-bot

changeset-bot Bot commented Mar 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d5dca80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@livekit/agents-plugin-google Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment thread plugins/google/src/beta/realtime/realtime_api.ts
Comment thread plugins/google/src/beta/realtime/realtime_api.ts

@tinalenguyen tinalenguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@toubatbrian
toubatbrian merged commit 8f23fad into main Apr 1, 2026
9 checks passed
@toubatbrian
toubatbrian deleted the brian/gemini-fix branch April 1, 2026 07:00
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
@adriablancafort

Copy link
Copy Markdown
Contributor

Nice

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants