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][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param credentials: Any = None#

Your own google credentials created via your own mechanism

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]