Skip to content

Add livekit-plugins-google-adk for Google ADK integration#4872

Open
Speediing wants to merge 5 commits intomainfrom
jasonwiker/google-adk-plugin
Open

Add livekit-plugins-google-adk for Google ADK integration#4872
Speediing wants to merge 5 commits intomainfrom
jasonwiker/google-adk-plugin

Conversation

@Speediing
Copy link

Summary

  • Adds livekit-plugins-google-adk plugin that wraps Google ADK agents as LiveKit LLM plugins
  • LLMAdapter wraps any ADK BaseAgent/LlmAgent so it can be used in LiveKit voice pipelines — ADK handles tool calling and multi-agent orchestration internally, LiveKit manages voice orchestration (turns, interruptions, STT/TTS)
  • Fixes a bug where the adapter called ChatContext.messages() (non-existent) — now correctly uses ChatContext.items with ChatMessage filtering
  • 39 unit tests covering responses, streaming, error handling, session management, edge cases
  • E2E test script (tests/e2e_google_adk.py) for manual verification against real Gemini API
  • Example voice agent (examples/voice_agents/google_adk_agent.py)

Test plan

  • 39/39 unit tests passing (uv run pytest tests/test_google_adk.py -v)
  • E2E smoke test passing with real Gemini API
  • E2E tool calling test passing (ADK invokes tools through the adapter)
  • E2E session reuse test passing (memory persists across turns)

🤖 Generated with Claude Code

Wraps Google Agent Development Kit (ADK) agents as LiveKit LLM plugins,
enabling ADK-based agents to be used in LiveKit voice pipelines. ADK
handles tool calling and multi-agent orchestration internally while
LiveKit manages voice orchestration (turns, interruptions, STT/TTS).

- LLMAdapter wraps any ADK BaseAgent/LlmAgent as a LiveKit llm.LLM
- ADKStream implements LLMStream delegating to ADK Runner
- Session caching across conversation turns
- Fix: use ChatContext.items instead of non-existent .messages() method
- 39 unit tests covering all edge cases and error paths
- E2E test script for manual verification with real Gemini API
- Example voice agent demonstrating the integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLAassistant commented Feb 17, 2026

CLA assistant check
All committers have signed the CLA.

@chenghao-mou chenghao-mou requested a review from a team February 17, 2026 04:12
@Speediing Speediing marked this pull request as draft February 17, 2026 04:12
devin-ai-integration[bot]

This comment was marked as resolved.

Speediing and others added 4 commits February 16, 2026 21:28
- Fall back to developer/system message when no user message exists
  in chat context (fixes generate_reply(instructions=...) crash)
- Use gemini-2.0-flash in example for broader API key compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add has_emitted_partials flag to skip emitting final response text
when partial streaming events have already been sent, preventing
duplicate output. Usage metadata is still emitted regardless.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Format tests/e2e_google_adk.py with ruff
- Add py.typed marker for mypy package discovery
- Add type: ignore for untyped InMemorySessionService call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Speediing Speediing marked this pull request as ready for review February 17, 2026 04:48
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments. I would just keep this as part of the Google plugin, rather than creating a new one for ADK.. it could just be:

livekit.plugins.google.adk.LLMAdapter

return chunks


async def collect_text_chunks(stream) -> list[str]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a new function: LLMStream.collect

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add this to the list in makefile: make unit-tests?

self,
agent: LlmAgent | BaseAgent,
*,
runner: Runner | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: slight preference for NotGivenOr[Runner] = NOT_GIVEN as a pattern, to allow future use to distinguish between "not set" vs "do not use"

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.

3 participants