Chuyển đến nội dung
Skillpedia
Agent48k · #4709

gemini-live-api-dev

Skill này làm gì

Công cụ này cho phép bạn xây dựng ứng dụng trò chuyện với AI theo thời gian thực bằng giọng nói, video hoặc văn bản. Giống như có một cuộc trò chuyện mượt mà, tức thời với một trợ lý.

Khi nào nên dùng

  • ✓Khi xây dựng chatbot bằng giọng nói cho dịch vụ khách hàng.
  • ✓Khi phát triển một trò chơi tương tác có phản hồi bằng giọng nói.
  • ✓Khi làm một ứng dụng dịch hội thoại theo thời gian thực.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gemini-live-api-dev/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gemini-live-api-dev/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để tạo một ứng dụng phản hồi bằng giọng nói theo thời gian thực?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn kết nối ứng dụng với Gemini API bằng một giao thức đặc biệt gọi là WebSocket. Điều này cho phép bạn gửi và nhận dữ liệu (giọng nói, video, văn bản) liên tục, giúp AI phản hồi gần như ngay lập tức.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Gemini Live API Development Skill

When to Use

Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio/video/text streaming, voice activity detection (VAD), native audio features, function calling, session management, ephemeral tokens for client-side auth,...

Overview

The 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.

Key capabilities:

  • Bidirectional audio streaming — real-time mic-to-speaker conversations
  • Video streaming — send camera/screen frames alongside audio
  • Text input/output — send and receive text within a live session
  • Audio transcriptions — get text transcripts of both input and output audio
  • Voice Activity Detection (VAD) — automatic interruption handling
  • Native audio — thinking (with configurable thinkingLevel)
  • Function calling — synchronous tool use
  • Google Search grounding — ground responses in real-time search results
  • Session management — context compression, session resumption, GoAway signals
  • Ephemeral tokens — secure client-side authentication

[!NOTE] The Live API currently only supports WebSockets. For WebRTC support or simplified integration, use a partner integration.

Models

  • 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.
  • gemini-3.5-live-translate-preview — Real-time streaming translation model.

[!WARNING] The following Live API models are deprecated and will be shut down. Migrate to gemini-3.1-flash-live-preview.

  • gemini-2.5-flash-native-audio-preview-12-2025 — Migrate to gemini-3.1-flash-live-preview.
  • gemini-live-2.5-flash-preview — Released June 17, 2025. Shutdown: December 9, 2025.
  • gemini-2.0-flash-live-001 — Released April 9, 2025. Shutdown: December 9, 2025.

SDKs

  • Python: google-genai — pip install google-genai
  • JavaScript/TypeScript: @google/genai — npm install @google/genai

[!WARNING] Legacy SDKs google-generativeai (Python) and @google/generative-ai (JS) are deprecated. Use the new SDKs above.

Partner Integrations

To streamline real-time audio/video app development, use a third-party integration supporting the Gemini Live API over WebRTC or WebSockets:

  • LiveKit — Use the Gemini Live API with LiveKit Agents.
  • Pipecat by Daily — Create a real-time AI chatbot using Gemini Live and Pipecat.
  • Fishjam by Software Mansion — Create live video and audio streaming applications with Fishjam.
  • Vision Agents by Stream — Build real-time voice and video AI applications with Vision Agents.
  • Voximplant — Connect inbound and outbound calls to Live API with Voximplant.
  • Firebase AI SDK — Get started with the Gemini Live API using Firebase AI Logic.

Audio Formats

  • Input: Raw PCM, little-endian, 16-bit, mono. 16kHz native (will resample others). MIME type: audio/pcm;rate=16000
  • Output: Raw PCM, little-endian, 16-bit, mono. 24kHz sample rate.

[!IMPORTANT] Use send_realtime_input / sendRealtimeInput for all real-time user input (audio, video, and text). send_client_content / 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.

[!WARNING] Do not use media in sendRealtimeInput. Use the specific keys: audio for audio data, video for images/video frames, and text for text input.


Quick Start

Authentication

Python

import os
from google import genai

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

JavaScript

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });

…

Câu hỏi thường gặp

'Bidirectional' nghĩa là gì?

Nghĩa là giao tiếp diễn ra theo cả hai chiều: bạn gửi thông tin cho AI, và nó gửi thông tin trở lại cho bạn, cùng lúc.

Tôi có thể gửi âm thanh và video cùng lúc không?

Có, bạn có thể gửi âm thanh từ micro và video từ camera hoặc màn hình cùng lúc để có trải nghiệm phong phú hơn.

Tôi có cần dùng mã phức tạp không?

Có các thư viện (SDK) cho Python và JavaScript giúp đơn giản hóa việc kết nối và gửi dữ liệu tới API.

Chi tiết

Mô tả gốc của tác giả

Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4709
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự