GoogleDriveLoader#

class langchain_google_community.drive.GoogleDriveLoader[source]#

Bases: BaseLoader, BaseModel

Load Google Docs from Google Drive.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param credentials_path: Path = PosixPath('/home/runner/.credentials/credentials.json')#

Path to the credentials file.

param document_ids: List[str] | None = None#

The document ids to load from.

param file_ids: List[str] | None = None#

The file ids to load from.

param file_loader_cls: Any = None#

The file loader class to use.

param file_loader_kwargs: Dict[str, Any] = {}#

The file loader kwargs to use.

param file_types: Sequence[str] | None = None#

The file types to load. Only applies when folder_id is given.

param folder_id: str | None = None#

The folder id to load from.

param load_auth: bool = False#

Whether to load authorization identities.

param load_extended_metadata: bool = False#

Whether to load extended metadata.

param load_trashed_files: bool = False#

Whether to load trashed files. Only applies when folder_id is given.

param recursive: bool = False#

Whether to load recursively. Only applies when folder_id is given.

param service_account_key: Path = PosixPath('/home/runner/.credentials/keys.json')#

Path to the service account key file.

param token_path: Path = PosixPath('/home/runner/.credentials/token.json')#

Path to the token file.

async alazy_load() AsyncIterator[Document]#

A lazy loader for Documents.

Return type:

AsyncIterator[Document]

async aload() List[Document]#

Load data into Document objects.

Return type:

List[Document]

lazy_load() Iterator[Document]#

A lazy loader for Documents.

Return type:

Iterator[Document]

load() List[Document][source]#

Load documents.

Return type:

List[Document]

load_and_split(text_splitter: TextSplitter | None = None) List[Document]#

Load Documents and split into chunks. Chunks are returned as Documents.

Do not override this method. It should be considered to be deprecated!

Parameters:

text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns:

List of Documents.

Return type:

List[Document]