Skip to content

feat: add Google ADK integration plugin (#5107)#5110

Open
Harshil7875 wants to merge 3 commits intolivekit:mainfrom
Harshil7875:feat/google-adk-integration-5107
Open

feat: add Google ADK integration plugin (#5107)#5110
Harshil7875 wants to merge 3 commits intolivekit:mainfrom
Harshil7875:feat/google-adk-integration-5107

Conversation

@Harshil7875
Copy link

PR: Add livekit-plugins-google-adk — initial Google ADK adapter (closes #5107)

Summary
This PR introduces a new plugin package, livekit-plugins-google-adk, which provides a first-class adapter between LiveKit Agents and Google’s Agent Development Kit (ADK). It implements a text-only MVP that mirrors the existing livekit-plugins-langchain pattern so ADK-based agents and runners can be used directly as llm.LLM implementations inside Agent / AgentSession.

Closes: #5107


What I added

New package: livekit-plugins-google-adk

Files created

  • pyproject.toml — package configuration; adds dependency pins: google-adk>=1.0.0, livekit-agents>=1.4.5.
  • __init__.py — plugin registration and public exports (LLMAdapter, ADKStream).
  • adk.py — core adapter implementation: LLMAdapter and ADKStream.
  • google_adk_agent.py — example voice agent demonstrating usage and tool delegation to ADK.
  • version.py — package version 0.1.0.
  • py.typed — PEP 561 type marker.

Design & implementation details

This package intentionally follows the LangChain adapter pattern to keep behavior consistent with existing non-provider framework integrations.

Key points:

  • LLMAdapter implements livekit.agents.llm.LLM and wraps a Google ADK Runner (or can accept an ADK Agent/factory).
  • ADKStream implements livekit.agents.llm.LLMStream. It executes the ADK runner asynchronously and converts ADK events into ChatChunk / token text pushes on the LiveKit stream.
  • Session management: the adapter lazily creates/initializes an ADK session on the first chat()/stream() call. ADK is allowed to manage its own conversation history (consistent with the LangChain approach).
  • Tool handling: tools are delegated to ADK. The adapter does not attempt to reimplement ADK tool invocation; ADK remains the single source of truth for tools and tool routing.
  • Context flow: adapter extracts the relevant user message(s) from LiveKit's ChatContext and forwards text to runner.run_async() (or ADK equivalent). For the MVP only final response events are emitted back to LiveKit (text-only), to keep semantics simple and predictable.

Behavioral choices & rationale

  • Text-only MVP: avoids initial complexity of multimodal, images, or function-calling. Enables a small, reviewable surface that solves the core integration described in Feature request: Google ADK integration plugin similar to LangChain #5107.
  • Event conversion: ADK token/message events are translated into LLMStream.push_text() and LLMStream.end(); only is_final_response() events are emitted to LiveKit in the MVP to avoid partial/incomplete UI behavior that might be surprising for users.
  • Ergonomics: primary constructor LLMAdapter(runner=my_adk_runner) matches the suggested UX in the issue and mirrors the LangChain plugin’s ergonomics.

Usage example

from livekit.agents import Agent
from livekit.plugins import google_adk

# create ADK runner elsewhere; injected here
agent = Agent(
    instructions="",  # guidance managed by ADK agent configuration
    llm=google_adk.LLMAdapter(runner=my_adk_runner),
)

See google_adk_agent.py in the package for a runnable voice-agent example that demonstrates streaming and tool usage delegated to ADK.


Dependencies & compatibility

  • Declared in pyproject.toml:

    • google-adk>=1.0.0
    • livekit-agents>=1.4.5
  • Package version: 0.1.0 (file version.py).

  • Type hints included (py.typed) to facilitate consumption in type-checked projects.


How to test locally

  1. Install the package in editable mode:

    pip install -e .[dev]  # from the package directory, if you want dev deps
  2. Run the example:

    • Ensure you have an ADK runner configured (see ADK docs).
    • Run python google_adk_agent.py — the example demonstrates initialization, a single conversation exchange, and streaming behavior.
  3. Unit tests (suggested):

    • Add tests that mock an ADK runner emitting token events and validate ADKStream forwards tokens and end() properly.
    • Add tests for LLMAdapter to confirm ChatContext → ADK Content conversion and that only final responses are emitted back.

Documentation & example

  • google_adk_agent.py functions as an example and minimal usage guide.
  • README (follow-up): I recommend adding a short README in the package root with install instructions and the example snippet. If desired I can add that in a follow-up patch or on request.

Follow-ups / roadmap

After merging this MVP, suggested follow-ups:

  1. Expand streaming behavior to support partial token events (configurable).
  2. Add richer context mapping (support for message roles, system messages).
  3. Add optional support for ADK tools metadata mapping (to surface tool results back into LiveKit).
  4. Add tests and CI coverage for the plugin.
  5. Add packaging metadata and publish instructions (if the maintainers want to publish the plugin to PyPI or LiveKit’s package index).

Checklist


Suggested commit / PR title

feat(plugins): add livekit-plugins-google-adk (initial ADK adapter)


Reviewers / reviewers’ notes

  • Suggested reviewers: maintainers who reviewed or authored livekit-plugins-langchain or other plugin adapters, since this mirrors that architecture.

  • Notes for reviewers:

    • Focus on the LLM / LLMStream surface conformance and event-to-stream translation.
    • Design intentionally mirrors LangChain adapter to minimize surprises and UX differences.
    • This PR is a minimal text-only MVP — scope is intentionally limited for reviewability.

Add livekit-plugins-google-adk, a new plugin that adapts Google's Agent
Development Kit (ADK) Runner into the LiveKit llm.LLM interface. This
follows the same framework-level integration pattern as the existing
LangChain plugin, letting users combine ADK agent orchestration with
LiveKit's realtime voice transport.
@CLAassistant
Copy link

CLAassistant commented Mar 15, 2026

CLA assistant check
All committers have signed the CLA.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

… instructions when no user message is present.
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.

Feature request: Google ADK integration plugin similar to LangChain

2 participants