-
Notifications
You must be signed in to change notification settings - Fork 143
docs: add google adk integration #2129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,102 @@ | ||||||
| --- | ||||||
| title: 🇬 Google ADK integration | ||||||
| sidebar_label: Google ADK | ||||||
| description: Learn how to integrate Apify Actors as tools for AI with 🇬 Google ADK. | ||||||
| sidebar_position: 2 | ||||||
| slug: /integrations/google-adk | ||||||
| --- | ||||||
|
|
||||||
| **Learn how to integrate Apify Actors as tools for AI with Google ADK.** | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## What is Google ADK | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| [Google Agent Development Kit (ADK)](https://github.com/google/adk-python) is a flexible and modular framework for developing and deploying AI agents. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| :::note Explore Google ADK | ||||||
|
|
||||||
| For more in-depth details, check out [Google ADK documentation](https://google.github.io/adk-docs/). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ::: | ||||||
|
|
||||||
| ## How to use Apify with Google ADK | ||||||
|
|
||||||
| Apify is a marketplace of ready-to-use web scraping and automation tools, AI agents, and MCP servers that you can equip your own AI with. This guide demonstrates how to use Apify tools with a simple AI agent built with Google ADK. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| ### Prerequisites | ||||||
|
|
||||||
| - _Apify API token_: To use Apify Actors in Google ADK, you need an Apify API token. To obtain your token check [Apify documentation](https://docs.apify.com/platform/integrations/api). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - _Python packages_: Install the following Python packages: | ||||||
|
|
||||||
| ```bash | ||||||
| pip install google-adk | ||||||
| ``` | ||||||
|
|
||||||
| ### Building a simple pub search AI agent using Apify Google Maps scraper | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| First, create an agent project: | ||||||
|
|
||||||
| ```bash | ||||||
| adk create pub_search_agent | ||||||
| ``` | ||||||
|
|
||||||
| Create and configure the agent to use the Apify MCP server tools: | ||||||
|
|
||||||
| :::warning Required setup | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Make sure to set the `APIFY_TOKEN` environment variable in the `.env` file with your Apify API token before running the code. | ||||||
|
|
||||||
| ::: | ||||||
|
|
||||||
| ```python | ||||||
| from google.adk.agents import Agent | ||||||
| from google.adk.tools.mcp_tool import McpToolset | ||||||
| from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPServerParams | ||||||
| import os | ||||||
|
|
||||||
| root_agent = Agent( | ||||||
| model="gemini-2.5-flash", | ||||||
| name="pub_search_agent", | ||||||
| instruction="You are a pub search agent that helps users find a great pub to visit based on their preferences. Use Apify tools to accomplish this.", | ||||||
| tools=[ | ||||||
| McpToolset( | ||||||
| connection_params=StreamableHTTPServerParams( | ||||||
| # Configure Apify MCP Server URL with desired tools | ||||||
| url="https://mcp.apify.com?tools=compass/crawler-google-places", | ||||||
| headers={ | ||||||
| "Authorization": f"Bearer {os.getenv('APIFY_TOKEN')}", | ||||||
| }, | ||||||
| ), | ||||||
| ) | ||||||
| ], | ||||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
| Run the agent via the web interface: | ||||||
|
|
||||||
| ```bash | ||||||
| adk web | ||||||
| ``` | ||||||
|
|
||||||
| Or run the agent via command-line interface: | ||||||
|
|
||||||
| ```bash | ||||||
| adk run pub_search_agent | ||||||
| ``` | ||||||
|
|
||||||
| Prompt the agent to find a pub in San Francisco: | ||||||
|
|
||||||
| ```text | ||||||
| Find a pub near the Ferry Building in San Francisco. | ||||||
| ``` | ||||||
|
|
||||||
| ## Resources | ||||||
|
|
||||||
| - [Apify Actors](https://docs.apify.com/platform/actors) | ||||||
| - [Google ADK documentation](https://google.github.io/adk-docs/get-started/) | ||||||
| - [What are AI agents?](https://blog.apify.com/what-are-ai-agents/) | ||||||
| - [Apify MCP Server](https://mcp.apify.com) | ||||||
| - [Apify MCP Server documentation](https://docs.apify.com/platform/integrations/mcp) | ||||||
| - [Apify OpenRouter proxy](https://apify.com/apify/openrouter) | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.