Compare commits

..

13 Commits

Author SHA1 Message Date
Anubhav Dhawan
87929e662f doc: Update ADK agent deployment guide with updated ADK package install command 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
843d22caae doc: Simplify bigquery quickstart with updated ADK install command for Python 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
c3df3c45a2 doc: Simplify ADK installation steps in local quickstart 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
06aafeb05f doc: Add toolbox-adk as a dependency to the ADK deployment guide 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
735a0d0bfc chore: Simplify adk installation in colab quickstart 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
33a3eae316 chore: Update adk dependency for toolbox 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
5c0bcf0a5e chore: Update toolbox-adk dependency to pick the latest version 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
c1edef9e5c fix: Update toolbox-adk package version to fix quickstart tests 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
0a21809c2a docs: simplify ToolboxToolset initialization by removing toolset_name 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
65aa4598cf docs: Remove toolset_name parameter from ToolboxToolset instantiation in BigQuery quickstart. 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
103b381f69 docs: wrap python sample in async main for correct session creation 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
3a0b3f6fae fix: Adjusted ToolboxToolset import path. 2026-01-27 14:44:26 +05:30
Anubhav Dhawan
4f03a1e940 docs: migrate to toolbox-adk and simplified ToolboxToolset 2026-01-27 14:44:26 +05:30
20 changed files with 80 additions and 154 deletions

View File

@@ -23,13 +23,6 @@ To connect to the database to explore and query data, search the MCP store for t
In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt alloydb-postgres-admin```.
You'll now be able to see all enabled tools in the "Tools" tab.
> [!NOTE]
@@ -69,7 +62,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"alloydb-admin": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "alloydb-postgres-admin", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "alloydb-postgres-admin", "--stdio"]
}
}
}

View File

@@ -27,12 +27,6 @@ For AlloyDB infrastructure management, search the MCP store for the AlloyDB for
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt alloydb-postgres```.
2. Add the required inputs for your [cluster](https://docs.cloud.google.com/alloydb/docs/cluster-list) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -89,7 +83,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"alloydb-postgres": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "alloydb-postgres", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "alloydb-postgres", "--stdio"]
}
}
}

View File

@@ -21,12 +21,6 @@ An editor configured to use the BigQuery MCP server can use its AI capabilities
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt bigquery```.
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -84,7 +78,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"bigquery": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "bigquery", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "bigquery", "--stdio"]
}
}
}

View File

@@ -23,13 +23,6 @@ To connect to the database to explore and query data, search the MCP store for t
In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mssql-admin```.
You'll now be able to see all enabled tools in the "Tools" tab.
> [!NOTE]
@@ -66,7 +59,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-sqlserver-admin": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mssql-admin", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mssql-admin", "--stdio"]
}
}
}

View File

@@ -24,12 +24,6 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mssql```.
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/sqlserver/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -76,7 +70,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-mssql": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mssql", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mssql", "--stdio"],
"env": {
"CLOUD_SQL_MSSQL_PROJECT": "your-project-id",
"CLOUD_SQL_MSSQL_REGION": "your-region",

View File

@@ -23,13 +23,6 @@ To connect to the database to explore and query data, search the MCP store for t
In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mysql-admin```.
You'll now be able to see all enabled tools in the "Tools" tab.
> [!NOTE]
@@ -65,7 +58,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-mysql-admin": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mysql-admin", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mysql-admin", "--stdio"]
}
}
}

View File

@@ -26,12 +26,6 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mysql```.
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/mysql/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -82,7 +76,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-mysql": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mysql", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mysql", "--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "your-project-id",
"CLOUD_SQL_MYSQL_REGION": "your-region",

View File

@@ -23,13 +23,6 @@ To connect to the database to explore and query data, search the MCP store for t
In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-postgres-admin```.
You'll now be able to see all enabled tools in the "Tools" tab.
> [!NOTE]
@@ -65,7 +58,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-postgres-admin": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-postgres-admin", "--stdio"]
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-postgres-admin", "--stdio"]
}
}
}

View File

@@ -26,12 +26,6 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-postgres```.
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/postgres/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -94,7 +88,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"cloud-sql-postgres": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-postgres", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-postgres", "--stdio"],
"env": {
"CLOUD_SQL_POSTGRES_PROJECT": "your-project-id",
"CLOUD_SQL_POSTGRES_REGION": "your-region",

View File

@@ -20,12 +20,6 @@ An editor configured to use the Dataplex MCP server can use its AI capabilities
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt dataplex```.
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -66,7 +60,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"dataplex": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "dataplex", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "dataplex", "--stdio"],
"env": {
"DATAPLEX_PROJECT": "your-project-id"
}

View File

@@ -21,12 +21,6 @@ An editor configured to use the Looker MCP server can use its AI capabilities to
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt looker```.
2. Add the required inputs for your [instance](https://docs.cloud.google.com/looker/docs/set-up-and-administer-looker) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -82,7 +76,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"looker": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "looker", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "looker", "--stdio"],
"env": {
"LOOKER_BASE_URL": "https://your.looker.instance.com",
"LOOKER_CLIENT_ID": "your-client-id",

View File

@@ -21,12 +21,6 @@ An editor configured to use the Cloud Spanner MCP server can use its AI capabili
## Install & Configuration
1. In the Antigravity MCP Store, click the "Install" button.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version> --prebuilt spanner```.
2. Add the required inputs for your [instance](https://docs.cloud.google.com/spanner/docs/instances) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
@@ -72,7 +66,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
"mcpServers": {
"spanner": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "spanner", "--stdio"],
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "spanner", "--stdio"],
"env": {
"SPANNER_PROJECT": "your-project-id",
"SPANNER_INSTANCE": "your-instance-id",

View File

@@ -12,16 +12,10 @@ The MCP Toolbox for Databases Server gives AI-powered development tools the abil
## Install & Configuration
1. In the Antigravity MCP Store, click the **Install** button. A configuration window will appear.
> [!NOTE]
> Installation automatically uses the latest
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
> This keeps you up-to-date, but if you need a specific version, you can
> run the server manually with command
> ```npx -y @toolbox-sdk/server@<version>```.
3. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
2. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
4. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
3. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
> [!NOTE]
> If you encounter issues with Windows Defender blocking the execution, you may need to configure an allowlist. See [Configure exclusions for Microsoft Defender Antivirus](https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-exclusions-microsoft-defender-antivirus?view=o365-worldwide) for more details.
@@ -37,7 +31,7 @@ Interact with your custom tools using natural language.
"mcpServers": {
"mcp-toolbox": {
"command": "npx",
"args": ["-y", "@toolbox-sdk/server@latest", "--tools-file", "your-tool-file.yaml"],
"args": ["-y", "@toolbox-sdk/server", "--tools-file", "your-tool-file.yaml"],
"env": {
"ENV_VAR_NAME": "ENV_VAR_VALUE",
}

View File

@@ -509,8 +509,7 @@
},
"outputs": [],
"source": [
"! pip install toolbox-core --quiet\n",
"! pip install google-adk --quiet"
"! pip install google-adk[toolbox] --quiet"
]
},
{
@@ -525,14 +524,18 @@
"from google.adk.runners import Runner\n",
"from google.adk.sessions import InMemorySessionService\n",
"from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService\n",
"from google.adk.tools.toolbox_toolset import ToolboxToolset\n",
"from google.genai import types\n",
"from toolbox_core import ToolboxSyncClient\n",
"\n",
"import os\n",
"# TODO(developer): replace this with your Google API key\n",
"os.environ['GOOGLE_API_KEY'] = \"<GOOGLE_API_KEY>\"\n",
"\n",
"toolbox_client = ToolboxSyncClient(\"http://127.0.0.1:5000\")\n",
"# Configure toolset\n",
"toolset = ToolboxToolset(\n",
" server_url=\"http://127.0.0.1:5000\",\n",
" toolset_name=\"my-toolset\"\n",
")\n",
"\n",
"prompt = \"\"\"\n",
" You're a helpful hotel assistant. You handle hotel searching, booking and\n",
@@ -549,7 +552,7 @@
" name='hotel_agent',\n",
" description='A helpful AI assistant.',\n",
" instruction=prompt,\n",
" tools=toolbox_client.load_toolset(\"my-toolset\"),\n",
" tools=[toolset],\n",
")\n",
"\n",
"session_service = InMemorySessionService()\n",

View File

@@ -52,7 +52,7 @@ runtime](https://research.google.com/colaboratory/local-runtimes.html).
{{< tabpane persist=header >}}
{{< tab header="ADK" lang="bash" >}}
pip install toolbox-core
pip install google-adk[toolbox]
{{< /tab >}}
{{< tab header="Langchain" lang="bash" >}}
@@ -73,7 +73,7 @@ pip install toolbox-core
{{< tabpane persist=header >}}
{{< tab header="ADK" lang="bash" >}}
pip install google-adk
# No other dependencies required for ADK
{{< /tab >}}
{{< tab header="Langchain" lang="bash" >}}

View File

@@ -1,15 +1,17 @@
from google.adk import Agent
from google.adk.apps import App
from toolbox_core import ToolboxSyncClient
from google.adk.tools.toolbox_toolset import ToolboxToolset
# TODO(developer): update the TOOLBOX_URL to your toolbox endpoint
client = ToolboxSyncClient("http://127.0.0.1:5000")
toolset = ToolboxToolset(
server_url="http://127.0.0.1:5000",
)
root_agent = Agent(
name='root_agent',
model='gemini-2.5-flash',
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
tools=client.load_toolset(),
tools=[toolset],
)
app = App(root_agent=root_agent, name="my_agent")

View File

@@ -1,3 +1,2 @@
google-adk==1.21.0
toolbox-core==0.5.4
google-adk[toolbox]==1.23.0
pytest==9.0.2

View File

@@ -46,10 +46,10 @@ with the necessary configuration for deployment to Vertex AI Agent Engine.
process will generate deployment configuration files (like a `Makefile` and
`Dockerfile`) in your project directory.
4. Add `toolbox-core` as a dependency to the new project:
4. Add `google-adk[toolbox]` as a dependency to the new project:
```bash
uv add toolbox-core
uv add google-adk[toolbox]
```
## Step 3: Configure Google Cloud Authentication
@@ -95,22 +95,23 @@ authentication token.
```python
from google.adk import Agent
from google.adk.apps import App
from toolbox_core import ToolboxSyncClient, auth_methods
from google.adk.tools.toolbox_toolset import ToolboxToolset
from toolbox_adk import CredentialStrategy
# TODO(developer): Replace with your Toolbox Cloud Run Service URL
TOOLBOX_URL = "https://your-toolbox-service-xyz.a.run.app"
# Initialize the client with the Cloud Run URL and Auth headers
client = ToolboxSyncClient(
TOOLBOX_URL,
client_headers={"Authorization": auth_methods.get_google_id_token(TOOLBOX_URL)}
# Initialize the toolset with Workload Identity (generates ID token for the URL)
toolset = ToolboxToolset(
server_url=TOOLBOX_URL,
credentials=CredentialStrategy.workload_identity(target_audience=TOOLBOX_URL)
)
root_agent = Agent(
name='root_agent',
model='gemini-2.5-flash',
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
tools=client.load_toolset(),
tools=[toolset],
)
app = App(root_agent=root_agent, name="my_agent")

View File

@@ -27,7 +27,7 @@ description: >
| | `--ui` | Launches the Toolbox UI web server. | |
| | `--allowed-origins` | Specifies a list of origins permitted to access this server for CORs access. | `*` |
| | `--allowed-hosts` | Specifies a list of hosts permitted to access this server to prevent DNS rebinding attacks. | `*` |
| | `--user-agent-metadata` | Appends additional metadata to the User-Agent. | |
| | `--user-agent-extra` | Appends additional metadata to the User-Agent. | |
| `-v` | `--version` | version for toolbox | |
## Examples

View File

@@ -325,7 +325,7 @@ pip install toolbox-llamaindex
{{< /tab >}}
{{< tab header="ADK" lang="bash" >}}
pip install google-adk
pip install google-adk[toolbox]
{{< /tab >}}
{{< /tabpane >}}
@@ -365,7 +365,7 @@ pip install llama-index-llms-google-genai
{{< /tab >}}
{{< tab header="ADK" lang="bash" >}}
pip install toolbox-core
# No other dependencies required for ADK
{{< /tab >}}
{{< /tabpane >}}
@@ -607,8 +607,8 @@ from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService
from google.adk.tools.toolbox_toolset import ToolboxToolset
from google.genai import types # For constructing message content
from toolbox_core import ToolboxSyncClient
import os
os.environ['GOOGLE_GENAI_USE_VERTEXAI'] = 'True'
@@ -623,48 +623,47 @@ os.environ['GOOGLE_CLOUD_LOCATION'] = 'us-central1'
# --- Load Tools from Toolbox ---
# TODO(developer): Ensure the Toolbox server is running at <http://127.0.0.1:5000>
# TODO(developer): Ensure the Toolbox server is running at http://127.0.0.1:5000
toolset = ToolboxToolset(server_url="http://127.0.0.1:5000")
with ToolboxSyncClient("<http://127.0.0.1:5000>") as toolbox_client:
# TODO(developer): Replace "my-toolset" with the actual ID of your toolset as configured in your MCP Toolbox server.
agent_toolset = toolbox_client.load_toolset("my-toolset")
# --- Define the Agent's Prompt ---
prompt = """
You're a helpful hotel assistant. You handle hotel searching, booking and
cancellations. When the user searches for a hotel, mention it's name, id,
location and price tier. Always mention hotel ids while performing any
searches. This is very important for any operations. For any bookings or
cancellations, please provide the appropriate confirmation. Be sure to
update checkin or checkout dates if mentioned by the user.
Don't ask for confirmations from the user.
"""
# --- Define the Agent's Prompt ---
prompt = """
You're a helpful hotel assistant. You handle hotel searching, booking and
cancellations. When the user searches for a hotel, mention it's name, id,
location and price tier. Always mention hotel ids while performing any
searches. This is very important for any operations. For any bookings or
cancellations, please provide the appropriate confirmation. Be sure to
update checkin or checkout dates if mentioned by the user.
Don't ask for confirmations from the user.
"""
# --- Configure the Agent ---
# --- Configure the Agent ---
root_agent = Agent(
model='gemini-2.0-flash-001',
name='hotel_agent',
description='A helpful AI assistant that can search and book hotels.',
instruction=prompt,
tools=[toolset], # Pass the loaded toolset
)
root_agent = Agent(
model='gemini-2.0-flash-001',
name='hotel_agent',
description='A helpful AI assistant that can search and book hotels.',
instruction=prompt,
tools=agent_toolset, # Pass the loaded toolset
)
# --- Initialize Services for Running the Agent ---
session_service = InMemorySessionService()
artifacts_service = InMemoryArtifactService()
# --- Initialize Services for Running the Agent ---
session_service = InMemorySessionService()
artifacts_service = InMemoryArtifactService()
runner = Runner(
app_name='hotel_agent',
agent=root_agent,
artifact_service=artifacts_service,
session_service=session_service,
)
async def main():
# Create a new session for the interaction.
session = session_service.create_session(
session = await session_service.create_session(
state={}, app_name='hotel_agent', user_id='123'
)
runner = Runner(
app_name='hotel_agent',
agent=root_agent,
artifact_service=artifacts_service,
session_service=session_service,
)
# --- Define Queries and Run the Agent ---
queries = [
"Find hotels in Basel with Basel in it's name.",
@@ -687,6 +686,10 @@ with ToolboxSyncClient("<http://127.0.0.1:5000>") as toolbox_client:
for text in responses:
print(text)
import asyncio
if __name__ == "__main__":
asyncio.run(main())
{{< /tab >}}
{{< /tabpane >}}