Google Workspace Add-on for Google Drive, which uses AI to recommend new names for the selected Doc in Google Drive by passing the body of the document within the AI prompt for context.
- Google Cloud Project (aka Standard Cloud Project for Apps Script) with billing enabled
- Create a Cloud Project
- Enable the Vertex AI API
- Enable Google Drive API
- Configure OAuth consent screen
- Create a Service Account and grant the role Service
Vertex AI User
role - Create a private key with type JSON. This will download the JSON file for use in the next section.
- Open a standalone Apps Script project.
- From Project Settings, change project to GCP project number of Cloud Project from step 1
- Add a Script Property. Enter
model_id
as the property name andgemini-pro
as the value. - Add a Script Property. Enter
project_location
as the property name andus-central1
as the value. - Add a Script Property. Enter
service_account_key
as the property name and paste the JSON key from the service account as the value.
- Add
Google Drive API v3
advanced service. - Add OAuth2 v43 Apps Script Library using the ID
1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF
. - Add the project code to Apps Script