Skip to content

Google Drive Data Source

Load data from Google Drive.

Make sure to setup the Google Drive API before using this data source.

This setup involves creating a Service Account and configuring domain-wide delegation to allow the service account to access files within the Google Workspace team.

To create a service account key, follow these instructions.

The service account must be granted access to files according to the following instructions (preferred), or through sharing the folders / files with the service account

google_drive

from llama_cloud.types.data_source_create_params import (
CloudGoogleDriveDataSource,
)
data_source = client.data_sources.create(
name="my-data-source",
component=CloudGoogleDriveDataSource(
folder_id="<your-folder-id>",
service_account_key={
"type": "service_account",
"project_id": "<your-project-id>",
"private_key": "<your-private-key>",
...
},
),
source_type="GOOGLE_DRIVE",
project_id="my-project-id",
)