Skip to main content
The first agent is read-only. The second enables file uploads and downloads.

Prerequisites

Enable the Google Drive API in your Google Cloud project, then choose an authentication method: Export your OpenAI API key for both agents: export OPENAI_API_KEY="your_openai_api_key_here". For OAuth, create Desktop app credentials. The first run opens a browser for consent and caches the token in token.json. For a service account, download its JSON key and share the target Drive files or folders with the service-account email. Set GOOGLE_DELEGATED_USER only when using domain-wide delegation. GOOGLE_CLOUD_QUOTA_PROJECT_ID is optional for both methods.

Run the Example

Full source: cookbook/91_tools/google_drive.py