|
4 | 4 |
|
5 | 5 | This sample tests and demos the OAuth support in ADK via two tools: |
6 | 6 |
|
7 | | -* 1. list_calendar_events |
| 7 | +* 1. list_calendar_events |
8 | 8 |
|
9 | | - This is a customized tool that calls Google Calendar API to list calendar events. |
10 | | - It pass in the client id and client secrete to ADK and then get back the access token from ADK. |
11 | | - And then it uses the access token to call calendar api. |
| 9 | + This is a customized tool that calls Google Calendar API to list calendar |
| 10 | + events. It pass in the client id and client secrete to ADK and then get back |
| 11 | + the access token from ADK. And then it uses the access token to call |
| 12 | + calendar api. |
12 | 13 |
|
13 | | -* 2. get_calendar_events |
| 14 | +* 2. get_calendar_events |
14 | 15 |
|
15 | | - This is an google calendar tool that calls Google Calendar API to get the details of a specific calendar. |
16 | | - This tool is from the ADK built-in Google Calendar ToolSet. |
17 | | - Everything is wrapped and the tool user just needs to pass in the client id and client secret. |
| 16 | + This is an google calendar tool that calls Google Calendar API to get the |
| 17 | + details of a specific calendar. This tool is from the ADK built-in Google |
| 18 | + Calendar ToolSet. Everything is wrapped and the tool user just needs to pass |
| 19 | + in the client id and client secret. |
18 | 20 |
|
19 | 21 | ## How to use |
20 | 22 |
|
21 | | -* 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. |
22 | | - Be sure to choose "web" as your client type. |
| 23 | +* 1. Follow |
| 24 | + https://developers.google.com/identity/protocols/oauth2#1.-obtain-oauth-2.0-credentials-from-the-dynamic_data.setvar.console_name. |
| 25 | + to get your client id and client secret. Be sure to choose "web" as your |
| 26 | + client type. |
23 | 27 |
|
24 | | -* 2. Configure your `.env` file to add two variables: |
| 28 | +* 2. Configure your `.env` file to add two variables: |
25 | 29 |
|
26 | | - * OAUTH_CLIENT_ID={your client id} |
27 | | - * OAUTH_CLIENT_SECRET={your client secret} |
| 30 | + * OAUTH_CLIENT_ID={your client id} |
| 31 | + * OAUTH_CLIENT_SECRET={your client secret} |
28 | 32 |
|
29 | | - 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 |
| 33 | + Note: don't create a separate `.env` file , instead put it to the same |
| 34 | + `.env` file that stores your Vertex AI or Dev ML credentials |
30 | 35 |
|
31 | | -* 3. Follow https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred to add http://localhost/dev-ui/ to "Authorized redirect URIs". |
| 36 | +* 3. Follow |
| 37 | + https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred |
| 38 | + to add http://localhost/dev-ui/ to "Authorized redirect URIs". |
32 | 39 |
|
33 | | - 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. |
| 40 | + Note: localhost here is just a hostname that you use to access the dev ui, |
| 41 | + replace it with the actual hostname you use to access the dev ui. |
34 | 42 |
|
35 | | -* 4. For 1st run, allow popup for localhost in Chrome. |
| 43 | +* 4. For 1st run, allow popup for localhost in Chrome. |
36 | 44 |
|
37 | 45 | ## Sample prompt |
38 | 46 |
|
39 | | -* `List all my today's meeting from 7am to 7pm.` |
40 | | -* `Get the details of the first event.` |
| 47 | +* `List all my today's meeting from 7am to 7pm.` |
| 48 | +* `Get the details of the first event.` |
0 commit comments