You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(adk): update Application Integration Tools section in Google Cloud Tools (#513)
* Update "Application Integration Tools" in google-cloud-tools.md
- Fixed b/425843277 and b/427619667 bugs.
* Added required IAM roles in the prerequites with a note, linked them in subsections
* Replaced service-account-credentials with service-account json
- Fixed grammar and structure throughout the document.
* Update google-cloud-tools.md
* Update google-cloud-tools.md
* Update google-cloud-tools.md
Copy file name to clipboardExpand all lines: docs/tools/google-cloud-tools.md
+60-52Lines changed: 60 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,35 +136,27 @@ you only need to follow a subset of these steps.
136
136
137
137
## Application Integration Tools
138
138
139
-
With **ApplicationIntegrationToolset** you can seamlessly give your agents a
140
-
secure and governed to enterprise applications using Integration Connector’s
141
-
100+ pre-built connectors for systems like Salesforce, ServiceNow, JIRA, SAP,
142
-
and more. Support for both on-prem and SaaS applications. In addition you can
143
-
turn your existing Application Integration process automations into agentic
144
-
workflows by providing application integration workflows as tools to your ADK
145
-
agents.
139
+
With **ApplicationIntegrationToolset**, you can seamlessly give your agents secure and governed access to enterprise applications using Integration Connectors' 100+ pre-built connectors for systems like Salesforce, ServiceNow, JIRA, SAP, and more.
146
140
147
-
**Prerequisites**
141
+
It supports both on-premise and SaaS applications. In addition, you can turn your existing Application Integration process automations into agentic workflows by providing application integration workflows as tools to your ADK agents.
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:
5. Set up your project structure and create required files
167
-
158
+
159
+
4. Set up your project structure and create required files.
168
160
```console
169
161
project_root_folder
170
162
|-- .env
@@ -173,39 +165,52 @@ agents.
173
165
|-- agent.py
174
166
`__ tools.py
175
167
```
168
+
When running the agent, make sure to run `adk web` in the `project\_root\_folder`.
176
169
177
-
When running the agent, make sure to run adk web in project\_root\_folder
170
+
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):
171
+
172
+
- `roles/integration.editor`
173
+
- `roles/connectors.user`
174
+
- `roles/secretmanager.secretAccessor`
175
+
176
+
> **Note:** For Agent Engine (AE), don't use `roles/integration.invoker`, as it can result in 403 errors. Use `roles/integration.editor` instead.
178
177
179
178
### Use Integration Connectors
180
179
181
180
Connect your agent to enterprise applications using
1. To use a connector from Integration Connectors, you need to [provision](https://console.cloud.google.com/integrations)
187
-
Application Integration in the same region as your connection by clicking on "QUICK SETUP" button.
183
+
#### Before you begin
184
+
>**Note:** The *ExecuteConnection* integration is typically created automatically when you provision Application Integration in a given region. If the *ExecuteConnection* doesn't exist in the [list of integrations](https://pantheon.corp.google.com/integrations/list?hl=en&inv=1&invt=Ab2u5g&project=standalone-ip-prod-testing), you must follow these steps to create it:
188
185
186
+
1. To use a connector from Integration Connectors, click **QUICK SETUP** and [provision](https://console.cloud.google.com/integrations)
187
+
Application Integration in the same region as your connection.
1. Create a tool with `ApplicationIntegrationToolset` within your `tools.py` file
211
+
To create an Application Integration Toolset for Integration Connectors, follow these steps:
212
+
213
+
1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file:
209
214
210
215
```py
211
216
from google.adk.tools.application_integration_tool.application_integration_toolset import ApplicationIntegrationToolset
@@ -216,19 +221,19 @@ Connect your agent to enterprise applications using
216
221
connection="test-connection", #TODO: replace with connection name
217
222
entity_operations={"Entity_One": ["LIST","CREATE"], "Entity_Two": []},#empty list for actions means all operations on the entity are supported.
218
223
actions=["action1"], #TODO: replace with actions
219
-
service_account_credentials='{...}', # optional. Stringified json for service account key
224
+
service_account_json='{...}', # optional. Stringified json for service account key
220
225
tool_name_prefix="tool_prefix2",
221
226
tool_instructions="..."
222
227
)
223
228
```
224
229
225
230
**Note:**
226
231
227
-
* 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 to the service account.
228
-
* To find the list of supported entities and actions for a connection, use the connectors apis: [listActions](https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.connectionSchemaMetadata/listActions) or [listEntityTypes](https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.connectionSchemaMetadata/listEntityTypes)
232
+
* You can provide a service account to be used instead of default credentials by generating a [Service Account Key](https://cloud.google.com/iam/docs/keys-create-delete#creating), and providing the right [Application Integration and Integration Connector IAM roles](#prerequisites) to the service account.
233
+
* To find the list of supported entities and actions for a connection, use the Connectors APIs: [listActions](https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.connectionSchemaMetadata/listActions) or [listEntityTypes](https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.connectionSchemaMetadata/listEntityTypes).
229
234
230
235
231
-
`ApplicationIntegrationToolset`now also supports providing auth_scheme and auth_credential for dynamic OAuth2 authentication for Integration Connectors. To use it, create a tool similar to this within your`tools.py` file:
236
+
`ApplicationIntegrationToolset` also supports `auth_scheme` and `auth_credential` for dynamic OAuth2 authentication for Integration Connectors. To use it, create a tool similar to this in the `tools.py` file:
232
237
233
238
```py
234
239
from google.adk.tools.application_integration_tool.application_integration_toolset import ApplicationIntegrationToolset
@@ -270,7 +275,7 @@ Connect your agent to enterprise applications using
270
275
connection="test-connection", #TODO: replace with connection name
271
276
entity_operations={"Entity_One": ["LIST","CREATE"], "Entity_Two": []},#empty list for actions means all operations on the entity are supported.
272
277
actions=["GET_calendars/%7BcalendarId%7D/events"], #TODO: replace with actions. this one is for list events
273
-
service_account_credentials='{...}', # optional. Stringified json for service account key
278
+
service_account_json='{...}', # optional. Stringified json for service account key
274
279
tool_name_prefix="tool_prefix2",
275
280
tool_instructions="...",
276
281
auth_scheme=oauth_scheme,
@@ -279,7 +284,7 @@ Connect your agent to enterprise applications using
279
284
```
280
285
281
286
282
-
2. Add the tool to your agent. Update your `agent.py` file
287
+
2. Update the `agent.py` file and add tool to your agent:
283
288
284
289
```py
285
290
from google.adk.agents.llm_agent import LlmAgent
@@ -293,48 +298,51 @@ Connect your agent to enterprise applications using
293
298
)
294
299
```
295
300
296
-
3. Configure your `__init__.py` to expose your agent
301
+
3. Configure `__init__.py` to expose your agent:
297
302
298
303
```py
299
304
from . import agent
300
305
```
301
306
302
-
4. Start the Google ADK Web UI and try your agent.
307
+
4. Start the Google ADK Web UI and use your agent:
303
308
304
309
```shell
305
310
# make sure to run `adk web` from your project_root_folder
306
311
adk web
307
312
```
308
313
309
-
Then go to [http://localhost:8000](http://localhost:8000), and choose
310
-
my\_agent agent (same as the agent folder name)
314
+
After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose
315
+
`my\_agent` agent (which is the same as the agent folder name).
workflow as a tool for your agent or create a new one.
317
323
318
-
**Steps:**
324
+
#### Create an Application Integration Workflow Toolset
325
+
326
+
To create an Application Integration Toolset for Application Integration Workflows, follow these steps:
319
327
320
-
1. Create a tool with `ApplicationIntegrationToolset`within your`tools.py` file
328
+
1. Create a tool with `ApplicationIntegrationToolset` in the `tools.py` file:
321
329
322
330
```py
323
331
integration_tool = ApplicationIntegrationToolset(
324
332
project="test-project", # TODO: replace with GCP project of the connection
325
333
location="us-central1", #TODO: replace with location of the connection
326
334
integration="test-integration", #TODO: replace with integration name
327
335
triggers=["api_trigger/test_trigger"],#TODO: replace with trigger id(s). Empty list would mean all api triggers in the integration to be considered.
328
-
service_account_credentials='{...}', #optional. Stringified json for service account key
336
+
service_account_json='{...}', #optional. Stringified json for service account key
329
337
tool_name_prefix="tool_prefix1",
330
338
tool_instructions="..."
331
339
)
332
340
```
333
341
334
-
Note: You can provide service account to be used instead of using default
335
-
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 to the service account.
342
+
**Note:** You can provide service account to be used instead of using default
343
+
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.
336
344
337
-
2. Add the tool to your agent. Update your `agent.py` file
345
+
2. Update the `agent.py` file and add tool to your agent:
338
346
339
347
```py
340
348
from google.adk.agents.llm_agent import LlmAgent
@@ -348,21 +356,21 @@ workflow as a tool for your agent or create a new one.
348
356
)
349
357
```
350
358
351
-
3. Configure your \`\_\_init\_\_.py\` to expose your agent
359
+
3. Configure \`\_\_init\_\_.py\` to expose your agent:
352
360
353
361
```py
354
362
from . import agent
355
363
```
356
364
357
-
4. Start the Google ADK Web UI and try your agent.
365
+
4. Start the Google ADK Web UI and use your agent:
358
366
359
367
```shell
360
368
# make sure to run `adk web` from your project_root_folder
361
369
adk web
362
370
```
363
371
364
-
Then go to [http://localhost:8000](http://localhost:8000), and choose
365
-
my\_agent agent (same as the agent folder name)
372
+
After completing the above steps, go to [http://localhost:8000](http://localhost:8000), and choose
373
+
` my\_agent` agent (which is the same as the agent folder name).
0 commit comments