Skip to content

feat: add Gemini Live API docs (Python + JavaScript)#207

Open
naga-k wants to merge 3 commits intoandrewyng:mainfrom
naga-k:feat/gemini-live-api-docs
Open

feat: add Gemini Live API docs (Python + JavaScript)#207
naga-k wants to merge 3 commits intoandrewyng:mainfrom
naga-k:feat/gemini-live-api-docs

Conversation

@naga-k
Copy link
Copy Markdown

@naga-k naga-k commented Mar 29, 2026

Summary

Adds documentation for the Gemini Live API (real-time bidirectional voice/video/text streaming over WebSocket) to the content registry. This API was missing from chub — search for "gemini live" returned no results.

Python variant (content/gemini/docs/live/python/DOC.md, 406 lines):

  • client.aio.live.connect async context manager pattern
  • send_realtime_input for audio/text/video, session.receive() async iterator
  • Full LiveConnectConfig with VAD, thinking, tools, session resumption
  • Complete reconnect loop with GoAway handling

JavaScript variant (content/gemini/docs/live/javascript/DOC.md, 422 lines):

  • ai.live.connect callback-based pattern (onmessage, onerror, onclose)
  • sendRealtimeInput for audio/text/video
  • Full config object with VAD, thinking, tools, session resumption
  • Complete reconnect loop with GoAway handling

Both variants include references/advanced.md covering:

  • Raw WebSocket API (no SDK)
  • Ephemeral tokens for browser clients
  • Async function calling (Gemini 2.5 Flash Live only)
  • Model feature comparison (3.1 Flash Live vs 2.5 Flash Live)

Details

  • Models covered: gemini-3.1-flash-live-preview (recommended) and gemini-2.5-flash-live-preview
  • Audio format: 16kHz PCM input, 24kHz PCM output
  • Both docs share name: live for variant grouping
  • source: community, updated-on: 2026-03-29
  • Build validates: chub build content/ --validate-only passes (1554 docs, 7 skills)

Review Notes

  • Adversarial review caught a sync JS tool handler (silently serialized Promises) — fixed
  • model_turn.parts None guard added to Python receive loop
  • Session resumption examples replaced with complete reconnect loops
  • history_config for 3.1 Flash send_client_content now shown in code

🤖 Generated with Claude Code

naga-k and others added 3 commits March 29, 2026 17:43
Adds real-time voice/video streaming API documentation covering
LiveConnectConfig, VAD, tool calling, session management, and
raw WebSocket API. Both Python (google-genai) and JavaScript
(@google/genai) variants with reference files for advanced topics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Make JS tool handler async (was silently serializing Promises)
- Add None guard on model_turn.parts in Python receive loop
- Remove non-standard revision frontmatter field
- Add server-side-only warning to raw WebSocket endpoints
- Add auth note to ephemeral token fetch example
- Show complete reconnect loop with GoAway handling
- Add history_config example for 3.1 Flash send_client_content
- Add error handling guidance to receive loop sections

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ephemeral tokens section already covers the browser case.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant