[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BVCFQ71ETA0C409BWMMEG8":3,"skill-same:01M7BVCFQ71ETA0C409BWMMEG8":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BVCFQ71ETA0C409BWMMEG8","gemini-live-api-dev",null,"Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio\u002Fvideo\u002Ftext streaming, voice activity detection (VAD), native audio features, function calling, session management, ephemeral tokens for client-side auth, live translation, and all Live API configuration options. SDKs covered - google-genai (Python), @google\u002Fgenai (JavaScript\u002FTypeScript).","nguyenhungtran18\u002Fskill-and-tool-tracker","nguyenhungtran18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F297063550?v=4","01M7BV0BFPRRFP84F2ME0FYZ9D","01M7BV0BG83FA5P22NJV0GR0A5",1,"MIT","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fgemini-live-api-dev\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: gemini-live-api-dev\ndescription: Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio\u002Fvideo\u002Ftext streaming, voice activity detection (VAD), native audio features, function calling, session management, ephemeral tokens for client-side auth, live translation, and all Live API configuration options. SDKs covered - google-genai (Python), @google\u002Fgenai (JavaScript\u002FTypeScript).\n---\n\n# Gemini Live API Development Skill\n\n## Overview\n\nThe Live API enables **low-latency, real-time voice and video interactions** with Gemini over WebSockets. It processes continuous streams of audio, video, or text to deliver immediate, human-like spoken responses.\n\nKey capabilities:\n- **Bidirectional audio streaming** — real-time mic-to-speaker conversations\n- **Video streaming** — send camera\u002Fscreen frames alongside audio\n- **Text input\u002Foutput** — send and receive text within a live session\n- **Audio transcriptions** — get text transcripts of both input and output audio\n- **Voice Activity Detection (VAD)** — automatic interruption handling\n- **Native audio** — thinking (with configurable `thinkingLevel`)\n- **Function calling** — synchronous tool use\n- **Google Search grounding** — ground responses in real-time search results\n- **Session management** — context compression, session resumption, GoAway signals\n- **Ephemeral tokens** — secure client-side authentication\n\n> [!NOTE]\n> The Live API currently **only supports WebSockets**. For WebRTC support or simplified integration, use a [partner integration](#partner-integrations).\n\n## Models\n\n- `gemini-3.1-flash-live-preview` — Optimized for low-latency, real-time dialogue. Native audio output, thinking (via `thinkingLevel`). 128k context window. **This is the recommended model for all Live API use cases.**\n- `gemini-3.5-live-translate-preview` — Real-time streaming translation model.\n\n> [!WARNING]\n> The following Live API models are **deprecated** and will be shut down. Migrate to `gemini-3.1-flash-live-preview`.\n> - `gemini-2.5-flash-native-audio-preview-12-2025` — Migrate to `gemini-3.1-flash-live-preview`.\n> - `gemini-live-2.5-flash-preview` — Released June 17, 2025. Shutdown: December 9, 2025.\n> - `gemini-2.0-flash-live-001` — Released April 9, 2025. Shutdown: December 9, 2025.\n\n## SDKs\n\n- **Python**: `google-genai` — `pip install google-genai`\n- **JavaScript\u002FTypeScript**: `@google\u002Fgenai` — `npm install @google\u002Fgenai`\n\n> [!WARNING]\n> Legacy SDKs `google-generativeai` (Python) and `@google\u002Fgenerative-ai` (JS) are deprecated. Use the new SDKs above.\n\n## Partner Integrations\n\nTo streamline real-time audio\u002Fvideo app development, use a third-party integration supporting the Gemini Live API over **WebRTC** or **WebSockets**:\n\n- [LiveKit](https:\u002F\u002Fdocs.livekit.io\u002Fagents\u002Fmodels\u002Frealtime\u002Fplugins\u002Fgemini\u002F) — Use the Gemini Live API with LiveKit Agents.\n- [Pipecat by Daily](https:\u002F\u002Fdocs.pipecat.ai\u002Fguides\u002Ffeatures\u002Fgemini-live) — Create a real-time AI chatbot using Gemini Live and Pipecat.\n- [Fishjam by Software Mansion](https:\u002F\u002Fdocs.fishjam.io\u002Ftutorials\u002Fgemini-live-integration) — Create live video and audio streaming applications with Fishjam.\n- [Vision Agents by Stream](https:\u002F\u002Fvisionagents.ai\u002Fintegrations\u002Fgemini) — Build real-time voice and video AI applications with Vision Agents.\n- [Voximplant](https:\u002F\u002Fvoximplant.com\u002Fproducts\u002Fgemini-client) — Connect inbound and outbound calls to Live API with Voximplant.\n- [Firebase AI SDK](https:\u002F\u002Ffirebase.google.com\u002Fdocs\u002Fai-logic\u002Flive-api?api=dev) — Get started with the Gemini Live API using Firebase AI Logic.\n\n## Audio Formats\n\n- **Input**: Raw PCM, little-endian, 16-bit, mono. 16kHz native (will resample others). MIME type: `audio\u002Fpcm;rate=16000`\n- **Output**: Raw PCM, little-endian, 16-bit, mono. 24kHz sample rate.\n\n> [!IMPORTANT]\n> Use `send_realtime_input` \u002F `sendRealtimeInput` for all real-time user input (audio, video, **and text**). `send_client_content` \u002F `sendClientContent` is **only** supported for seeding initial context history (requires setting `initial_history_in_client_content` in `history_config`). Do **not** use it to send new user messages during the conversation.\n\n> [!WARNING]\n> Do **not** use `media` in `sendRealtimeInput`. Use the specific keys: `audio` for audio data, `video` for images\u002Fvideo frames, and `text` for text input.\n\n---\n\n## Quick Start\n\n### Authentication\n\n#### Python\n\n```python\nfrom google import genai\n\nclient = genai.Client(api_key=\"YOUR_API_KEY\")\n```\n\n#### JavaScript\n\n```js\nimport { GoogleGenAI } from '@google\u002Fgenai';\n\nconst ai = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });\n```\n\n### Connecting to the Live API\n\n#### Python\n```python\nfrom google.genai import types\n\nconfig = types.LiveConnectConfig(\n    response_modalities=[types.Modality.AUDIO],\n    system_instruction=types.Content(\n        parts=[types.Part(text=\"You are a helpful assistant.\")]\n    )\n)\n\nasync with client.aio.live.connect(model=\"gemini-3.1-flash-live-preview\", config=config) as session:\n    pass  # Session is active\n```\n\n#### JavaScript\n```js\nconst session = await ai.live.connect({\n  model: 'gemini-3.1-flash-live-preview',\n  config: {\n    responseModalities: ['audio'],\n    systemInstruction: { parts: [{ text: 'You are a helpful assistant.' }] }\n  },\n  callbacks: {\n    onopen: () => console.log('Connected'),\n    onmessage: (response) => console.log('Message:', response),\n    onerror: (error) => console.error('Error:', error),\n    onclose: () => console.log('Closed')\n  }\n});\n```\n\n### Sending Text\n\n#### Python\n```python\nawait session.send_realtime_input(text=\"Hello, how are you?\")\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({ text: 'Hello, how are you?' });\n```\n\n### Sending Audio\n\n#### Python\n```python\nawait session.send_realtime_input(\n    audio=types.Blob(data=chunk, mime_type=\"audio\u002Fpcm;rate=16000\")\n)\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({\n  audio: { data: chunk.toString('base64'), mimeType: 'audio\u002Fpcm;rate=16000' }\n});\n```\n\n### Sending Video\n\n#### Python\n```python\n# frame: raw JPEG-encoded bytes\nawait session.send_realtime_input(\n    video=types.Blob(data=frame, mime_type=\"image\u002Fjpeg\")\n)\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({\n  video: { data: frame.toString('base64'), mimeType: 'image\u002Fjpeg' }\n});\n```\n\n### Receiving Audio and Text\n\n> [!IMPORTANT]\n> A single server event can contain **multiple content parts simultaneously** (e.g., audio chunks and transcript). Always process **all** parts in each event to avoid missing content.\n\n#### Python\n```python\nasync for response in session.receive():\n    content = response.server_content\n    if content:\n        # Audio — process ALL parts in each event\n        if content.model_turn:\n            for part in content.model_turn.parts:\n                if part.inline_data:\n                    audio_data = part.inline_data.data\n        # Transcription\n        if content.input_transcription:\n            print(f\"User: {content.input_transcription.text}\")\n        if content.output_transcription:\n            print(f\"Gemini: {content.output_transcription.text}\")\n        # Interruption\n        if content.interrupted is True:\n            pass  # Stop playback, clear audio queue\n```\n\n#### JavaScript\n```js\n\u002F\u002F Inside the onmessage callback\nconst content = response.serverContent;\nif (content?.modelTurn?.parts) {\n  for (const part of content.modelTurn.parts) {\n    if (part.inlineData) {\n      const audioData = part.inlineData.data; \u002F\u002F Base64 encoded\n    }\n  }\n}\nif (content?.inputTranscription) console.log('User:', content.inputTranscription.text);\nif (content?.outputTranscription) console.log('Gemini:', content.outputTranscription.text);\nif (content?.interrupted) { \u002F* Stop playback, clear audio queue *\u002F }\n```\n\n---\n\n## Live Translation (Gemini Live Translate)\n\nThe Live API supports real-time, low-latency streaming translation of speech (audio) across 70+ languages. For full details on options and capabilities, see the [Live Translate Guide](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-api\u002Flive-translate.md.txt).\n\n### Model\n- `gemini-3.5-live-translate-preview` — The recommended translation model for all Live Translate use cases.\n\n### Configuration (`TranslationConfig`)\n\nTo enable translation, specify a `TranslationConfig` object inside your live session setup:\n\n- **Python SDK**: Configure the connection using `translation_config` on `LiveConnectConfig`:\n  ```python\n  config = types.LiveConnectConfig(\n      response_modalities=[types.Modality.AUDIO],\n      translation_config=types.TranslationConfig(\n          target_language_code=\"es\",  # Target language code (e.g. es, fr, pl)\n          echo_target_language=True,\n      ),\n      input_audio_transcription=types.AudioTranscriptionConfig(),\n      output_audio_transcription=types.AudioTranscriptionConfig(),\n  )\n  ```\n- **Raw WebSockets**: Place `translationConfig` inside `generationConfig`:\n  ```json\n  {\n    \"setup\": {\n      \"model\": \"models\u002Fgemini-3.5-live-translate-preview\",\n      \"generationConfig\": {\n        \"responseModalities\": [\"AUDIO\"],\n        \"translationConfig\": {\n          \"targetLanguageCode\": \"es\",\n          \"echoTargetLanguage\": true\n        }\n      }\n    }\n  }\n  ```\n\n---\n\n## Limitations\n\n- **Response modality** — Only `TEXT` **or** `AUDIO` per session, not both. Native audio models only support audio.\n- **Audio-only session** — 15 min without compression\n- **Audio+video session** — 2 min without compression\n- **Connection lifetime** — ~10 min (use session resumption)\n- **Context window** — 128k tokens (native audio) \u002F 32k tokens (standard)\n- **Async function calling** — Not yet supported; function calling is synchronous only. The model will not start responding until you've sent the tool response.\n- **Proactive audio** — Not yet supported in Gemini 3.1 Flash Live. Remove any configuration for this feature.\n- **Affective dialogue** — Not yet supported in Gemini 3.1 Flash Live. Remove any configuration for this feature.\n- **Code execution** — Not supported\n- **URL context** — Not supported\n\n## Migrating from Gemini 2.5 Flash Live\n\nWhen migrating from `gemini-2.5-flash-native-audio-preview-12-2025` to `gemini-3.1-flash-live-preview`:\n\n1. **Model string** — Update from `gemini-2.5-flash-native-audio-preview-12-2025` to `gemini-3.1-flash-live-preview`.\n2. **Thinking configuration** — Use `thinkingLevel` (`minimal`, `low`, `medium`, `high`) instead of `thinkingBudget`. Default is `minimal` for lowest latency.\n3. **Server events** — A single event can contain multiple content parts simultaneously (audio + transcript). Process **all** parts in each event.\n4. **Client content** — `send_client_content` is only for seeding initial context history (set `initial_history_in_client_content` in `history_config`). Use `send_realtime_input` for text during conversation.\n5. **Turn coverage** — Defaults to `TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO` instead of `TURN_INCLUDES_ONLY_ACTIVITY`. If sending constant video frames, consider sending only during audio activity to reduce costs.\n6. **Async function calling** — Not yet supported. Function calling is synchronous only.\n7. **Proactive audio & affective dialogue** — Not yet supported. Remove any configuration for these features.\n\n## Best Practices\n\n1. **Use headphones** when testing mic audio to prevent echo\u002Fself-interruption\n2. **Enable context window compression** for sessions longer than 15 minutes\n3. **Implement session resumption** to handle connection resets gracefully\n4. **Use ephemeral tokens** for client-side deployments — never expose API keys in browsers\n5. **Use `send_realtime_input`** for all real-time user input (audio, video, text). Reserve `send_client_content` only for seeding initial context history\n6. **Send `audioStreamEnd`** when the mic is paused to flush cached audio\n7. **Clear audio playback queues** on interruption signals\n8. **Process all parts** in each server event — events can contain multiple content parts\n\n## Documentation Lookup\n\n### When MCP is Installed (Preferred)\n\nIf the **`search_docs`** tool (from the Google MCP server) is available, use it as your **only** documentation source:\n\n1. Call `search_docs` with your query\n2. Read the returned documentation\n3. **Trust MCP results** as source of truth for API details — they are always up-to-date.\n\n> [!IMPORTANT]\n> When MCP tools are present, **never** fetch URLs manually. MCP provides up-to-date, indexed documentation that is more accurate and token-efficient than URL fetching.\n\n### When MCP is NOT Installed (Fallback Only)\n\nIf no MCP documentation tools are available, fetch from the official docs index:\n\n**llms.txt URL**: `https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fllms.txt`\n\nThis index contains links to all documentation pages in `.md.txt` format. Use web fetch tools to:\n\n1. Fetch `llms.txt` to discover available documentation pages\n2. Fetch specific pages (e.g., `https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-session.md.txt`)\n\n### Key Documentation Pages \n\n> [!IMPORTANT]\n> Those are not all the documentation pages. Use the `llms.txt` index to discover available documentation pages\n\n- [Live API Overview](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive.md.txt) — getting started, raw WebSocket usage\n- [Live Translate](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-api\u002Flive-translate.md.txt) — configuration options and capabilities for translation\n- [Live API Capabilities Guide](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-guide.md.txt) — voice config, transcription config, native audio (thinking), VAD configuration, media resolution\n- [Live API Tool Use](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-tools.md.txt) — function calling (sync and async), Google Search grounding\n- [Session Management](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-session.md.txt) — context window compression, session resumption, GoAway signals\n- [Ephemeral Tokens](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fephemeral-tokens.md.txt) — secure client-side authentication for browser\u002Fmobile\n- [WebSockets API Reference](https:\u002F\u002Fai.google.dev\u002Fapi\u002Flive.md.txt) — raw WebSocket protocol details\n\n## Supported Languages\n\nThe Live API supports 70 languages including: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, Hindi, Arabic, Russian, and many more. Native audio models automatically detect and switch languages.\n","# Gemini Live API Development Skill\n\n## Overview\n\nThe Live API enables **low-latency, real-time voice and video interactions** with Gemini over WebSockets. It processes continuous streams of audio, video, or text to deliver immediate, human-like spoken responses.\n\nKey capabilities:\n- **Bidirectional audio streaming** — real-time mic-to-speaker conversations\n- **Video streaming** — send camera\u002Fscreen frames alongside audio\n- **Text input\u002Foutput** — send and receive text within a live session\n- **Audio transcriptions** — get text transcripts of both input and output audio\n- **Voice Activity Detection (VAD)** — automatic interruption handling\n- **Native audio** — thinking (with configurable `thinkingLevel`)\n- **Function calling** — synchronous tool use\n- **Google Search grounding** — ground responses in real-time search results\n- **Session management** — context compression, session resumption, GoAway signals\n- **Ephemeral tokens** — secure client-side authentication\n\n> [!NOTE]\n> The Live API currently **only supports WebSockets**. For WebRTC support or simplified integration, use a [partner integration](#partner-integrations).\n\n## Models\n\n- `gemini-3.1-flash-live-preview` — Optimized for low-latency, real-time dialogue. Native audio output, thinking (via `thinkingLevel`). 128k context window. **This is the recommended model for all Live API use cases.**\n- `gemini-3.5-live-translate-preview` — Real-time streaming translation model.\n\n> [!WARNING]\n> The following Live API models are **deprecated** and will be shut down. Migrate to `gemini-3.1-flash-live-preview`.\n> - `gemini-2.5-flash-native-audio-preview-12-2025` — Migrate to `gemini-3.1-flash-live-preview`.\n> - `gemini-live-2.5-flash-preview` — Released June 17, 2025. Shutdown: December 9, 2025.\n> - `gemini-2.0-flash-live-001` — Released April 9, 2025. Shutdown: December 9, 2025.\n\n## SDKs\n\n- **Python**: `google-genai` — `pip install google-genai`\n- **JavaScript\u002FTypeScript**: `@google\u002Fgenai` — `npm install @google\u002Fgenai`\n\n> [!WARNING]\n> Legacy SDKs `google-generativeai` (Python) and `@google\u002Fgenerative-ai` (JS) are deprecated. Use the new SDKs above.\n\n## Partner Integrations\n\nTo streamline real-time audio\u002Fvideo app development, use a third-party integration supporting the Gemini Live API over **WebRTC** or **WebSockets**:\n\n- [LiveKit](https:\u002F\u002Fdocs.livekit.io\u002Fagents\u002Fmodels\u002Frealtime\u002Fplugins\u002Fgemini\u002F) — Use the Gemini Live API with LiveKit Agents.\n- [Pipecat by Daily](https:\u002F\u002Fdocs.pipecat.ai\u002Fguides\u002Ffeatures\u002Fgemini-live) — Create a real-time AI chatbot using Gemini Live and Pipecat.\n- [Fishjam by Software Mansion](https:\u002F\u002Fdocs.fishjam.io\u002Ftutorials\u002Fgemini-live-integration) — Create live video and audio streaming applications with Fishjam.\n- [Vision Agents by Stream](https:\u002F\u002Fvisionagents.ai\u002Fintegrations\u002Fgemini) — Build real-time voice and video AI applications with Vision Agents.\n- [Voximplant](https:\u002F\u002Fvoximplant.com\u002Fproducts\u002Fgemini-client) — Connect inbound and outbound calls to Live API with Voximplant.\n- [Firebase AI SDK](https:\u002F\u002Ffirebase.google.com\u002Fdocs\u002Fai-logic\u002Flive-api?api=dev) — Get started with the Gemini Live API using Firebase AI Logic.\n\n## Audio Formats\n\n- **Input**: Raw PCM, little-endian, 16-bit, mono. 16kHz native (will resample others). MIME type: `audio\u002Fpcm;rate=16000`\n- **Output**: Raw PCM, little-endian, 16-bit, mono. 24kHz sample rate.\n\n> [!IMPORTANT]\n> Use `send_realtime_input` \u002F `sendRealtimeInput` for all real-time user input (audio, video, **and text**). `send_client_content` \u002F `sendClientContent` is **only** supported for seeding initial context history (requires setting `initial_history_in_client_content` in `history_config`). Do **not** use it to send new user messages during the conversation.\n\n> [!WARNING]\n> Do **not** use `media` in `sendRealtimeInput`. Use the specific keys: `audio` for audio data, `video` for images\u002Fvideo frames, and `text` for text input.\n\n---\n\n## Quick Start\n\n### Authentication\n\n#### Python\n\n```python\nfrom google import genai\n\nclient = genai.Client(api_key=\"YOUR_API_KEY\")\n```\n\n#### JavaScript\n\n```js\nimport { GoogleGenAI } from '@google\u002Fgenai';\n\nconst ai = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });\n```\n\n### Connecting to the Live API\n\n#### Python\n```python\nfrom google.genai import types\n\nconfig = types.LiveConnectConfig(\n    response_modalities=[types.Modality.AUDIO],\n    system_instruction=types.Content(\n        parts=[types.Part(text=\"You are a helpful assistant.\")]\n    )\n)\n\nasync with client.aio.live.connect(model=\"gemini-3.1-flash-live-preview\", config=config) as session:\n    pass  # Session is active\n```\n\n#### JavaScript\n```js\nconst session = await ai.live.connect({\n  model: 'gemini-3.1-flash-live-preview',\n  config: {\n    responseModalities: ['audio'],\n    systemInstruction: { parts: [{ text: 'You are a helpful assistant.' }] }\n  },\n  callbacks: {\n    onopen: () => console.log('Connected'),\n    onmessage: (response) => console.log('Message:', response),\n    onerror: (error) => console.error('Error:', error),\n    onclose: () => console.log('Closed')\n  }\n});\n```\n\n### Sending Text\n\n#### Python\n```python\nawait session.send_realtime_input(text=\"Hello, how are you?\")\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({ text: 'Hello, how are you?' });\n```\n\n### Sending Audio\n\n#### Python\n```python\nawait session.send_realtime_input(\n    audio=types.Blob(data=chunk, mime_type=\"audio\u002Fpcm;rate=16000\")\n)\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({\n  audio: { data: chunk.toString('base64'), mimeType: 'audio\u002Fpcm;rate=16000' }\n});\n```\n\n### Sending Video\n\n#### Python\n```python\n# frame: raw JPEG-encoded bytes\nawait session.send_realtime_input(\n    video=types.Blob(data=frame, mime_type=\"image\u002Fjpeg\")\n)\n```\n\n#### JavaScript\n```js\nsession.sendRealtimeInput({\n  video: { data: frame.toString('base64'), mimeType: 'image\u002Fjpeg' }\n});\n```\n\n### Receiving Audio and Text\n\n> [!IMPORTANT]\n> A single server event can contain **multiple content parts simultaneously** (e.g., audio chunks and transcript). Always process **all** parts in each event to avoid missing content.\n\n#### Python\n```python\nasync for response in session.receive():\n    content = response.server_content\n    if content:\n        # Audio — process ALL parts in each event\n        if content.model_turn:\n            for part in content.model_turn.parts:\n                if part.inline_data:\n                    audio_data = part.inline_data.data\n        # Transcription\n        if content.input_transcription:\n            print(f\"User: {content.input_transcription.text}\")\n        if content.output_transcription:\n            print(f\"Gemini: {content.output_transcription.text}\")\n        # Interruption\n        if content.interrupted is True:\n            pass  # Stop playback, clear audio queue\n```\n\n#### JavaScript\n```js\n\u002F\u002F Inside the onmessage callback\nconst content = response.serverContent;\nif (content?.modelTurn?.parts) {\n  for (const part of content.modelTurn.parts) {\n    if (part.inlineData) {\n      const audioData = part.inlineData.data; \u002F\u002F Base64 encoded\n    }\n  }\n}\nif (content?.inputTranscription) console.log('User:', content.inputTranscription.text);\nif (content?.outputTranscription) console.log('Gemini:', content.outputTranscription.text);\nif (content?.interrupted) { \u002F* Stop playback, clear audio queue *\u002F }\n```\n\n---\n\n## Live Translation (Gemini Live Translate)\n\nThe Live API supports real-time, low-latency streaming translation of speech (audio) across 70+ languages. For full details on options and capabilities, see the [Live Translate Guide](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-api\u002Flive-translate.md.txt).\n\n### Model\n- `gemini-3.5-live-translate-preview` — The recommended translation model for all Live Translate use cases.\n\n### Configuration (`TranslationConfig`)\n\nTo enable translation, specify a `TranslationConfig` object inside your live session setup:\n\n- **Python SDK**: Configure the connection using `translation_config` on `LiveConnectConfig`:\n  ```python\n  config = types.LiveConnectConfig(\n      response_modalities=[types.Modality.AUDIO],\n      translation_config=types.TranslationConfig(\n          target_language_code=\"es\",  # Target language code (e.g. es, fr, pl)\n          echo_target_language=True,\n      ),\n      input_audio_transcription=types.AudioTranscriptionConfig(),\n      output_audio_transcription=types.AudioTranscriptionConfig(),\n  )\n  ```\n- **Raw WebSockets**: Place `translationConfig` inside `generationConfig`:\n  ```json\n  {\n    \"setup\": {\n      \"model\": \"models\u002Fgemini-3.5-live-translate-preview\",\n      \"generationConfig\": {\n        \"responseModalities\": [\"AUDIO\"],\n        \"translationConfig\": {\n          \"targetLanguageCode\": \"es\",\n          \"echoTargetLanguage\": true\n        }\n      }\n    }\n  }\n  ```\n\n---\n\n## Limitations\n\n- **Response modality** — Only `TEXT` **or** `AUDIO` per session, not both. Native audio models only support audio.\n- **Audio-only session** — 15 min without compression\n- **Audio+video session** — 2 min without compression\n- **Connection lifetime** — ~10 min (use session resumption)\n- **Context window** — 128k tokens (native audio) \u002F 32k tokens (standard)\n- **Async function calling** — Not yet supported; function calling is synchronous only. The model will not start responding until you've sent the tool response.\n- **Proactive audio** — Not yet supported in Gemini 3.1 Flash Live. Remove any configuration for this feature.\n- **Affective dialogue** — Not yet supported in Gemini 3.1 Flash Live. Remove any configuration for this feature.\n- **Code execution** — Not supported\n- **URL context** — Not supported\n\n## Migrating from Gemini 2.5 Flash Live\n\nWhen migrating from `gemini-2.5-flash-native-audio-preview-12-2025` to `gemini-3.1-flash-live-preview`:\n\n1. **Model string** — Update from `gemini-2.5-flash-native-audio-preview-12-2025` to `gemini-3.1-flash-live-preview`.\n2. **Thinking configuration** — Use `thinkingLevel` (`minimal`, `low`, `medium`, `high`) instead of `thinkingBudget`. Default is `minimal` for lowest latency.\n3. **Server events** — A single event can contain multiple content parts simultaneously (audio + transcript). Process **all** parts in each event.\n4. **Client content** — `send_client_content` is only for seeding initial context history (set `initial_history_in_client_content` in `history_config`). Use `send_realtime_input` for text during conversation.\n5. **Turn coverage** — Defaults to `TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO` instead of `TURN_INCLUDES_ONLY_ACTIVITY`. If sending constant video frames, consider sending only during audio activity to reduce costs.\n6. **Async function calling** — Not yet supported. Function calling is synchronous only.\n7. **Proactive audio & affective dialogue** — Not yet supported. Remove any configuration for these features.\n\n## Best Practices\n\n1. **Use headphones** when testing mic audio to prevent echo\u002Fself-interruption\n2. **Enable context window compression** for sessions longer than 15 minutes\n3. **Implement session resumption** to handle connection resets gracefully\n4. **Use ephemeral tokens** for client-side deployments — never expose API keys in browsers\n5. **Use `send_realtime_input`** for all real-time user input (audio, video, text). Reserve `send_client_content` only for seeding initial context history\n6. **Send `audioStreamEnd`** when the mic is paused to flush cached audio\n7. **Clear audio playback queues** on interruption signals\n8. **Process all parts** in each server event — events can contain multiple content parts\n\n## Documentation Lookup\n\n### When MCP is Installed (Preferred)\n\nIf the **`search_docs`** tool (from the Google MCP server) is available, use it as your **only** documentation source:\n\n1. Call `search_docs` with your query\n2. Read the returned documentation\n3. **Trust MCP results** as source of truth for API details — they are always up-to-date.\n\n> [!IMPORTANT]\n> When MCP tools are present, **never** fetch URLs manually. MCP provides up-to-date, indexed documentation that is more accurate and token-efficient than URL fetching.\n\n### When MCP is NOT Installed (Fallback Only)\n\nIf no MCP documentation tools are available, fetch from the official docs index:\n\n**llms.txt URL**: `https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fllms.txt`\n\nThis index contains links to all documentation pages in `.md.txt` format. Use web fetch tools to:\n\n1. Fetch `llms.txt` to discover available documentation pages\n2. Fetch specific pages (e.g., `https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-session.md.txt`)\n\n### Key Documentation Pages \n\n> [!IMPORTANT]\n> Those are not all the documentation pages. Use the `llms.txt` index to discover available documentation pages\n\n- [Live API Overview](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive.md.txt) — getting started, raw WebSocket usage\n- [Live Translate](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-api\u002Flive-translate.md.txt) — configuration options and capabilities for translation\n- [Live API Capabilities Guide](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-guide.md.txt) — voice config, transcription config, native audio (thinking), VAD configuration, media resolution\n- [Live API Tool Use](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-tools.md.txt) — function calling (sync and async), Google Search grounding\n- [Session Management](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Flive-session.md.txt) — context window compression, session resumption, GoAway signals\n- [Ephemeral Tokens](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fephemeral-tokens.md.txt) — secure client-side authentication for browser\u002Fmobile\n- [WebSockets API Reference](https:\u002F\u002Fai.google.dev\u002Fapi\u002Flive.md.txt) — raw WebSocket protocol details\n\n## Supported Languages\n\nThe Live API supports 70 languages including: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, Hindi, Arabic, Russian, and many more. Native audio models automatically detect and switch languages.\n",{"name":5,"description":7},"main","900ea3c9eb045fd5b0317dc1103777ecf3ea4aeb","skills\u002Fgemini-live-api-dev",0,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker","https:\u002F\u002Fnguyenhungtran18.github.io\u002Fskill-and-tool-tracker\u002F","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18","2026-08-31 18:36:09",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill gemini-live-api-dev",{"tool":37,"command":38},"bunx","bunx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill gemini-live-api-dev",{"tool":40,"command":41},"pnpm","pnpm dlx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill gemini-live-api-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fgemini-live-api-dev\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7BVP4P83TK60JZ4P8RP9VP7","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fxcode_project_setup\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M7BVP01K4CSJJ8G90FT8S2D5","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7BVNY22GXD871GYTSH599F1","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7BVNQWF24RNKA8A4KM2HJ3T","workflow-skill-creator","Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say \"make this a skill\", \"create a skill from what we just did\", \"package this workflow\" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow_skill_creator\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7BVNNY67XPCQAQHY3FBKDGC","verify-and-stop","Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverify-and-stop\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7BVNKB4Z7SZT85B73ZZ90Y6","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[]]