Files
langchain/libs/cli/langchain_cli/integration_template/docs/document_loaders.ipynb
T
Oskar StarkandEugene Yurtsev 0d2cea747c docs: streamline LangSmith teasing (#30302)
This can only be reviewed by [hiding
whitespaces](https://github.com/langchain-ai/langchain/pull/30302/files?diff=unified&w=1).

The motivation behind this PR is to get my hands on the docs and make
the LangSmith teasing short and clear.

Right now I don't know how to do it, but this could be an include in the
future.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-03-28 15:13:22 -04:00

6.7 KiB

sidebar_label
sidebar_label
__ModuleName__

__ModuleName__Loader

  • TODO: Make sure API reference link is correct.

This notebook provides a quick overview for getting started with ModuleName document loader. For detailed documentation of all __ModuleName__Loader features and configurations head to the API reference.

  • TODO: Add any other relevant links, like information about underlying API, etc.

Overview

Integration details

  • TODO: Fill in table features.
  • TODO: Remove JS support link if not relevant, otherwise ensure link is correct.
  • TODO: Make sure API reference links are correct.
Class Package Local Serializable JS support
__ModuleName__Loader langchain_community ✅/❌ beta/❌ ✅/❌

Loader features

Source Document Lazy Loading Native Async Support
__ModuleName__Loader ✅/❌ ✅/❌

Setup

  • TODO: Update with relevant info.

To access ModuleName document loader you'll need to install the __package_name__ integration package, and create a ModuleName account and get an API key.

Credentials

  • TODO: Update with relevant info.

Head to (TODO: link) to sign up to ModuleName and generate an API key. Once you've done this set the __MODULE_NAME___API_KEY environment variable:

In [ ]:
import getpass
import os

os.environ["__MODULE_NAME___API_KEY"] = getpass.getpass("Enter your __ModuleName__ API key: ")

To enable automated tracing of your model calls, set your LangSmith API key:

In [ ]:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"

Installation

Install langchain_community.

  • TODO: Add any other required packages
In [ ]:
%pip install -qU langchain_community

Initialization

Now we can instantiate our model object and load documents:

  • TODO: Update model instantiation with relevant params.
In [ ]:
from langchain_community.document_loaders import __ModuleName__Loader

loader = __ModuleName__Loader(
    # required params = ...
    # optional params = ...
)

Load

  • TODO: Run cells to show loading capabilities
In [ ]:
docs = loader.load()
docs[0]
In [ ]:
print(docs[0].metadata)

Lazy Load

  • TODO: Run cells to show lazy loading capabilities. Delete if lazy loading is not implemented.
In [ ]:
page = []
for doc in loader.lazy_load():
    page.append(doc)
    if len(page) >= 10:
        # do some paged operation, e.g.
        # index.upsert(page)

        page = []

TODO: Any functionality specific to this document loader

E.g. using specific configs for different loading behavior. Delete if not relevant.

API reference

For detailed documentation of all __ModuleName__Loader features and configurations head to the API reference: https://python.langchain.com/v0.2/api_reference/community/document_loaders/langchain_community.document_loaders.__module_name___loader.__ModuleName__Loader.html