OneNoteLoader#

class langchain_community.document_loaders.onenote.OneNoteLoader[source]#

Bases: BaseLoader, BaseModel

Load pages from OneNote notebooks.

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 access_token: str = ''#

Personal access token

param auth_with_token: bool = False#

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

param authority_url: str = 'https://login.microsoftonline.com/consumers/'#

A URL that identifies a token authority

param notebook_name: str | None = None#

Filter on notebook name

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

The IDs of the objects to load data from.

param onenote_api_base_url: str = 'https://graph.microsoft.com/v1.0/me/onenote'#

URL of Microsoft Graph API for OneNote

param page_title: str | None = None#

Filter on section name

param section_name: str | None = None#

Filter on section name

param settings: _OneNoteGraphSettings [Optional]#

Settings for the Microsoft Graph API client.

param token_path: Annotated[Path, PathType(path_type=file)] = PosixPath('/home/runner/.credentials/onenote_graph_token.txt')#

Path to the file where the access token is stored

Constraints:
  • path_type = 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][source]#

Get pages from OneNote notebooks.

Returns:

  • page_content

  • metadata
    • title

Return type:

A list of Documents with attributes

load() list[Document]#

Load data into Document objects.

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]

Examples using OneNoteLoader