Gemini 3.1 Flash Live API گائیڈ: ریئل ٹائم وائس، کیمرہ اور اسکرین شیئر ایجنٹ
Gemini 3.1 Flash Live کے ساتھ کم تاخیر والے ملٹی موڈل ایجنٹ — WebSocket، نیٹیو آڈیو، 1 FPS کیمرہ/اسکرین، عارضی ٹوکن۔
اگست 2026 میں Gemini 3.1 Flash Live کیوں اہم ہے
Google نے مارچ 2026 میں Gemini Live API کے ذریعے Gemini 3.1 Flash Live لانچ کیا — اگست تک یہ پروڈکشن voice+vision agents کے لیے تجویز کردہ ماڈل ہے۔ Live مستقل WebSocket session برقرار رکھتا ہے، الگ STT/TTS نہیں چاہیے۔
اگست 2026: 2.5 Flash Live deprecated؛ mature 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.