Toggle Menu
Prev Up Next

# `langchain_community.document_loaders.rspace`.RSpaceLoader

class langchain_community.document_loaders.rspace.RSpaceLoader(global_id: str, api_key: Optional[str] = None, url: Optional[str] = None)

  Load content from RSpace notebooks, folders, documents or PDF Gallery files.

  Map RSpace document <-> Langchain Document in 1-1. PDFs are imported using PyPDF.

  Requirements are rspace_client (pip install rspace_client) and PyPDF if importing

    PDF docs (pip install pypdf).

  api_key: RSpace API key - can also be supplied as environment variable ‘RSPACE_API_KEY’ url: str The URL of your RSpace instance - can also be supplied as environment variable ‘RSPACE_URL’ global_id: str

  > The global ID of the resource to load,

  e.g. ‘SD12344’ (a single document); ‘GL12345’(A PDF file in the gallery); ‘NB4567’ (a notebook); ‘FL12244’ (a folder)

  Methods

  `__init__`(global_id[, api_key, url]) | api_key: RSpace API key - can also be supplied as environment variable 'RSPACE_API_KEY' url: str The URL of your RSpace instance - can also be supplied as environment variable 'RSPACE_URL' global_id: str The global ID of the resource to load, e.g. 'SD12344' (a single document); 'GL12345'(A PDF file in the gallery); 'NB4567' (a notebook); 'FL12244' (a folder).
  `alazy_load`() | A lazy loader for Documents.
  `aload`() | Load data into Document objects.
  `lazy_load`() | A lazy loader for Documents.
  `load`() | Load data into Document objects.
  `load_and_split`([text_splitter]) | Load Documents and split into chunks.
  `validate_environment`(values) | Validate that API key and URL exist in environment.

  Parameters

    - global_id (str) –

    - api_key (Optional[str]) –

    - url (Optional[str]) –

  __init__(global_id: str, api_key: Optional[str] = None, url: Optional[str] = None)

    api_key: RSpace API key - can also be supplied as environment variable ‘RSPACE_API_KEY’ url: str The URL of your RSpace instance - can also be supplied as environment variable ‘RSPACE_URL’ global_id: str

    > The global ID of the resource to load,

    e.g. ‘SD12344’ (a single document); ‘GL12345’(A PDF file in the gallery); ‘NB4567’ (a notebook); ‘FL12244’ (a folder)

    Parameters

      - global_id (str) –

      - api_key (Optional[str]) –

      - url (Optional[str]) –

  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]

    Load data into Document objects.

    Return type

      List[Document]

  load_and_split(text_splitter: Optional[TextSplitter] = 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]

  classmethod validate_environment(values: Dict) → Dict

    Validate that API key and URL exist in environment.

    Parameters

      values (Dict) –

    Return type

      Dict

# Examples using RSpaceLoader

- rspace.md