You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Standard Gemini Live WebSocket (/ws/...BidiGenerateContent), ContextUpdate, and waitingForInput #358
Add compatibility for official Gemini Live SDK clients (@google/genai, google-genai, LiveKit, Pipecat) plus missing Live session frames observed in current AI Studio web traffic:
Standard Gemini Live WebSocket path (BidiGenerateContentClientMessage JSON)
Official SDKs connect to /ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent (currently handled only on /v1/live with custom payload or rejected on /v1beta/models/*:bidiGenerateContent with 400).
Supporting standard setup, clientContent, realtimeInput, and toolResponse JSON messages on the WebSocket endpoint allows unmodified official Gemini Live clients to connect directly.
Mid-session ContextUpdate (WebChannel outer field 9)
AI Studio now supports updating systemInstruction and tools mid-session without tearing down the WebSocket:
Outer message field 9: [tools, null, systemInstruction] (where systemInstruction is [[[null, text]]] and tools uses the standard EncodeTools array).
WAA proof binding string concatenates systemInstruction text and tool names/descriptions separated by spaces.
Also note EncodeBuildBidiSetup in internal/aistudio/build_bidi.go currently passes bidiVariantConversation unconditionally; routing by model/mode would keep Build/Applet Live aligned with EncodeBidiSetup.
Background thinking waitingForInput (serverContent field 8)
When thinkingLevel (LOW / MEDIUM / HIGH) is active in Live sessions, serverContent[8] (waitingForInput boolean) indicates the model is waiting for user input vs. finishing background reasoning. Exposing this flag in live server events helps clients manage turn state and barge-in.
Activity