Google Integrations¶
Annolid Bot now supports native Google API integrations with shared OAuth credentials.
Current tools:
google_drive(optional, enabled by config)google_calendar(optional, enabled by config)
The Google OAuth token/credentials are shared so Drive and Calendar use one local auth setup. This also prepares a single auth surface for future Gmail tooling.
What Changed¶
The legacy Google Workspace CLI (gws) path and gws_setup tool are removed.
- no
gwsinstall step - no
tools.gwsconfig block - no
gws-*skill symlinks
Use the native google_drive and google_calendar tools instead.
Prerequisites¶
Install Annolid with the bot integrations bundle:
pip install "annolid[annolid_bot]"
(Equivalent editable install works too: pip install -e ".[annolid_bot]".)
Shared OAuth Files¶
Default paths:
- OAuth client credentials:
~/.annolid/agent/google_oauth_credentials.json - Cached OAuth token:
~/.annolid/agent/google_oauth_token.json
google_oauth_credentials.json is your Google Cloud OAuth client JSON.
google_oauth_token.json is generated locally after successful OAuth auth.
Annolid tries to keep them private:
- file mode:
0600 - parent dir mode:
0700
Config Reference¶
Configure in ~/.annolid/config.json:
{
"tools": {
"google_auth": {
"credentialsFile": "~/.annolid/agent/google_oauth_credentials.json",
"tokenFile": "~/.annolid/agent/google_oauth_token.json",
"allowInteractiveAuth": false
},
"google_drive": {
"enabled": true
},
"calendar": {
"enabled": true,
"calendarId": "primary",
"timezone": "America/New_York",
"defaultEventDurationMinutes": 30
}
}
}
Field summary:
tools.google_auth.credentialsFile: shared Google OAuth client file.tools.google_auth.tokenFile: shared cached token file.tools.google_auth.allowInteractiveAuth: allow browser OAuth when token is missing/invalid.tools.google_drive.enabled: registergoogle_drivetool.tools.calendar.enabled: registergoogle_calendartool.
First-Time OAuth Setup¶
- Put your Google OAuth client JSON at
credentialsFile. - Set
tools.google_auth.allowInteractiveAuth=true. - Start Annolid from an interactive terminal:
annolid
- Trigger a Drive or Calendar action in Annolid Bot, for example:
List my latest 5 Google Drive files
or
List my next 3 Google Calendar events
- Complete browser OAuth.
- Confirm token is created at
tokenFile. - Optionally set
allowInteractiveAuth=falseagain for safer background operation.
Example Prompts¶
List my latest 5 Google Drive filesShow details for Google Drive file <file_id>Create a Google Drive folder named Lab NotesDelete Google Drive file <file_id>List my calendar events for this week
Video Upload Workflows (Google Drive)¶
Annolid Bot supports resumable, retry-safe video uploads to Google Drive.
Upload one video file¶
Example prompt:
Use google_drive upload_file for /path/to/video.mp4 into remote_folder_path annolid/saved_videos
Recommended fields:
local_pathremote_folder_idorremote_folder_pathchunk_size_mb(default 8)skip_if_exists(default true, name+size dedupe)
Upload saved videos in bulk¶
Example prompt:
Upload saved videos from /path/to/project/output to Drive folder annolid/saved_videos
This uses upload_saved_videos and filters to recent non-realtime video files.
Upload realtime-detect videos in bulk¶
Example prompt:
Upload realtime detect videos from ~/.annolid/realtime to Drive folder annolid/realtime_detect
This uses upload_realtime_videos and focuses on realtime/detection-like paths and names.
Realtime GUI Auto-Upload¶
In Realtime Control -> Run & Output:
- Enable
Save MP4 segments on detections. - Use
Check Authto verify Google OAuth readiness. - Use
Loginto run browser auth if needed. - Enable
Auto-upload saved segments to Google Drive. - Set
Upload DelayandDrive Folder Path(for exampleannolid/realtime_detect). - Start realtime inference.
When a detection segment is saved to disk, Annolid schedules an automatic Drive upload after the configured delay.
Reliability behavior¶
- resumable uploads with chunked transfer
- retry on transient Drive errors (
429,500,502,503,504) - optional skip when same name and size already exists in destination
- batch result summary with uploaded/skipped/failed counts
Troubleshooting¶
Google tool not registered¶
Check:
tools.google_drive.enabled=truefor Drivetools.calendar.enabled=truefor Calendar- required Python deps installed (
annolid[annolid_bot])
Restart Annolid after config changes.
OAuth token missing and no browser prompt¶
Set:
{
"tools": {
"google_auth": {
"allowInteractiveAuth": true
}
}
}
Then relaunch Annolid from an interactive terminal and retry a Google action.
Access blocked (Error 403: access_denied)¶
If Google shows:
Access blocked: <your app> has not completed the Google verification process
Error 403: access_denied
your OAuth app is usually in Testing mode and the signed-in Gmail account is not approved.
Fix:
- Open Google Cloud Console for the same project as your OAuth client.
- Go to
APIs & Services->OAuth consent screen. - Check
Publishing status. - If status is
Testing, add your Gmail account underTest users. - Save changes and retry Annolid auth.
- If you need broader user access, publish to
Productionand complete Google verification for sensitive/restricted scopes.
Notes:
Internalapp type only allows users in the same Google Workspace organization.- Workspace org policies can block external OAuth clients until an admin approves them.
Credentials/token path issues¶
Verify configured paths in ~/.annolid/config.json and ensure files are readable/writable.