Skip to content

feat: Add Google Drive toolkit #4233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

darshankparmar
Copy link

This PR adds a new Google Drive toolkit that enables Agno agents to interact with Google Drive files and folders. The implementation follows Agno's toolkit patterns and includes comprehensive testing.

What's Added:

  • GoogleDriveTools class with 7 core file operations
  • OAuth2 authentication supporting both file-based and environment-based credentials
  • Pagination support for efficient file listing
  • Comprehensive error handling and logging
  • Full unit test coverage with mocked Google Drive API
  • Cookbook example demonstrating agent-driven usage

Key Features:

  • File Operations: list, search, upload, download, create folder, delete
  • Authentication: Flexible OAuth2 setup with configurable scopes
  • Pagination: Efficient handling of large file collections
  • Error Handling: Proper error responses and logging
  • Testing: 100% unit test coverage with proper mocking

Files Changed:

  • libs/agno/agno/tools/googledrive.py - Core toolkit implementation
  • cookbook/tools/googledrive_tools.py - Usage example
  • libs/agno/tests/unit/tools/test_googledrive_tools.py - Unit tests

Testing:

  • All unit tests pass with mocked Google Drive API
  • Tests cover all public methods and error scenarios
  • Proper mocking of external dependencies

Documentation:

  • Comprehensive docstrings for all methods
  • Cookbook example showing real-world usage
  • Clear authentication setup instructions

This toolkit follows Agno's established patterns and provides a solid foundation for Google Drive integration in agent workflows.

Closes: #4232

- Implement GoogleDriveTools class with OAuth2 authentication
- Support file operations: list, search, upload, download, create folder, delete
- Include pagination support for large file collections
- Add comprehensive unit tests with mocked Google Drive API
- Provide cookbook example demonstrating agent-driven Google Drive usage
- Support both credentials.json and environment variable authentication
- Handle soft/hard delete operations with proper error handling
@darshankparmar darshankparmar requested a review from a team as a code owner August 15, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant