|
1 |
| -# BigQuery Sample |
| 1 | +# Google API Tools Sample |
2 | 2 |
|
3 | 3 | ## Introduction
|
4 | 4 |
|
5 |
| -This sample tests and demos the BigQuery support in ADK via two tools: |
| 5 | +This sample tests and demos Google API tools available in the |
| 6 | +`google.adk.tools.google_api_tool` module. We pick the following BigQuery API |
| 7 | +tools for this sample agent: |
6 | 8 |
|
7 |
| -* 1. bigquery_datasets_list: |
| 9 | +1. `bigquery_datasets_list`: List user's datasets. |
8 | 10 |
|
9 |
| - List user's datasets. |
| 11 | +2. `bigquery_datasets_get`: Get a dataset's details. |
10 | 12 |
|
11 |
| -* 2. bigquery_datasets_get: |
12 |
| - Get a dataset's details. |
| 13 | +3. `bigquery_datasets_insert`: Create a new dataset. |
13 | 14 |
|
14 |
| -* 3. bigquery_datasets_insert: |
15 |
| - Create a new dataset. |
| 15 | +4. `bigquery_tables_list`: List all tables in a dataset. |
16 | 16 |
|
17 |
| -* 4. bigquery_tables_list: |
18 |
| - List all tables in a dataset. |
| 17 | +5. `bigquery_tables_get`: Get a table's details. |
19 | 18 |
|
20 |
| -* 5. bigquery_tables_get: |
21 |
| - Get a table's details. |
22 |
| - |
23 |
| -* 6. bigquery_tables_insert: |
24 |
| - Insert a new table into a dataset. |
| 19 | +6. `bigquery_tables_insert`: Insert a new table into a dataset. |
25 | 20 |
|
26 | 21 | ## How to use
|
27 | 22 |
|
28 |
| -* 1. Follow https://developers.google.com/identity/protocols/oauth2#1.-obtain-oauth-2.0-credentials-from-the-dynamic_data.setvar.console_name. to get your client id and client secret. |
| 23 | +1. Follow https://developers.google.com/identity/protocols/oauth2#1.-obtain-oauth-2.0-credentials-from-the-dynamic_data.setvar.console_name. to get your client id and client secret. |
29 | 24 | Be sure to choose "web" as your client type.
|
30 | 25 |
|
31 |
| -* 2. Configure your `.env` file to add two variables: |
| 26 | +2. Configure your `.env` file to add two variables: |
32 | 27 |
|
33 | 28 | * OAUTH_CLIENT_ID={your client id}
|
34 | 29 | * OAUTH_CLIENT_SECRET={your client secret}
|
35 | 30 |
|
36 | 31 | Note: don't create a separate `.env` file , instead put it to the same `.env` file that stores your Vertex AI or Dev ML credentials
|
37 | 32 |
|
38 |
| -* 3. Follow https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred to add http://localhost/dev-ui/ to "Authorized redirect URIs". |
| 33 | +3. Follow https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred to add http://localhost/dev-ui/ to "Authorized redirect URIs". |
39 | 34 |
|
40 | 35 | Note: localhost here is just a hostname that you use to access the dev ui, replace it with the actual hostname you use to access the dev ui.
|
41 | 36 |
|
42 |
| -* 4. For 1st run, allow popup for localhost in Chrome. |
| 37 | +4. For 1st run, allow popup for localhost in Chrome. |
43 | 38 |
|
44 | 39 | ## Sample prompt
|
45 | 40 |
|
|
0 commit comments