Project to build a custom GPT for assisting users for emails, calendar, and task management by interfacing with Google Workspace APIs. This custom GPT is designed to only work someone's individual account. This assistant can read emails, parse out the event information, and add that to one's calendar.
- Have an OpenAI account with Plus, Team or Enterprise subscription. See this link for details: https://openai.com/chatgpt/pricing. No need for token credits for this project!
- Have a Google Workspace account without Advanced Protection. Google Workspace includes Gmail, Calendar, Task and other Google services. Advanced Protection blocks certain APIs and application from running on the account.
- Setup Google Cloud Console, https://console.cloud.google.com/.
- Setup OAuth 2.0 on Google Workspaces account. When specifying the Scope, specify email and calendar domains.
- Get Client ID and Client Secret
- Go to your OpenAI account, and create a custom GPT.
- Go to the Configure Tab, and then lower down on the left panel, click Create new action. The left panel should change to Add actions.
- Click on the box below or next to Authentication, which should say None. An Authentication pop-up window should appear.
- Select OAuth
- Paste Client ID and Client Secret into the Authentication windows, into their respective fields
- Copy the Authorization URL and Toke URL from this image into the respective areas in the pop-up.
- Copy Scope URLs into the Authentication Scope empty text box, for the email and calendar domains.
- Save the authentication window. This will take you back to the Edit actions page.
- Copy and past the openAPIschema.yaml file into the Schema box.
- Click the back arrow icon left of the Edit actions.
- Copy the Callback URL, which should be on the left panel, below the Actions.
- Go back to Google Workspace Console, and paste the Callback URI into the console.
- Go back to the OpenAI website for building the CustomGPT.
- Copy and paste the Instructions file into the Instruction window.
- Click on the Update or Save green button on the upper right corner of the page. This will save your changes.
- Test out the assistant in the right panel!
- Setup OAuth 2.0 to Access Google APIs https://developers.google.com/identity/protocols/oauth2-
- Visual Guide to setup OAuth 2.0 for Google APIs, courtesy of Postman: https://blog.postman.com/how-to-access-google-apis-using-oauth-in-postman/