Running Lessons in Google Collaboratory and Google Drive

Google Collaboratory is a Jupyter like environment in the cloud that includes an AI code assistant that generates pretty good code which is ready to be run in a cell, with the prompt saved as a comment.

You can open new Collaboratory files just like you do for Google Docs, Sheets, etc. (+ New > More > Google Collaboratory)

In addition, you can connect your Google Drive to Google Collaboratory with the following code blocks:

# prompt: code to read Google Drive files

from google.colab import drive
drive.mount('/content/drive/')
# prompt: code to change directory to "G:\My Drive\Training\AI Python for Beginners"

import os

# Change the directory
os.chdir('/content/drive/My Drive/Training/AI Python for Beginners')

# Print the current working directory
print(os.getcwd())
3 Likes

Thank you for sharing this information about using Google Colab and the generative AI capabilities in Colab. Its cloud-based environment and easy integration with Google Drive make it perfect for educational purposes. However, it is important to use the code with caution and understand how Google collects and processes data, especially with a focus on privacy and ensuring that personal or sensitive information is not included in prompts.

1 Like

@nadtriana Good advise on not including personal or sensitive information in prompts, especially “free” models.

It turns out though that if you use Google Colab/Drive/Gemini from a paid Google Workspace account, prompts and responses are not stored.

As an aside, I hear that Gemini will become a default part of all Google Workspace apps (Docs, Sheets, Slides, etc.) in Q4, with user data remaining private.