Skip to content
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

[GDrive] Modify search parameters to search shared drives #491

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

scottmx81
Copy link
Contributor

What's being changed:

This PR modifies the Google Drive connector to include shared drives in the search results.

By default Google Drive with OAuth only returns files from "My Drive" (your own drive). Two arguments are being passed to the list files call to make it include shared drives in the results:

  • supportsAllDrives - Whether the requesting application supports both My Drives and shared drives.
  • includeItemsFromAllDrives - Whether both My Drive and shared drive items should be included in results.

These arguments are documented here:

https://developers.google.com/drive/api/reference/rest/v3/files/list#query-parameters

With service accounts, it's searching shared drives by default.

How did you test this change (include any code snippets, API requests, screenshots, or gifs):

  • Set up the connector with OAuth
  • Authorized the connector
  • Extracted text from several large PDF files and saved the extracted text as Google Documents, in a Google account distinct from the one connected to the Google Drive connector I created in Cohere Dashboard
  • Shared the folder with the test Google Docs from the other account, to the Google account used with connector OAuth flow
  • Connector was running in local env with my change, via ngrok tunnel
  • In Coral I asked several questions with answers expected to be found in the documents in the shared folder
  • I confirmed that the references in right pane of Coral had links to each of the three test documents I created in the shared folder, owned by a Google account different than the one used to authorize the Google Drive connector

@scottmx81 scottmx81 requested a review from a team as a code owner September 4, 2024 23:57
@scottmx81 scottmx81 force-pushed the gdrive_shared_drives branch from ab20f3f to 08c7e4e Compare September 4, 2024 23:59
Copy link
Collaborator

@walterbm-cohere walterbm-cohere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you!

@walterbm-cohere walterbm-cohere merged commit 6100dc2 into cohere-ai:main Sep 5, 2024
2 checks passed
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.

2 participants