Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,5 @@ docs/site
# Compiled Go example binaries (accidentally committed build artifacts)
/examples/go/index
/examples/go/main

# Playwright MCP.playwright-mcp/
2 changes: 1 addition & 1 deletion docs/a2a/quickstart-consuming.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ prime_agent = RemoteA2aAgent(
Then, you can simply use the `RemoteA2aAgent` in your agent. In this case, `prime_agent` is used as one of the sub-agents in the `root_agent` below:

```python title="a2a_basic/agent.py"
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.genai import types

root_agent = Agent(
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/llm-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ import asyncio
import os

from google.genai import types
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService # Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/models/google-gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ snippet:
=== "Python"

```python
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.models.google_llm import Gemini
from google.adk.tools.google_search_tool import GoogleSearchTool

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sample code:
=== "Python"

```python title="agent.py"
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.apps import App

root_agent = Agent(
Expand Down
2 changes: 1 addition & 1 deletion docs/artifacts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ artifact in a later turn.
=== "Python"

```python
from google.adk.tools.tool_context import ToolContext
from google.adk.tools import ToolContext

def list_user_files_py(tool_context: ToolContext) -> str:
"""Tool to list available artifacts for the user."""
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use. Update the generated `agent.py` code to include a `get_current_time` tool
for use by the agent, as shown in the following code:

```python
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent

# Mock tool implementation
def get_current_time(city: str) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/a2ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ instruction = schema_manager.generate_system_prompt(
Use the generated instruction as the agent's system prompt:

```python
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent

agent = LlmAgent(
model="gemini-flash-latest",
Expand Down
4 changes: 2 additions & 2 deletions docs/integrations/adk-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ messaging channels.
```python
import os
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from adk_connectors.telegram import TelegramConnector

# Load environment variables
Expand Down Expand Up @@ -108,7 +108,7 @@ messaging channels.
```python
import os
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from adk_connectors.discord import DiscordConnector

# Load environment variables
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/agent-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The primary way to use the Agent Registry integration within an ADK agent is to
dynamically fetch remote agents or toolsets using the AgentRegistry client.

```py
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.integrations.agent_registry import AgentRegistry
import os

Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/api-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ API Registry. This agent is designed to interact with BigQuery:

```python
import os
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.tools.api_registry import ApiRegistry

# Configure with your Google Cloud Project ID and registered MCP server name
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/apigee-api-hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ you only need to follow a subset of these steps.
definition:

```py
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from .tools import sample_toolset

root_agent = LlmAgent(
Expand Down
4 changes: 2 additions & 2 deletions docs/integrations/application-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ To create an Application Integration Toolset for Integration Connectors, follow
2. Update the `agent.py` file and add tool to your agent:

```py
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from .tools import connector_tool

root_agent = LlmAgent(
Expand Down Expand Up @@ -329,7 +329,7 @@ workflow as a tool for your agent or create a new one.
To update the `agent.py` file and add the tool to your agent, use the following code:

```py
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from .tools import integration_tool, connector_tool

root_agent = LlmAgent(
Expand Down
4 changes: 2 additions & 2 deletions docs/integrations/code-exec-agent-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To use the Code Execution tool with your ADK agent:
resource name you created.

```python
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.code_executors.agent_engine_sandbox_code_executor import AgentEngineSandboxCodeExecutor

root_agent = Agent(
Expand Down Expand Up @@ -158,7 +158,7 @@ the operating guidelines for code execution. This instruction clause is
optional, but strongly recommended for getting the best results from this tool.

```python
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.code_executors.agent_engine_sandbox_code_executor import AgentEngineSandboxCodeExecutor

def base_system_instruction():
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/gcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ storage toolset with write access enabled.

```python
import google.auth
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.integrations.gcs import GCSToolset
from google.adk.integrations.gcs.settings import GCSToolSettings, Capabilities
from google.adk.integrations.gcs.gcs_credentials import GCSCredentialsConfig
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/synap.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ demand.
```python
import os

from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from maximem_synap import MaximemSynapSDK
from synap_google_adk import create_synap_tools

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ a simple ADK agent.
```py
from google.adk.runners import InMemoryRunner
from google.adk import Agent
from google.adk.tools.tool_context import ToolContext
from google.adk.tools import ToolContext
from google.genai import types
import asyncio

Expand Down
2 changes: 1 addition & 1 deletion docs/streaming/streaming-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Now let's define an agent that can monitor stock price changes and monitor the v
from typing import AsyncGenerator

from google.adk.agents import LiveRequestQueue
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.tools.function_tool import FunctionTool
from google.genai import Client
from google.genai import types as genai_types
Expand Down
4 changes: 2 additions & 2 deletions docs/tools-custom/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Pass the scheme and credential during toolset initialization. The toolset applie
auth_scheme = OpenIdConnectWithConfig(
authorization_endpoint=OAUTH2_AUTH_ENDPOINT_URL,
token_endpoint=OAUTH2_TOKEN_ENDPOINT_URL,
scopes=['openid', 'YOUR_OAUTH_SCOPES"]
scopes=['openid', 'YOUR_OAUTH_SCOPES']
)
auth_credential = AuthCredential(
auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,
Expand Down Expand Up @@ -296,7 +296,7 @@ client_secret = "YOUR_GOOGLE_OAUTH_CLIENT_SECRET"

# Use the specific configure method for this toolset type
calendar_tool_set.configure_auth(
client_id=oauth_client_id, client_secret=oauth_client_secret
client_id=client_id, client_secret=client_secret
)

# agent = LlmAgent(..., tools=calendar_tool_set.get_tool('calendar_tool_set'))
Expand Down
6 changes: 3 additions & 3 deletions docs/tools-custom/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Modify your `agent.py` file (e.g., in `./adk_agent_samples/mcp_agent/agent.py`).
```python
# ./adk_agent_samples/mcp_agent/agent.py
import os
from google.adk.agents.llm_agent import Agent
from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

Expand Down Expand Up @@ -762,7 +762,7 @@ import os
import asyncio
from dotenv import load_dotenv
from google.genai import types
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService # Optional
Expand Down Expand Up @@ -861,7 +861,7 @@ When deploying ADK agents that use MCP tools to production environments like Clo
```python
# ✅ CORRECT: Synchronous agent definition for deployment
import os
from google.adk.agents.llm_agent import LlmAgent
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/agent-team.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ Now, we create a new version of the weather tool. Its key feature is accepting `


```python
from google.adk.tools.tool_context import ToolContext
from google.adk.tools import ToolContext

def get_weather_stateful(city: str, tool_context: ToolContext) -> dict:
"""Retrieves weather, converts temp unit based on session state."""
Expand Down Expand Up @@ -1615,7 +1615,7 @@ This function targets the `get_weather_stateful` tool. It checks the `city` argu

# Ensure necessary imports are available
from google.adk.tools.base_tool import BaseTool
from google.adk.tools.tool_context import ToolContext
from google.adk.tools import ToolContext
from typing import Optional, Dict, Any # For type hints

def block_paris_tool_guardrail(
Expand Down