How to setup AI Assistant connection?
Before the AI Assistant can use Google AI models, it needs to be connected to your Google account or Google Cloud environment. This connection is configured in the environment settings file used during deployment.
There are two supported connection methods, and only one should be active at a time:
- Google API key
Best for standard cloud deployments. Simple to configure and recommended for most users. - Google Vertex service account
Recommended for enterprise, on-premise, or security-focused environments where access is managed through a Google Cloud service account.
Warning: Use only one method at the same time. If both are configured together, the connection may fail or behave unexpectedly.
Where to configure the connection
Add the settings shown below to the environment settings file used by your AI Assistant deployment, then restart the service after saving changes.
1. Google API key setup
1. Add this line:
GOOGLE_API_KEY=your_google_api_key_here
2. Make sure these are not used at the same time:
GOOGLE_GENAI_USE_VERTEXAI
GOOGLE_VERTEX_SERVICE_ACCOUNT_JSON
3. Restart CDP.
2. Google Vertex service account setup
1. Add this line:
GOOGLE_GENAI_USE_VERTEXAI='1'
2. Add this line (paste the full service account JSON as one single line):
GOOGLE_VERTEX_SERVICE_ACCOUNT_JSON='{"type":"service_account","project_id":"test","private_key_id":"test","private_key":"-----BEGIN PRIVATE KEY-----\nofijdasfiodsajfias==\n-----END PRIVATE KEY-----\n","client_email":"test@gmail.com","client_id":"1","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/test.iam.gserviceaccount.com","universe_domain":"googleapis.com"}'
3. Do not use GOOGLE_API_KEY at the same time.
4. Restart CDP.
Remember:
- Keep GOOGLE_VERTEX_SERVICE_ACCOUNT_JSON in single quotes: '...'
- The JSON must stay on one line.
- Keep the private key line breaks as \n exactly as shown.
- If there is one missing quote or bracket, it will not work.
No Comments