
google adk elevenlabs
一个基于 Google ADK 的多智能体系统,集成 Reddit 和 ElevenLabs TTS。
Repository Info
About This Server
一个基于 Google ADK 的多智能体系统,集成 Reddit 和 ElevenLabs TTS。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Google ADK Agent Setup
This document outlines the setup process and benefits observed from the provided Google ADK agent codebase, which includes a Coordinator agent managing three sub-agents: Async Reddit Scout, Summarizer, and Speaker.
Setup Process
-
Project Structure: The project is organized into separate directories for each agent (
async_reddit_scout,coordinator,speaker,summarizer), promoting modularity. Each directory contains an__init__.pyandagent.py. -
Dependencies:
- Python Packages: Ensure Python is installed. Install necessary packages using pip:
pip install google-adk python-dotenv lite_llm uvx elevenlabs-mcp git+https://github.com/adhikasp/mcp-reddit.git#egg=mcp-reddit # Or install from requirements.txt if provided # pip install -r requirements.txtgoogle-adk: The core framework for building agents.python-dotenv: To load environment variables from a.envfile.lite_llm: Used as a wrapper/interface for the underlying LLMs (Gemini models).uvx: A tool likely used for managing and running external Python applications or MCP servers in isolated environments. It's used here to run themcp-redditandelevenlabs-mcpservers.elevenlabs-mcp: The MCP server package for ElevenLabs TTS.mcp-reddit: The MCP server package for Reddit interaction (installed via git).
- External Tools:
uvxneeds to be installed and accessible in the system's PATH.
- Python Packages: Ensure Python is installed. Install necessary packages using pip:
-
Environment Variables:
- Create a
.envfile in the project root directory (alongside the agent directories). - Add the following required API keys:
GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY_HERE ELEVENLABS_API_KEY=YOUR_ELEVENLABS_API_KEY_HERE - The code uses
dotenvto load these variables.
- Create a
-
MCP Server Integration:
- Reddit Scout: Connects to the
mcp-redditserver usinguvx. Theasync_reddit_scout/agent.pyscript attempts to start this server viauvx --from git+https://github.com/adhikasp/mcp-reddit.git mcp-reddit. It expects a tool namedfetch_reddit_hot_threads. - Speaker: Connects to the
elevenlabs-mcpserver usinguvx. Thespeaker/agent.pyscript attempts to start this server viauvx elevenlabs-mcp, passing theELEVENLABS_API_KEYas an environment variable to the MCP process. It expects a TTS tool (likely namedtext_to_speech). - Error Handling: Both agents include basic error handling if
uvxis not found or if the connection to the MCP server fails.
- Reddit Scout: Connects to the
-
Agent Configuration:
- Models: Different agents utilize specific Google Gemini models (
gemini-1.5-flash-latest,gemini-1.5-pro-latest) viaLiteLlm. - Instructions: Each agent has specific instructions defining its role, how to use its tools (if any), and how to interact with other agents (in the case of the coordinator).
- Tools: Agents are configured with tools discovered from their respective MCP servers.
- Sub-Agents: The
coordinatoragent is configured with the other three agents (reddit_agent,summarizer_agent,speaker_agent) as sub-agents.
- Models: Different agents utilize specific Google Gemini models (
-
Asynchronous Handling:
- The
async_reddit_scoutandspeakeragents are asynchronous (async def create_agent()), likely due to the asynchronous nature of connecting to and interacting with MCP servers viauvx. - The
coordinatorusesAsyncExitStackto manage the lifecycles (startup/shutdown) of the asynchronous sub-agents and their MCP connections.
- The
-
Running the Agent: The entry point would typically involve importing and running the
coordinator.root_agent. (Specific run command/script not provided, but this is the standard ADK pattern).
Benefits of this Architecture
- Modularity: Each agent has a distinct responsibility (fetching, summarizing, speaking), making the codebase easier to understand, maintain, and test.
- Extensibility: Leverages the Model Context Protocol (MCP) to integrate external services (Reddit, ElevenLabs TTS) via dedicated tools (
mcp-reddit,elevenlabs-mcp). This allows adding new capabilities without modifying the core agent logic significantly, simply by adding new MCP tools/servers. - Coordination & Delegation: The
coordinatoragent acts as a central orchestrator, intelligently delegating tasks to the appropriate sub-agent based on the user's request. This follows the principle of separation of concerns. - Abstraction: The use of MCP tools abstracts the complexities of interacting with external APIs (Reddit API, ElevenLabs API). The agents only need to know the tool's interface (name, parameters).
- Asynchronous Operations: Efficiently handles potentially long-running I/O operations (like network requests to MCP servers or external APIs) using
asyncio, preventing the application from blocking.AsyncExitStackensures proper resource management for these async components. - Tool Management:
MCPToolset.from_serverdynamically discovers tools provided by the MCP servers, making the agent adaptable if the server's tools change. - Environment Isolation (via uvx): Using
uvxlikely helps manage dependencies for the MCP servers separately from the main agent application, preventing conflicts. - Clear Instructions: Each agent has well-defined instructions, guiding the LLM on its specific role and how to interact with tools and other agents.
Run using - adk web
Developed using Python 3.10
LiteLLM is a Python library and proxy server that simplifies the integration of various Large Language Model (LLM) APIs,allowing developers to interact with hundreds of LLMs using a consistent OpenAI-compatible API format
Quick Start
Clone the repository
git clone https://github.com/dushyant4342/google-adk-elevenlabsInstall dependencies
cd google-adk-elevenlabs
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.