Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

google: support Live Avatar video output for Gemini 3.8 Live (avatar_config, VIDEO modality)

オープン
#7,843 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@percusser がすでに取り組んでいます。

2026年10月15日 から。

  • #7858 @percusser による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
gcp, python

調査の方向性

Start with the Google realtime plugin's RealtimeModel, _build_connect_config, and _handle_server_content, which currently send every inline_data part to audio_ch as PCM. The design is still open: the maintainers asked whether avatar support belongs in a plugin-level AvatarSession or in core generations, and whether it should be Vertex-only. Settle those questions in #7843 before writing code. Done would mean MP4 fragments are demuxed and routed by mime type, with unit tests covering decode, routing and interrupt flush.

索引モデルが issue の本文から書いたものです。

説明

Feature Type

Would make my life easier

Feature Description

Gemini 3.8 Live on Vertex AI (Gemini Enterprise Agent Platform) went GA with Live Avatar on 2026-09-24. With response_modalities=["VIDEO"] and an avatar_config in the setup message, the model returns a lip-synced 24 FPS talking-head stream along with its speech. google-genai already ships the types (types.AvatarConfig, types.CustomizedAvatar, LiveConnectConfig.avatar_config).

livekit-plugins-google can't use it today:

  1. RealtimeModel has no avatar_config option, and _build_connect_config never sets it.
  2. _handle_server_content treats every part.inline_data as 24 kHz PCM and pushes it to audio_ch. In avatar mode, inline_data holds fragmented MP4 (H.264 video plus AAC-LC audio), so the agent plays noise.

Proposed shape, following the in-process avatar plugins (bithuman, which uses QueueAudioOutput + AvatarRunner + a VideoGenerator):

from livekit.plugins import google

llm = google.realtime.RealtimeModel(
    model="gemini-3.8-live",
    vertexai=True,
    voice="Puck",
    avatar=google.realtime.LiveAvatarOptions(avatar_name="Ben"),
)
session = AgentSession(llm=llm)

avatar = google.realtime.AvatarSession()
await avatar.start(session, room=ctx.room)
await session.start(agent=MyAgent(), room=ctx.room)
  • RealtimeModel(avatar=...) sets avatar_config and the VIDEO modality, and routes inline_data by mime_type. MP4 fragments are demuxed with PyAV, which livekit-agents already depends on. Decoded audio still goes through audio_ch, so transcription, interruption, truncation, and metrics behave as they do today. Decoded video frames go to a per-generation video queue.
  • AvatarSession.start() installs a QueueAudioOutput as session.output.audio and runs an AvatarRunner with a VideoGenerator. The generator pairs each audio frame it receives with the video frames for the same media time, and the runner publishes both tracks through rtc.AVSynchronizer. clear_buffer() on interruption drops the queued video.
  • No changes to livekit-agents core.

Questions for maintainers before we open a PR:

  1. Is the AvatarSession in the Google plugin the shape you want, or would you rather add a generic video path to RealtimeModel generations in core?
  2. Should avatar mode be Vertex-only? Google documents it for Agent Platform, but google-genai also maps avatar_config on the Gemini API path. We'd raise a clear error when the API doesn't support it, rather than guess.

We're willing to implement it, add unit tests that feed recorded MP4 fragments (decode, routing, interrupt flush), and add an example under examples/.

Workarounds / Alternatives
  • Subclassing RealtimeSession and overriding the private _build_connect_config and _handle_server_content methods. That breaks on any refactor of those methods.
  • A third-party avatar vendor (Tavus, Hedra, and others) fed by the agent's audio. That adds a second vendor and more latency, when the model already renders the avatar.
What the stream looks like

We ran two probe sessions against gemini-3.8-live on Vertex (us-central1, google-genai 2.31.0, avatar "Ben", voice "Puck"):

  • Every inline_data part is video/mp4. No separate PCM is sent. Audio is only inside the MP4.
  • One init segment (ftyp+moov) per session, then moof/mdat fragments: about 24 video fragments per second (one frame each) and about 24 AAC fragments per second, in separate fragments.
  • Video: H.264, 704x1280, 24 FPS, about 8.2 Mbps at default video_bitrate_bps. Audio: AAC-LC, 24 kHz mono, 128 kbps.
  • The stream is continuous and server-paced in real time for the whole session. While the model is listening it sends idle frames with silent audio, and there is no new init segment per turn.
  • Interruption is handled by the server. Barging in mid-sentence produced interrupted and turn_complete about 1 s after speech start. The speech stopped in the stream, and the video continued as idle frames.
  • Output and input transcription work in VIDEO mode. usage_metadata.response_tokens_details reports a VIDEO modality (about 6,200 tokens per second of speech, matching the published rate).

Because the stream is continuous rather than per generation, the generator has to emit the server's idle frames between generations and play speech frames in step with the audio that AgentSession plays. We'd like your view on keeping that sync inside the plugin's VideoGenerator.

Additional Context
主要言語
Python
スター
14.6k
フォーク
3.9k
平均マージ
3日 1時間
マージ済み PR(30日)
166

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

livekit/agents のほかの issue

livekit/agents の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。