Skip to main content
GoogleDriveContextProvider wraps a read-only slice of GoogleDriveTools with corpora="allDrives" so a service account can see folders shared with it and files in Shared Drives. The calling agent gets a single query_<id> tool that routes through a sub-agent trained to escalate searches when the naive query comes back empty.
google_drive.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as google_drive.py, then run:
Full source: cookbook/12_context/07_google_drive.py