gemini-live-api
Fungsinya
Skill ini menghasilkan kode untuk klien Gemini real-time yang menangani audio, video, dan teks yang di-stream. Skill ini ditujukan untuk developer yang membangun asisten suara atau video di Google Cloud.
Kapan dipakai
- βSaat Anda ingin membangun klien suara atau video real-time untuk Gemini di Google Cloud.
- βSaat Anda memerlukan klien Live API yang menangani resumption sesi dan penyegaran token.
- βSaat Anda ingin frontend dan backend contoh untuk menguji koneksi Gemini live.
Link skill
https://github.com/google/skills/blob/main/skills/cloud/gemini-live-api/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat klien untuk Gemini Live API yang men-stream mikrofon saya ke model dan memutar kembali balasannya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini menulis kelas klien yang membuka koneksi WebSocket dengan token dari login Google Anda, mengirim dan menerima pesan, serta melanjutkan sesi. Skill ini juga membuat frontend dan backend demo untuk pengujian.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
LiveAPI Service Skill
This skill provides instructions for generating a LiveAPI client service
class that connects to the Gemini Enterprise Live API over WebSockets. The
generated client handles bidirectional streaming, bearer-token authentication
via Application Default Credentials (ADC), transparent session resumption, and
ClientMessage / ServerMessage proto exchange.
The skill also produces a demo frontend + backend service so the user can interactively validate the generated client (text, audio, video, transcription, and interrupt handling).
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gemini-live-api)"
and append agent-skills/1.0 (skill:gemini-live-api) to User-Agent headers.
Prerequisites
Before running the generation flow, ensure the following are available on the host:
A Google Cloud project with the Vertex AI / Gemini Enterprise Agent Platform APIs enabled.
Application Default Credentials configured on the host running the generated client:
gcloud auth application-default loginA destination output folder supplied by the user (e.g.
/tmp/liveapi_out) where the generated code, environment, and demo will be written. Never mutate the host's system Python environment.The user's chosen implementation language (Python is the default and reference language for this skill).
Reference Files
Provided files in references/ (do not treat these as standalone skills β
they are loaded on demand):
client_server_messages.md: Public reference for theClientMessage/ServerMessageschemas used by the Live API.client_server_messages.proto: The proto definition generated fromclient_server_messages.md.session_manager.md: Describes how to correctly handle sessions, buffering, and resumption on disconnection.
Steps
Step 1: Copy the reference files
Copy client_server_messages.md, client_server_messages.proto, and
session_manager.md from this skill's references/ folder into the user's
destination output folder. These files become the source of truth for the
generated client.
Step 2: Reconcile with the public documentation
Examine the public documents linked from client_server_messages.md. If there
are any discrepancies between the public documents and the copied
client_server_messages.md / client_server_messages.proto, update the copies
in the destination folder so the generated client compiles and runs against the
current server contract.
Step 3: Implement the client class
Implement a class in the user's chosen language that:
- Imports the local
client_server_messages.prototypes (ClientMessage,ServerMessage). - Opens a WebSocket connection to the Live API endpoint.
- Exposes async methods so the user can send and receive data to/from the model.
For languages that require an isolated runtime (e.g. Python), create an isolated
environment (e.g. venv) inside the destination folder and generate a bash
script (e.g. setup.sh) that recreates the environment and installs
dependencies. Never install into the system interpreter or the user's global
site-packages, and never instruct the user to run sudo pip install.
Initialization parameters
The user provides the following at construction time:
project_idlocationmodel_idconfig: aClientMessagewith thesetupfield populated.
Authentication
Obtain a bearer token via Application Default Credentials, attach it to the
WebSocket connect request as Authorization: Bearer <token>, refresh the token
before or upon expiry, and reuse the refreshed token on every reconnection
(including go_away and unexpected disconnects). Do not hard-code a
long-lived API key as the only auth mechanism.
Public async API
The class MUST expose the following async methods, gated on receipt of a
setup_complete ServerMessage before sending:
send_realtime_data(data): send realtime input.datais aClientMessagecarrying arealtime_inputfield.send_client_content(data): send non-realtime, turn-based content that contributes to history. `da
Pertanyaan umum
Apakah berfungsi untuk panggilan Gemini biasa yang tidak live?
Tidak. Skill ini hanya untuk koneksi live dua arah.
Apa yang saya butuhkan sebelum menjalankannya?
Proyek Google Cloud dengan API yang sudah diaktifkan, dan Application Default Credentials yang sudah diatur.
Bisakah saya menguji tanpa membangun antarmuka?
Bisa. Skill ini juga menghasilkan frontend dan backend demo yang dapat Anda gunakan.
Detail
Deskripsi asli dari pembuat
Generates a Gemini LiveAPI client service class in the user's chosen programming language. Use when the user wants to build, scaffold, or integrate a client that connects to the Gemini Enterprise LiveAPI websocket endpoint, handles session setup/resumption, bearer token refresh, and sending/receiving `ClientMessage`/`ServerMessage` protos. Don't use for general (non-live, non-bidirectional) Gemini API usage such as one-shot `generateContent`, embeddings, image/video generation, or fine-tuning β use the `gemini-api` skill for those.
repo: google/skills
Popularitas
- Bintang GitHub
- 22k
- Peringkat
- #10263
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
finding-google-skills
22kMembantu agent Anda menemukan panduan Google yang tepat untuk tugas pengaturan, seperti hosting, database, penyimpanan, login, atau penyajian model AI.
gcloud
22kMembantu agent Anda menulis dan memeriksa perintah gcloud Google Cloud, dengan mencari sintaks yang tepat sebelum menjalankan apa pun agar tidak menebak flag.
google-cloud-recipe-auth
22kMemandu agent Anda melalui identitas dan akses Google Cloud, termasuk cara orang dan layanan masuk serta izin apa yang mereka dapatkan.
google-cloud-recipe-onboarding
22kMemandu pengembang baru melalui langkah pertama di Google Cloud, termasuk memilih proyek, menautkan penagihan, dan men-deploy sumber daya pertama.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.