langchain.document_loaders.onedrive.OneDriveLoader¶

class langchain.document_loaders.onedrive.OneDriveLoader(*, settings: _OneDriveSettings = None, drive_id: str, folder_path: Optional[str] = None, object_ids: Optional[List[str]] = None, auth_with_token: bool = False)[source]¶

Bases: BaseLoader, BaseModel

Loads data from OneDrive.

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 auth_with_token: bool = False¶

Whether to authenticate with a token or not. Defaults to False.

param drive_id: str [Required]¶

The ID of the OneDrive drive to load data from.

param folder_path: Optional[str] = None¶

The path to the folder to load data from.

param object_ids: Optional[List[str]] = None¶

The IDs of the objects to load data from.

param settings: langchain.document_loaders.onedrive._OneDriveSettings [Optional]¶

The settings for the OneDrive API client.

lazy_load() Iterator[Document]¶

A lazy loader for Documents.

load() List[Document][source]¶

Loads all supported document files from the specified OneDrive drive and return a list of Document objects.

Returns

A list of Document objects representing the loaded documents.

Return type

List[Document]

Raises
  • ValueError – If the specified drive ID

  • does not correspond to a drive in the OneDrive storage. –

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]¶

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

Parameters

text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns

List of Documents.

Examples using OneDriveLoader¶