From 7600fc998080c51c8b65b1515013b2414e318943 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 17:52:34 +0530 Subject: [PATCH 1/9] Update google-cloud-tools.md Added Python ADK instructions in the Application Integration Tools section. --- docs/tools/google-cloud-tools.md | 173 ++++++++++++++++++++++++++++--- 1 file changed, 159 insertions(+), 14 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index 3363177e4..30a880e6b 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -142,21 +142,23 @@ It supports both on-premise and SaaS applications. In addition, you can turn you ### Prerequisites -1. [Install ADK](../get-started/installation.md). -2. Use an existing + +=== "Java" +* [Install ADK](../get-started/installation.md). +* Use an existing [Application Integration](https://cloud.google.com/application-integration/docs/overview) workflow or [Integrations Connector](https://cloud.google.com/integration-connectors/docs/overview) connection you want to use with your agent. -3. To use tool with default credentials, install the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install#installation_instructions) and run the following commands: - +* To use tool with default credentials, install the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install#installation_instructions) and run the following commands: + ```shell gcloud config set project gcloud auth application-default login gcloud auth application-default set-quota-project ``` - -4. Set up your project structure and create required files. + +* Set up your project structure and create required files. ```console project_root_folder |-- .env @@ -166,15 +168,47 @@ It supports both on-premise and SaaS applications. In addition, you can turn you `__ tools.py ``` When running the agent, make sure to run `adk web` in the `project\_root\_folder`. + +* To get the permissions that you need to set up **ApplicationIntegrationToolset**, you must have the following IAM roles on the project (common to both Integration Connectors and Application Integration Workflows): -5. To get the permissions that you need to set up **ApplicationIntegrationToolset**, you must have the following IAM roles on the project (common to both Integration Connectors and Application Integration Workflows): - - `roles/integration.editor` - `roles/connectors.user` - `roles/secretmanager.secretAccessor` - + > **Note:** For Agent Engine (AE), don't use `roles/integration.invoker`, as it can result in 403 errors. Use `roles/integration.editor` instead. +=== "Python" +* You must have the Google Cloud CLI installed. For more information, see the [installation + guide](https://cloud.google.com/sdk/docs/install#installation_instructions). + +* Run the following commands: + + ```bash + gcloud config set project + gcloud auth application-default login + gcloud auth application-default set-quota-project + ``` + +* To use a Connector from Integration Connectors, you need to provision + Application Integration in the same region as your connection. +* Import and publish the [Connection + Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1){:target="_blank"} + from the template library. +* Follow the [Agent Development Kit + Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug){:target="_blank"} + and use the [latest version of adk](https://github.com/google/adk-python). + +* The project structure should be as follows: + + ``` + project_root_folder/ + └── my_agent/ + ├── agent.java + └── pom.xml + ``` +* When running the agent, make sure you are in the `project_root_f` directory. + + ### Use Integration Connectors Connect your agent to enterprise applications using @@ -190,16 +224,16 @@ Connect your agent to enterprise applications using -3. Go to the [Connection Tool](https://console.cloud.google.com/integrations/templates/connection-tool/locations/us-central1) +2. Go to the [Connection Tool](https://console.cloud.google.com/integrations/templates/connection-tool/locations/us-central1) template in the template library and click **USE TEMPLATE**. ![Google Cloud Tools](../assets/use-connection-tool-template.png) -4. Enter the Integration Name as *ExecuteConnection* (it is mandatory to use this exact integration name only). +3. Enter the Integration Name as *ExecuteConnection* (it is mandatory to use this exact integration name only). Then, select the region to match your connection region and click **CREATE**. -5. Click **PUBLISH** to publish the integration in the Application Integration editor. +4. Click **PUBLISH** to publish the integration in the Application Integration editor. ![Google Cloud Tools](../assets/publish-integration.png) @@ -208,6 +242,8 @@ Connect your agent to enterprise applications using #### Create an Application Integration Toolset +Application Integration Toolset supports `auth_scheme` and `auth_credential` for **dynamic OAuth2 authentication** for Integration Connectors. + To create an Application Integration Toolset for Integration Connectors, follow these steps: 1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: @@ -315,7 +351,7 @@ After completing the above steps, go to [http://localhost:8000](http://localhost `my\_agent` agent (which is the same as the agent folder name). -### Use App Integration Workflows +### Use Application Integration Workflows Use an existing [Application Integration](https://cloud.google.com/application-integration/docs/overview) @@ -323,7 +359,116 @@ workflow as a tool for your agent or create a new one. #### Create an Application Integration Workflow Toolset -To create an Application Integration Toolset for Application Integration Workflows, follow these steps: +=== "Python" + +To create an Application Integration Toolset for Application Integration +Workflows using Python, follow these steps: + +1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: + + ```python + #tools.py + + import com.google.adk.tools.applicationintegrationtoolset.ApplicationIntegrationToolset; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; + + public class Tools { + private static ApplicationIntegrationToolset integrationTool; + private static ApplicationIntegrationToolset connectionsTool; + + static { + integrationTool = new ApplicationIntegrationToolset( + "test-project", + "us-central1", + "test-integration", + ImmutableList.of("api_trigger/test-api"), + null, + null, + null, + "{...}", + "tool_prefix1", + "..."); + + connectionsTool = new ApplicationIntegrationToolset( + "test-project", + "us-central1", + null, + null, + "test-connection", + ImmutableMap.of("Issue", ImmutableList.of("GET")), + ImmutableList.of("ExecuteCustomQuery"), + "{...}", + "tool_prefix", + "..."); + } + } + ``` + + **Note:** You can provide service account to be used instead of using + default credentials by generating [Service Account + Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and + providing right [Application Integration and Integration Connector IAM + roles](#prerequisites) to the service account. For more details about the + IAM roles, refer to the [Prerequisites](#prerequisites) section. + +2. Update the `agent.java` file and add tool to your agent: + + ```python + # agent.java + + import com.google.adk.agent.LlmAgent; + import com.google.adk.tools.BaseTool; + import com.google.common.collect.ImmutableList; + + public class MyAgent { + public static void main(String[] args) { + // Assuming Tools class is defined as in the previous step + ImmutableList tools = ImmutableList.builder() + .add(Tools.integrationTool) + .add(Tools.connectionsTool) + .build(); + + // Finally, create your agent with the tools generated automatically. + LlmAgent rootAgent = LlmAgent.builder() + .name("science-teacher") + .description("Science teacher agent") + .model("gemini-2.0-flash") + .instruction( + "Help user, leverage the tools you have access to." + ) + .tools(tools) + .build(); + + // You can now use rootAgent to interact with the LLM + // For example, you can start a conversation with the agent. + } + } + ``` + + **Note:** To find the list of supported entities and actions for a + connection, use these Connectors APIs: + * listActions, listEntityTypes + +3. Start the Google ADK Web UI and use your agent: + + ```bash + mvn install + + mvn exec:java \ + -Dexec.mainClass="com.google.adk.web.AdkWebServer" \ + -Dexec.args="--adk.agents.source-dir=src/main/java" \ + -Dexec.classpathScope="compile" + ``` + +After completing the above steps, go to +[http://localhost:8000](http://localhost:8000), and choose `my_agent` agent +(which is the same as the agent folder name). + + +=== "Java" + +To create an Application Integration Toolset for Application Integration Workflows using Java, follow these steps: 1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: From 822441bb14ff9d7e5607642d29a30c8991c0d1b4 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 18:36:02 +0530 Subject: [PATCH 2/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index 30a880e6b..4083ae0cf 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -143,7 +143,7 @@ It supports both on-premise and SaaS applications. In addition, you can turn you ### Prerequisites -=== "Java" +=== "Python" * [Install ADK](../get-started/installation.md). * Use an existing [Application Integration](https://cloud.google.com/application-integration/docs/overview) @@ -177,7 +177,7 @@ It supports both on-premise and SaaS applications. In addition, you can turn you > **Note:** For Agent Engine (AE), don't use `roles/integration.invoker`, as it can result in 403 errors. Use `roles/integration.editor` instead. -=== "Python" +=== "Java" * You must have the Google Cloud CLI installed. For more information, see the [installation guide](https://cloud.google.com/sdk/docs/install#installation_instructions). @@ -359,14 +359,14 @@ workflow as a tool for your agent or create a new one. #### Create an Application Integration Workflow Toolset -=== "Python" +=== "Java" To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: 1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: - ```python + ```java #tools.py import com.google.adk.tools.applicationintegrationtoolset.ApplicationIntegrationToolset; @@ -414,7 +414,7 @@ Workflows using Python, follow these steps: 2. Update the `agent.java` file and add tool to your agent: - ```python + ```java # agent.java import com.google.adk.agent.LlmAgent; @@ -466,7 +466,7 @@ After completing the above steps, go to (which is the same as the agent folder name). -=== "Java" +=== "Python" To create an Application Integration Toolset for Application Integration Workflows using Java, follow these steps: From 45fe4f2a0fec376139449866490a68acae44dafc Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 18:48:07 +0530 Subject: [PATCH 3/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 109 +++++++++++++++---------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index 4083ae0cf..29921d743 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -359,15 +359,66 @@ workflow as a tool for your agent or create a new one. #### Create an Application Integration Workflow Toolset +=== "Python" + +To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: + +1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: + + ```py + integration_tool = ApplicationIntegrationToolset( + project="test-project", # TODO: replace with GCP project of the connection + location="us-central1", #TODO: replace with location of the connection + integration="test-integration", #TODO: replace with integration name + triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. + service_account_json='{...}', #optional. Stringified json for service account key + tool_name_prefix="tool_prefix1", + tool_instructions="..." + ) + ``` + + **Note:** You can provide service account to be used instead of using default + credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. + +2. Update the `agent.py` file and add tool to your agent: + + ```py + from google.adk.agents.llm_agent import LlmAgent + from .tools import integration_tool, connector_tool + + root_agent = LlmAgent( + model='gemini-2.0-flash', + name='integration_agent', + instruction="Help user, leverage the tools you have access to", + tools=[integration_tool], + ) + ``` + +3. Configure \`\_\_init\_\_.py\` to expose your agent: + + ```py + from . import agent + ``` + +4. Start the Google ADK Web UI and use your agent: + + ```shell + # make sure to run `adk web` from your project_root_folder + adk web + ``` + +After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose + ` my\_agent` agent (which is the same as the agent folder name). + === "Java" To create an Application Integration Toolset for Application Integration -Workflows using Python, follow these steps: +Workflows using Java, follow these steps: -1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: +1. Create a tool with `ApplicationIntegrationToolset` in the `tools.java` file: ```java - #tools.py + #tools.java import com.google.adk.tools.applicationintegrationtoolset.ApplicationIntegrationToolset; import com.google.common.collect.ImmutableList; @@ -465,58 +516,6 @@ After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose `my_agent` agent (which is the same as the agent folder name). - -=== "Python" - -To create an Application Integration Toolset for Application Integration Workflows using Java, follow these steps: - -1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: - - ```py - integration_tool = ApplicationIntegrationToolset( - project="test-project", # TODO: replace with GCP project of the connection - location="us-central1", #TODO: replace with location of the connection - integration="test-integration", #TODO: replace with integration name - triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. - service_account_json='{...}', #optional. Stringified json for service account key - tool_name_prefix="tool_prefix1", - tool_instructions="..." - ) - ``` - - **Note:** You can provide service account to be used instead of using default - credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. - -2. Update the `agent.py` file and add tool to your agent: - - ```py - from google.adk.agents.llm_agent import LlmAgent - from .tools import integration_tool, connector_tool - - root_agent = LlmAgent( - model='gemini-2.0-flash', - name='integration_agent', - instruction="Help user, leverage the tools you have access to", - tools=[integration_tool], - ) - ``` - -3. Configure \`\_\_init\_\_.py\` to expose your agent: - - ```py - from . import agent - ``` - -4. Start the Google ADK Web UI and use your agent: - - ```shell - # make sure to run `adk web` from your project_root_folder - adk web - ``` - -After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose - ` my\_agent` agent (which is the same as the agent folder name). - --- ## Toolbox Tools for Databases From 5365980890dbb663272eeeb23815c140bd303925 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 18:59:19 +0530 Subject: [PATCH 4/9] Update google-cloud-tools.md From 647956de14a31a433049c94ffd439662771ede16 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 19:04:57 +0530 Subject: [PATCH 5/9] Update google-cloud-tools.md Edited the tags. From 870555d67ad0a4376fd0ea47079188832bd758f5 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 19:10:50 +0530 Subject: [PATCH 6/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index 29921d743..bbd96a1b9 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -192,10 +192,10 @@ It supports both on-premise and SaaS applications. In addition, you can turn you * To use a Connector from Integration Connectors, you need to provision Application Integration in the same region as your connection. * Import and publish the [Connection - Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1){:target="_blank"} + Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1) from the template library. * Follow the [Agent Development Kit - Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug){:target="_blank"} + Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug) and use the [latest version of adk](https://github.com/google/adk-python). * The project structure should be as follows: From 24b20b276b93c5104b57b5908052bf99285c0a98 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 19:17:57 +0530 Subject: [PATCH 7/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 163 +++++++++++++++---------------- 1 file changed, 81 insertions(+), 82 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index bbd96a1b9..415357e42 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -142,6 +142,36 @@ It supports both on-premise and SaaS applications. In addition, you can turn you ### Prerequisites +=== "Java" +* You must have the Google Cloud CLI installed. For more information, see the [installation + guide](https://cloud.google.com/sdk/docs/install#installation_instructions). + +* Run the following commands: + + ```bash + gcloud config set project + gcloud auth application-default login + gcloud auth application-default set-quota-project + ``` + +* To use a Connector from Integration Connectors, you need to provision + Application Integration in the same region as your connection. +* Import and publish the [Connection + Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1) + from the template library. +* Follow the [Agent Development Kit + Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug) + and use the [latest version of adk](https://github.com/google/adk-python). + +* The project structure should be as follows: + + ``` + project_root_folder/ + └── my_agent/ + ├── agent.java + └── pom.xml + ``` +* When running the agent, make sure you are in the `project_root_f` directory. === "Python" * [Install ADK](../get-started/installation.md). @@ -176,37 +206,6 @@ It supports both on-premise and SaaS applications. In addition, you can turn you - `roles/secretmanager.secretAccessor` > **Note:** For Agent Engine (AE), don't use `roles/integration.invoker`, as it can result in 403 errors. Use `roles/integration.editor` instead. - -=== "Java" -* You must have the Google Cloud CLI installed. For more information, see the [installation - guide](https://cloud.google.com/sdk/docs/install#installation_instructions). - -* Run the following commands: - - ```bash - gcloud config set project - gcloud auth application-default login - gcloud auth application-default set-quota-project - ``` - -* To use a Connector from Integration Connectors, you need to provision - Application Integration in the same region as your connection. -* Import and publish the [Connection - Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1) - from the template library. -* Follow the [Agent Development Kit - Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug) - and use the [latest version of adk](https://github.com/google/adk-python). - -* The project structure should be as follows: - - ``` - project_root_folder/ - └── my_agent/ - ├── agent.java - └── pom.xml - ``` -* When running the agent, make sure you are in the `project_root_f` directory. ### Use Integration Connectors @@ -359,57 +358,6 @@ workflow as a tool for your agent or create a new one. #### Create an Application Integration Workflow Toolset -=== "Python" - -To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: - -1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: - - ```py - integration_tool = ApplicationIntegrationToolset( - project="test-project", # TODO: replace with GCP project of the connection - location="us-central1", #TODO: replace with location of the connection - integration="test-integration", #TODO: replace with integration name - triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. - service_account_json='{...}', #optional. Stringified json for service account key - tool_name_prefix="tool_prefix1", - tool_instructions="..." - ) - ``` - - **Note:** You can provide service account to be used instead of using default - credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. - -2. Update the `agent.py` file and add tool to your agent: - - ```py - from google.adk.agents.llm_agent import LlmAgent - from .tools import integration_tool, connector_tool - - root_agent = LlmAgent( - model='gemini-2.0-flash', - name='integration_agent', - instruction="Help user, leverage the tools you have access to", - tools=[integration_tool], - ) - ``` - -3. Configure \`\_\_init\_\_.py\` to expose your agent: - - ```py - from . import agent - ``` - -4. Start the Google ADK Web UI and use your agent: - - ```shell - # make sure to run `adk web` from your project_root_folder - adk web - ``` - -After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose - ` my\_agent` agent (which is the same as the agent folder name). - === "Java" To create an Application Integration Toolset for Application Integration @@ -516,6 +464,57 @@ After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose `my_agent` agent (which is the same as the agent folder name). +=== "Python" + +To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: + +1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: + + ```py + integration_tool = ApplicationIntegrationToolset( + project="test-project", # TODO: replace with GCP project of the connection + location="us-central1", #TODO: replace with location of the connection + integration="test-integration", #TODO: replace with integration name + triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. + service_account_json='{...}', #optional. Stringified json for service account key + tool_name_prefix="tool_prefix1", + tool_instructions="..." + ) + ``` + + **Note:** You can provide service account to be used instead of using default + credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. + +2. Update the `agent.py` file and add tool to your agent: + + ```py + from google.adk.agents.llm_agent import LlmAgent + from .tools import integration_tool, connector_tool + + root_agent = LlmAgent( + model='gemini-2.0-flash', + name='integration_agent', + instruction="Help user, leverage the tools you have access to", + tools=[integration_tool], + ) + ``` + +3. Configure \`\_\_init\_\_.py\` to expose your agent: + + ```py + from . import agent + ``` + +4. Start the Google ADK Web UI and use your agent: + + ```shell + # make sure to run `adk web` from your project_root_folder + adk web + ``` + +After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose + ` my\_agent` agent (which is the same as the agent folder name). + --- ## Toolbox Tools for Databases From 602204850f872cf58661faa6dd761f0aa5dea482 Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 19:20:44 +0530 Subject: [PATCH 8/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 166 +++++++++++++++---------------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index 415357e42..dfdf9892b 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -142,37 +142,6 @@ It supports both on-premise and SaaS applications. In addition, you can turn you ### Prerequisites -=== "Java" -* You must have the Google Cloud CLI installed. For more information, see the [installation - guide](https://cloud.google.com/sdk/docs/install#installation_instructions). - -* Run the following commands: - - ```bash - gcloud config set project - gcloud auth application-default login - gcloud auth application-default set-quota-project - ``` - -* To use a Connector from Integration Connectors, you need to provision - Application Integration in the same region as your connection. -* Import and publish the [Connection - Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1) - from the template library. -* Follow the [Agent Development Kit - Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug) - and use the [latest version of adk](https://github.com/google/adk-python). - -* The project structure should be as follows: - - ``` - project_root_folder/ - └── my_agent/ - ├── agent.java - └── pom.xml - ``` -* When running the agent, make sure you are in the `project_root_f` directory. - === "Python" * [Install ADK](../get-started/installation.md). * Use an existing @@ -206,6 +175,37 @@ It supports both on-premise and SaaS applications. In addition, you can turn you - `roles/secretmanager.secretAccessor` > **Note:** For Agent Engine (AE), don't use `roles/integration.invoker`, as it can result in 403 errors. Use `roles/integration.editor` instead. + +=== "Java" +* You must have the Google Cloud CLI installed. For more information, see the [installation + guide](https://cloud.google.com/sdk/docs/install#installation_instructions). + +* Run the following commands: + + ```bash + gcloud config set project + gcloud auth application-default login + gcloud auth application-default set-quota-project + ``` + +* To use a Connector from Integration Connectors, you need to provision + Application Integration in the same region as your connection. +* Import and publish the [Connection + Tool](https://pantheon.corp.google.com/integrations/templates/connection-tool/locations/us-central1) + from the template library. +* Follow the [Agent Development Kit + Walkthrough](https://docs.google.com/document/d/1oqXkqX9m5wjWE-rkwp-qO0CGpSEQHBTYAYQcWRf91XU/edit?tab=t.0#heading=h.7k9wrm8jpdug) + and use the [latest version of adk](https://github.com/google/adk-python). + +* The project structure should be as follows: + + ``` + project_root_folder/ + └── my_agent/ + ├── agent.java + └── pom.xml + ``` +* When running the agent, make sure you are in the `project_root_f` directory. ### Use Integration Connectors @@ -238,7 +238,6 @@ Connect your agent to enterprise applications using ![Google Cloud Tools](../assets/publish-integration.png) - #### Create an Application Integration Toolset Application Integration Toolset supports `auth_scheme` and `auth_credential` for **dynamic OAuth2 authentication** for Integration Connectors. @@ -358,6 +357,58 @@ workflow as a tool for your agent or create a new one. #### Create an Application Integration Workflow Toolset + +=== "Python" + +To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: + +1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: + + ```py + integration_tool = ApplicationIntegrationToolset( + project="test-project", # TODO: replace with GCP project of the connection + location="us-central1", #TODO: replace with location of the connection + integration="test-integration", #TODO: replace with integration name + triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. + service_account_json='{...}', #optional. Stringified json for service account key + tool_name_prefix="tool_prefix1", + tool_instructions="..." + ) + ``` + + **Note:** You can provide service account to be used instead of using default + credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. + +2. Update the `agent.py` file and add tool to your agent: + + ```py + from google.adk.agents.llm_agent import LlmAgent + from .tools import integration_tool, connector_tool + + root_agent = LlmAgent( + model='gemini-2.0-flash', + name='integration_agent', + instruction="Help user, leverage the tools you have access to", + tools=[integration_tool], + ) + ``` + +3. Configure \`\_\_init\_\_.py\` to expose your agent: + + ```py + from . import agent + ``` + +4. Start the Google ADK Web UI and use your agent: + + ```shell + # make sure to run `adk web` from your project_root_folder + adk web + ``` + +After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose + ` my\_agent` agent (which is the same as the agent folder name). + === "Java" To create an Application Integration Toolset for Application Integration @@ -464,57 +515,6 @@ After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose `my_agent` agent (which is the same as the agent folder name). -=== "Python" - -To create an Application Integration Toolset for Application Integration Workflows using Python, follow these steps: - -1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file: - - ```py - integration_tool = ApplicationIntegrationToolset( - project="test-project", # TODO: replace with GCP project of the connection - location="us-central1", #TODO: replace with location of the connection - integration="test-integration", #TODO: replace with integration name - triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered. - service_account_json='{...}', #optional. Stringified json for service account key - tool_name_prefix="tool_prefix1", - tool_instructions="..." - ) - ``` - - **Note:** You can provide service account to be used instead of using default - credentials by generating [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating) and providing right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account. For more details about the IAM roles, refer to the [Prerequisites](#prerequisites) section. - -2. Update the `agent.py` file and add tool to your agent: - - ```py - from google.adk.agents.llm_agent import LlmAgent - from .tools import integration_tool, connector_tool - - root_agent = LlmAgent( - model='gemini-2.0-flash', - name='integration_agent', - instruction="Help user, leverage the tools you have access to", - tools=[integration_tool], - ) - ``` - -3. Configure \`\_\_init\_\_.py\` to expose your agent: - - ```py - from . import agent - ``` - -4. Start the Google ADK Web UI and use your agent: - - ```shell - # make sure to run `adk web` from your project_root_folder - adk web - ``` - -After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose - ` my\_agent` agent (which is the same as the agent folder name). - --- ## Toolbox Tools for Databases From 1f58e1d88aebe0f5173c8c5be18f4061445a61ab Mon Sep 17 00:00:00 2001 From: abiramit5 Date: Mon, 28 Jul 2025 19:25:08 +0530 Subject: [PATCH 9/9] Update google-cloud-tools.md --- docs/tools/google-cloud-tools.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index dfdf9892b..8b9641c37 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -416,9 +416,7 @@ Workflows using Java, follow these steps: 1. Create a tool with `ApplicationIntegrationToolset` in the `tools.java` file: - ```java - #tools.java - + ```java import com.google.adk.tools.applicationintegrationtoolset.ApplicationIntegrationToolset; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -464,9 +462,7 @@ Workflows using Java, follow these steps: 2. Update the `agent.java` file and add tool to your agent: - ```java - # agent.java - + ```java import com.google.adk.agent.LlmAgent; import com.google.adk.tools.BaseTool; import com.google.common.collect.ImmutableList; @@ -497,8 +493,7 @@ Workflows using Java, follow these steps: ``` **Note:** To find the list of supported entities and actions for a - connection, use these Connectors APIs: - * listActions, listEntityTypes + connection, use these Connector APIs: `listActions`, `listEntityTypes`. 3. Start the Google ADK Web UI and use your agent: