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
Copy file name to clipboardExpand all lines: contributing/samples/bigquery/README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,39 @@ type.
119
119
120
120
1. Set `CREDENTIALS_TYPE=AuthCredentialTypes.OAUTH2` in `agent.py` and run the agent
121
121
122
+
### With Agent Engine and Gemini Enterprise
123
+
124
+
This mode is useful when you deploy the agent to Vertex AI Agent Engine and
125
+
want to make it available in Gemini Enterprise, allowing the agent to access
126
+
BigQuery on behalf of the end-user. This setup uses OAuth 2.0 managed by
127
+
Gemini Enterprise.
128
+
129
+
1. Create an Authorization resource in Gemini Enterprise by following the guide at
130
+
[Register and manage ADK agents hosted on Vertex AI Agent Engine](https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent) to:
131
+
* Create OAuth 2.0 credentials in your Google Cloud project.
132
+
* Create an Authorization resource in Gemini Enterprise, linking it to your
133
+
OAuth 2.0 credentials. When creating this resource, you will define a
134
+
unique identifier (`AUTH_ID`).
135
+
136
+
2. Prepare the sample agent for consuming the access token provided by Gemini
137
+
Enterprise and deploy to Vertex AI Agent Engine.
138
+
* Set `CREDENTIALS_TYPE=AuthCredentialTypes.HTTP` in `agent.py`. This
139
+
configures the agent to use access tokens provided by Gemini Enterprise and
140
+
provided by Agent Engine via the tool context.
141
+
* Replace `AUTH_ID` in `agent.py` with your authorization resource identifier
142
+
from step 1.
143
+
*[Deploy your agent to Vertex AI Agent Engine](https://google.github.io/adk-docs/deploy/agent-engine/).
144
+
145
+
3.[Register your deployed agent with Gemini Enterprise](https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent#register-an-adk-agent), attaching the
146
+
Authorization resource `AUTH_ID`. When this agent is invoked through Gemini
147
+
Enterprise, an access token obtained using these OAuth credentials will be
148
+
passed to the agent and made available in the ADK `tool_context` under the key
149
+
`AUTH_ID`, which `agent.py` is configured to use.
150
+
151
+
Once registered, users interacting with your agent via Gemini Enterprise will
152
+
go through an OAuth consent flow, and Agent Engine will provide the agent with
153
+
the necessary access tokens to call BigQuery APIs on their behalf.
154
+
122
155
## Sample prompts
123
156
124
157
* which weather datasets exist in bigquery public data?
0 commit comments