Gemini 3.1 Flash Live API গাইড: রিয়েল-টাইম ভয়েস, ক্যামেরা ও স্ক্রিন-শেয়ার এজেন্ট
Gemini 3.1 Flash Live দিয়ে লো-লেটেন্সি মাল্টিমোডাল এজেন্ট — WebSocket, নেটিভ অডিও, ১ FPS ক্যামেরা/স্ক্রিন, ephemeral টোকেন।
আগস্ট ২০২৬-এ Gemini 3.1 Flash Live কেন গুরুত্বপূর্ণ
Google মার্চ ২০২৬-এ Gemini Live API-এর মাধ্যমে Gemini 3.1 Flash Live চালু করেছে — আগস্টে এটি প্রোডাকশন ভয়েস+ভিশন এজেন্টের জন্য সুপারিশকৃত মডেল। Live স্থায়ী WebSocket সেশন রাখে, আলাদা STT/TTS লাগে না।
আগস্ট ২০২৬: ২.৫ Flash Live deprecated; পরিপক্ব ইকোসিস্টেম; Live + Gemini 3.7 Flash (৩.৭ 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.