מדריך Gemini 3.1 Flash Live API: סוכני קול, מצלמה ושיתוף מסך בזמן אמת
סוכנים multimodal עם latency נמוך ב-Gemini 3.1 Flash Live — WebSocket, אודיו native, מצלמה/מסך 1 FPS, tokens זמניים.
למה Gemini 3.1 Flash Live חשוב באוגוסט 2026
Google השיקה את Gemini 3.1 Flash Live דרך Gemini Live API במרץ 2026 — באוגוסט זה המודל המומלץ לסוכני קול+ראייה בפרודקשן. Live שומר session WebSocket קבוע ללא STT/TTS נפרד.
אוגוסט 2026: 2.5 Flash Live deprecated; ecosystem בוגר; Live + Gemini 3.7 Flash (הכרזת 3.7 Flash).
Architecture: WebSocket sessions
Live API is stateful — persistent WSS bidirectional streams for audio, JPEG/PNG video (≤1 FPS), and text. First message: BidiGenerateContentSetup; then BidiGenerateContentRealtimeInput.
| Layer | Role |
|---|---|
| Transport | Stateful WSS |
| Input | PCM16 @ 16 kHz, video ≤1 FPS |
| Output | PCM @ 24 kHz, transcripts, tools |
Server-to-server (proxy) or client-to-server (ephemeral tokens required).
Native audio pipeline
Input PCM16 16 kHz; output 24 kHz. Browser float32 → PCM16. VAD for turns; manual activityStart/activityEnd for push-to-talk.
Camera and screen share
1 FPS JPEG/PNG — camera Q&A, screen code review. Default TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO — send frames only during speech to reduce cost. Limits: 15 min audio-only, 2 min audio+video.
Tools, thinkingLevel, security
Sync tool calling + Search grounding. thinkingLevel: minimal–high. 90+ languages. Ephemeral tokens — never embed API keys in clients.
Migration from 2.5
Use gemini-3.1-flash-live-preview; thinkingBudget → thinkingLevel; send_realtime_input for text; multi-part events; no NON_BLOCKING tools.
3.1 Live vs 3.7 REST
Live: WebSocket, sub-second voice, 128K context. 3.7: HTTP, coding/RAG, 2.5M tokens.