The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: Use default load() implementation in doc loaders (#18385)
Christophe Bornet177f51c7bd04
diff --git a/libs/community/langchain_community/document_loaders/acreom.py b/libs/community/langchain_community/document_loaders/acreom.pyindex 618883270d..b6eccfeac0 100644--- a/libs/community/langchain_community/document_loaders/acreom.py+++ b/libs/community/langchain_community/document_loaders/acreom.py@@ -1,6 +1,6 @@import refrom pathlib import Path-from typing import Iterator, List+from typing import Iteratorfrom langchain_core.documents import Document@@ -74,6 +74,3 @@ class AcreomLoader(BaseLoader):}yield Document(page_content=text, metadata=metadata)-- def load(self) -> List[Document]:- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/airbyte.py b/libs/community/langchain_community/document_loaders/airbyte.pyindex a9609c55b6..323c37fc35 100644--- a/libs/community/langchain_community/document_loaders/airbyte.py+++ b/libs/community/langchain_community/document_loaders/airbyte.py@@ -1,4 +1,4 @@-from typing import Any, Callable, Iterator, List, Mapping, Optional+from typing import Any, Callable, Iterator, Mapping, Optionalfrom langchain_core.documents import Documentfrom langchain_core.utils.utils import guard_import@@ -53,9 +53,6 @@ class AirbyteCDKLoader(BaseLoader):self._stream_name = stream_nameself._state = state- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:return self._integration._load_data(stream_name=self._stream_name, state=self._statediff --git a/libs/community/langchain_community/document_loaders/airtable.py b/libs/community/langchain_community/document_loaders/airtable.pyindex 1ca7fb1de9..c39ed1fe63 100644--- a/libs/community/langchain_community/document_loaders/airtable.py+++ b/libs/community/langchain_community/document_loaders/airtable.py@@ -1,4 +1,4 @@-from typing import Iterator, List+from typing import Iteratorfrom langchain_core.documents import Document@@ -34,7 +34,3 @@ class AirtableLoader(BaseLoader):"table_id": self.table_id,},)-- def load(self) -> List[Document]:- """Load Documents from table."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/arcgis_loader.py b/libs/community/langchain_community/document_loaders/arcgis_loader.pyindex 24264b0add..d927f35e12 100644--- a/libs/community/langchain_community/document_loaders/arcgis_loader.py+++ b/libs/community/langchain_community/document_loaders/arcgis_loader.py@@ -148,7 +148,3 @@ class ArcGISLoader(BaseLoader):)yield Document(page_content=page_content, metadata=metadata)-- def load(self) -> List[Document]:- """Load all records from FeatureLayer."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/astradb.py b/libs/community/langchain_community/document_loaders/astradb.pyindex 976b4a70da..5f1b82cc42 100644--- a/libs/community/langchain_community/document_loaders/astradb.py+++ b/libs/community/langchain_community/document_loaders/astradb.py@@ -76,9 +76,6 @@ class AstraDBLoader(BaseLoader):self.nb_prefetched = nb_prefetchedself.extraction_function = extraction_function- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:for doc in self.collection.paginated_find(filter=self.filter,diff --git a/libs/community/langchain_community/document_loaders/athena.py b/libs/community/langchain_community/document_loaders/athena.pyindex e3ed42e44d..2fcfc9b393 100644--- a/libs/community/langchain_community/document_loaders/athena.py+++ b/libs/community/langchain_community/document_loaders/athena.py@@ -157,7 +157,3 @@ class AthenaLoader(BaseLoader):}doc = Document(page_content=page_content, metadata=metadata)yield doc-- def load(self) -> List[Document]:- """Load data into document objects."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/azure_ai_data.py b/libs/community/langchain_community/document_loaders/azure_ai_data.pyindex 77ac93d3e0..05f404ddd1 100644--- a/libs/community/langchain_community/document_loaders/azure_ai_data.py+++ b/libs/community/langchain_community/document_loaders/azure_ai_data.py@@ -1,4 +1,4 @@-from typing import Iterator, List, Optional+from typing import Iterator, Optionalfrom langchain_community.docstore.document import Documentfrom langchain_community.document_loaders.base import BaseLoader@@ -16,10 +16,6 @@ class AzureAIDataLoader(BaseLoader):self.glob_pattern = glob"""Optional glob pattern to select files. Defaults to None."""- def load(self) -> List[Document]:- """Load documents."""- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""A lazy loader for Documents."""try:diff --git a/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py b/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.pyindex 05e41fbaaa..c069c24f9b 100644--- a/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py+++ b/libs/community/langchain_community/document_loaders/baiducloud_bos_directory.py@@ -1,4 +1,4 @@-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -18,9 +18,6 @@ class BaiduBOSDirectoryLoader(BaseLoader):self.bucket = bucketself.prefix = prefix- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Load documents."""try:diff --git a/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py b/libs/community/langchain_community/document_loaders/baiducloud_bos_file.pyindex 4f853ba3dd..dca4cd544f 100644--- a/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py+++ b/libs/community/langchain_community/document_loaders/baiducloud_bos_file.py@@ -1,7 +1,7 @@import loggingimport osimport tempfile-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -24,9 +24,6 @@ class BaiduBOSFileLoader(BaseLoader):self.bucket = bucketself.key = key- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Load documents."""try:diff --git a/libs/community/langchain_community/document_loaders/bibtex.py b/libs/community/langchain_community/document_loaders/bibtex.pyindex 1cae90b8d8..49f9c6b2db 100644--- a/libs/community/langchain_community/document_loaders/bibtex.py+++ b/libs/community/langchain_community/document_loaders/bibtex.py@@ -96,16 +96,3 @@ class BibtexLoader(BaseLoader):doc = self._load_entry(entry)if doc:yield doc-- def load(self) -> List[Document]:- """Load bibtex file documents from the given bibtex file path.-- See https://bibtexparser.readthedocs.io/en/master/-- Args:- file_path: the path to the bibtex file-- Returns:- a list of documents with the document.page_content in text format- """- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/browserless.py b/libs/community/langchain_community/document_loaders/browserless.pyindex 03d8dcec9a..3a315be44b 100644--- a/libs/community/langchain_community/document_loaders/browserless.py+++ b/libs/community/langchain_community/document_loaders/browserless.py@@ -61,7 +61,3 @@ class BrowserlessLoader(BaseLoader):"source": url,},)-- def load(self) -> List[Document]:- """Load Documents from URLs."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/cassandra.py b/libs/community/langchain_community/document_loaders/cassandra.pyindex 3cef56a1cb..cc2e8f7d62 100644--- a/libs/community/langchain_community/document_loaders/cassandra.py+++ b/libs/community/langchain_community/document_loaders/cassandra.py@@ -5,7 +5,6 @@ from typing import (Any,Callable,Iterator,- List,Optional,Sequence,Union,@@ -106,9 +105,6 @@ class CassandraLoader(BaseLoader):if query_execution_profile is not _NOT_SET:self.query_kwargs["execution_profile"] = query_execution_profile- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:for row in self.session.execute(self.query, **self.query_kwargs):metadata = self.metadata.copy()diff --git a/libs/community/langchain_community/document_loaders/chromium.py b/libs/community/langchain_community/document_loaders/chromium.pyindex 7af99aed26..668466a7ff 100644--- a/libs/community/langchain_community/document_loaders/chromium.py+++ b/libs/community/langchain_community/document_loaders/chromium.py@@ -78,14 +78,3 @@ class AsyncChromiumLoader(BaseLoader):html_content = asyncio.run(self.ascrape_playwright(url))metadata = {"source": url}yield Document(page_content=html_content, metadata=metadata)-- def load(self) -> List[Document]:- """- Load and return all Documents from the provided URLs.-- Returns:- List[Document]: A list of Document objects- containing the scraped content from each URL.-- """- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/couchbase.py b/libs/community/langchain_community/document_loaders/couchbase.pyindex fabc0a7398..5d89016202 100644--- a/libs/community/langchain_community/document_loaders/couchbase.py+++ b/libs/community/langchain_community/document_loaders/couchbase.py@@ -68,10 +68,6 @@ class CouchbaseLoader(BaseLoader):self.page_content_fields = page_content_fieldsself.metadata_fields = metadata_fields- def load(self) -> List[Document]:- """Load Couchbase data into Document objects."""- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Load Couchbase data into Document objects lazily."""from datetime import timedeltadiff --git a/libs/community/langchain_community/document_loaders/dataframe.py b/libs/community/langchain_community/document_loaders/dataframe.pyindex 848f4d9d07..744185f053 100644--- a/libs/community/langchain_community/document_loaders/dataframe.py+++ b/libs/community/langchain_community/document_loaders/dataframe.py@@ -1,4 +1,4 @@-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -26,10 +26,6 @@ class BaseDataFrameLoader(BaseLoader):metadata.pop(self.page_content_column)yield Document(page_content=text, metadata=metadata)- def load(self) -> List[Document]:- """Load full dataframe."""- return list(self.lazy_load())-class DataFrameLoader(BaseDataFrameLoader):"""Load `Pandas` DataFrame."""diff --git a/libs/community/langchain_community/document_loaders/doc_intelligence.py b/libs/community/langchain_community/document_loaders/doc_intelligence.pyindex 2aae5212a5..e0fc189405 100644--- a/libs/community/langchain_community/document_loaders/doc_intelligence.py+++ b/libs/community/langchain_community/document_loaders/doc_intelligence.py@@ -1,4 +1,4 @@-from typing import Iterator, List, Optional+from typing import Iterator, Optionalfrom langchain_core.documents import Document@@ -77,10 +77,6 @@ class AzureAIDocumentIntelligenceLoader(BaseLoader):mode=mode,)- def load(self) -> List[Document]:- """Load given path as pages."""- return list(self.lazy_load())-def lazy_load(self,) -> Iterator[Document]:diff --git a/libs/community/langchain_community/document_loaders/etherscan.py b/libs/community/langchain_community/document_loaders/etherscan.pyindex eb057b4b60..ff78aa90a9 100644--- a/libs/community/langchain_community/document_loaders/etherscan.py+++ b/libs/community/langchain_community/document_loaders/etherscan.py@@ -71,10 +71,6 @@ class EtherscanLoader(BaseLoader):for doc in result:yield doc- def load(self) -> List[Document]:- """Load transactions from spcifc account by Etherscan."""- return list(self.lazy_load())-def getNormTx(self) -> List[Document]:url = (f"https://api.etherscan.io/api?module=account&action=txlist&address={self.account_address}"diff --git a/libs/community/langchain_community/document_loaders/fauna.py b/libs/community/langchain_community/document_loaders/fauna.pyindex 5b17216dc0..bbfda73785 100644--- a/libs/community/langchain_community/document_loaders/fauna.py+++ b/libs/community/langchain_community/document_loaders/fauna.py@@ -1,4 +1,4 @@-from typing import Iterator, List, Optional, Sequence+from typing import Iterator, Optional, Sequencefrom langchain_core.documents import Document@@ -28,9 +28,6 @@ class FaunaLoader(BaseLoader):self.secret = secretself.metadata_fields = metadata_fields- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:try:from fauna import Page, fqldiff --git a/libs/community/langchain_community/document_loaders/generic.py b/libs/community/langchain_community/document_loaders/generic.pyindex 1573ec5c47..191149618b 100644--- a/libs/community/langchain_community/document_loaders/generic.py+++ b/libs/community/langchain_community/document_loaders/generic.py@@ -115,10 +115,6 @@ class GenericLoader(BaseLoader):for blob in self.blob_loader.yield_blobs():yield from self.blob_parser.lazy_parse(blob)- def load(self) -> List[Document]:- """Load all documents."""- return list(self.lazy_load())-def load_and_split(self, text_splitter: Optional[TextSplitter] = None) -> List[Document]:diff --git a/libs/community/langchain_community/document_loaders/geodataframe.py b/libs/community/langchain_community/document_loaders/geodataframe.pyindex 09a4c5ae9f..3f867fef23 100644--- a/libs/community/langchain_community/document_loaders/geodataframe.py+++ b/libs/community/langchain_community/document_loaders/geodataframe.py@@ -1,4 +1,4 @@-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -67,7 +67,3 @@ class GeoDataFrameLoader(BaseLoader):# using WKT instead of str() to help GIS system interoperabilityyield Document(page_content=geom.wkt, metadata=metadata)-- def load(self) -> List[Document]:- """Load full dataframe."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/github.py b/libs/community/langchain_community/document_loaders/github.pyindex c912c1b59d..b896a61566 100644--- a/libs/community/langchain_community/document_loaders/github.py+++ b/libs/community/langchain_community/document_loaders/github.py@@ -127,32 +127,6 @@ class GitHubIssuesLoader(BaseGitHubLoader):else:url = None- def load(self) -> List[Document]:- """- Get issues of a GitHub repository.-- Returns:- A list of Documents with attributes:- - page_content- - metadata- - url- - title- - creator- - created_at- - last_update_time- - closed_time- - number of comments- - state- - labels- - assignee- - assignees- - milestone- - locked- - number- - is_pull_request- """- return list(self.lazy_load())-def parse_issue(self, issue: dict) -> Document:"""Create Document objects from a list of GitHub issues."""metadata = {diff --git a/libs/community/langchain_community/document_loaders/hugging_face_dataset.py b/libs/community/langchain_community/document_loaders/hugging_face_dataset.pyindex 77841e56a7..4aafc42b68 100644--- a/libs/community/langchain_community/document_loaders/hugging_face_dataset.py+++ b/libs/community/langchain_community/document_loaders/hugging_face_dataset.py@@ -1,5 +1,5 @@import json-from typing import Iterator, List, Mapping, Optional, Sequence, Union+from typing import Iterator, Mapping, Optional, Sequence, Unionfrom langchain_core.documents import Document@@ -84,10 +84,6 @@ class HuggingFaceDatasetLoader(BaseLoader):for row in dataset[key])- def load(self) -> List[Document]:- """Load documents."""- return list(self.lazy_load())-def parse_obj(self, page_content: Union[str, object]) -> str:if isinstance(page_content, object):return json.dumps(page_content)diff --git a/libs/community/langchain_community/document_loaders/hugging_face_model.py b/libs/community/langchain_community/document_loaders/hugging_face_model.pyindex 07dec204ff..4486a49a2e 100644--- a/libs/community/langchain_community/document_loaders/hugging_face_model.py+++ b/libs/community/langchain_community/document_loaders/hugging_face_model.py@@ -106,7 +106,3 @@ class HuggingFaceModelLoader(BaseLoader):page_content=readme_content,metadata=model,)-- def load(self) -> List[Document]:- """Load model information, including README content."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/joplin.py b/libs/community/langchain_community/document_loaders/joplin.pyindex 50a19f1405..407af7e6a3 100644--- a/libs/community/langchain_community/document_loaders/joplin.py+++ b/libs/community/langchain_community/document_loaders/joplin.py@@ -91,6 +91,3 @@ class JoplinLoader(BaseLoader):def lazy_load(self) -> Iterator[Document]:yield from self._get_notes()-- def load(self) -> List[Document]:- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/larksuite.py b/libs/community/langchain_community/document_loaders/larksuite.pyindex 5e6e278735..1ab61a9845 100644--- a/libs/community/langchain_community/document_loaders/larksuite.py+++ b/libs/community/langchain_community/document_loaders/larksuite.py@@ -1,6 +1,6 @@import jsonimport urllib.request-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -46,7 +46,3 @@ class LarkSuiteDocLoader(BaseLoader):"title": metadata_json["data"]["document"]["title"],}yield Document(page_content=text, metadata=metadata)-- def load(self) -> List[Document]:- """Load LarkSuite (FeiShu) document."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/max_compute.py b/libs/community/langchain_community/document_loaders/max_compute.pyindex b5cadbbaf9..4b507da89c 100644--- a/libs/community/langchain_community/document_loaders/max_compute.py+++ b/libs/community/langchain_community/document_loaders/max_compute.py@@ -1,6 +1,6 @@from __future__ import annotations-from typing import Any, Iterator, List, Optional, Sequence+from typing import Any, Iterator, Optional, Sequencefrom langchain_core.documents import Document@@ -78,6 +78,3 @@ class MaxComputeLoader(BaseLoader):else:metadata = {k: v for k, v in row.items() if k not in page_content_data}yield Document(page_content=page_content, metadata=metadata)-- def load(self) -> List[Document]:- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/mediawikidump.py b/libs/community/langchain_community/document_loaders/mediawikidump.pyindex 6d0f1d0e42..288312d6c9 100644--- a/libs/community/langchain_community/document_loaders/mediawikidump.py+++ b/libs/community/langchain_community/document_loaders/mediawikidump.py@@ -1,6 +1,6 @@import loggingfrom pathlib import Path-from typing import Iterator, List, Optional, Sequence, Union+from typing import Iterator, Optional, Sequence, Unionfrom langchain_core.documents import Document@@ -87,11 +87,6 @@ class MWDumpLoader(BaseLoader):metadata = {"source": page.title}return Document(page_content=text, metadata=metadata)- def load(self) -> List[Document]:- """Load from a file path."""-- return [doc for doc in self.lazy_load()]-def lazy_load(self,) -> Iterator[Document]:diff --git a/libs/community/langchain_community/document_loaders/merge.py b/libs/community/langchain_community/document_loaders/merge.pyindex 9ef1a0fd3c..41f79e53f4 100644--- a/libs/community/langchain_community/document_loaders/merge.py+++ b/libs/community/langchain_community/document_loaders/merge.py@@ -23,10 +23,6 @@ class MergedDataLoader(BaseLoader):for document in data:yield document- def load(self) -> List[Document]:- """Load docs."""- return list(self.lazy_load())-async def alazy_load(self) -> AsyncIterator[Document]:"""Lazy load docs from each individual loader."""for loader in self.loaders:diff --git a/libs/community/langchain_community/document_loaders/onedrive.py b/libs/community/langchain_community/document_loaders/onedrive.pyindex 3d899d0941..4c769c364d 100644--- a/libs/community/langchain_community/document_loaders/onedrive.py+++ b/libs/community/langchain_community/document_loaders/onedrive.py@@ -91,7 +91,3 @@ class OneDriveLoader(O365BaseLoader):if self.object_ids:for blob in self._load_from_object_ids(drive, self.object_ids):yield from blob_parser.lazy_parse(blob)-- def load(self) -> List[Document]:- """Load all documents."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/onenote.py b/libs/community/langchain_community/document_loaders/onenote.pyindex 6e3c6cd097..87c5d78daf 100644--- a/libs/community/langchain_community/document_loaders/onenote.py+++ b/libs/community/langchain_community/document_loaders/onenote.py@@ -109,18 +109,6 @@ class OneNoteLoader(BaseLoader, BaseModel):else:request_url = ""- def load(self) -> List[Document]:- """- Get pages from OneNote notebooks.-- Returns:- A list of Documents with attributes:- - page_content- - metadata- - title- """- return list(self.lazy_load())-def _get_page_content(self, page_id: str) -> str:"""Get page content from OneNote API"""request_url = self.onenote_api_base_url + f"/pages/{page_id}/content"diff --git a/libs/community/langchain_community/document_loaders/open_city_data.py b/libs/community/langchain_community/document_loaders/open_city_data.pyindex ad75421bd3..4c0c1a53c7 100644--- a/libs/community/langchain_community/document_loaders/open_city_data.py+++ b/libs/community/langchain_community/document_loaders/open_city_data.py@@ -1,4 +1,4 @@-from typing import Iterator, List+from typing import Iteratorfrom langchain_core.documents import Document@@ -37,8 +37,3 @@ class OpenCityDataLoader(BaseLoader):"source": self.city_id + "_" + self.dataset_id,},)-- def load(self) -> List[Document]:- """Load records."""-- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/pdf.py b/libs/community/langchain_community/document_loaders/pdf.pyindex ea08605411..c71fbbdab8 100644--- a/libs/community/langchain_community/document_loaders/pdf.py+++ b/libs/community/langchain_community/document_loaders/pdf.py@@ -157,10 +157,6 @@ class PyPDFLoader(BasePDFLoader):super().__init__(file_path, headers=headers)self.parser = PyPDFParser(password=password, extract_images=extract_images)- def load(self) -> List[Document]:- """Load given path as pages."""- return list(self.lazy_load())-def lazy_load(self,) -> Iterator[Document]:diff --git a/libs/community/langchain_community/document_loaders/pubmed.py b/libs/community/langchain_community/document_loaders/pubmed.pyindex de47787d7b..892d93affe 100644--- a/libs/community/langchain_community/document_loaders/pubmed.py+++ b/libs/community/langchain_community/document_loaders/pubmed.py@@ -1,4 +1,4 @@-from typing import Iterator, List, Optional+from typing import Iterator, Optionalfrom langchain_core.documents import Document@@ -32,9 +32,6 @@ class PubMedLoader(BaseLoader):top_k_results=load_max_docs,)- def load(self) -> List[Document]:- return list(self._client.lazy_load_docs(self.query))-def lazy_load(self) -> Iterator[Document]:for doc in self._client.lazy_load_docs(self.query):yield docdiff --git a/libs/community/langchain_community/document_loaders/readthedocs.py b/libs/community/langchain_community/document_loaders/readthedocs.pyindex aee16bab6d..2a0f11f1e3 100644--- a/libs/community/langchain_community/document_loaders/readthedocs.py+++ b/libs/community/langchain_community/document_loaders/readthedocs.py@@ -84,10 +84,6 @@ class ReadTheDocsLoader(BaseLoader):text = self._clean_data(f.read())yield Document(page_content=text, metadata={"source": str(p)})- def load(self) -> List[Document]:- """Load documents."""- return list(self.lazy_load())-def _clean_data(self, data: str) -> str:from bs4 import BeautifulSoupdiff --git a/libs/community/langchain_community/document_loaders/recursive_url_loader.py b/libs/community/langchain_community/document_loaders/recursive_url_loader.pyindex 0888765984..4d3a601914 100644--- a/libs/community/langchain_community/document_loaders/recursive_url_loader.py+++ b/libs/community/langchain_community/document_loaders/recursive_url_loader.py@@ -314,7 +314,3 @@ class RecursiveUrlLoader(BaseLoader):return iter(results or [])else:return self._get_child_links_recursive(self.url, visited)-- def load(self) -> List[Document]:- """Load web pages."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/rocksetdb.py b/libs/community/langchain_community/document_loaders/rocksetdb.pyindex a1783bc552..6e7827cd8d 100644--- a/libs/community/langchain_community/document_loaders/rocksetdb.py+++ b/libs/community/langchain_community/document_loaders/rocksetdb.py@@ -100,9 +100,6 @@ class RocksetLoader(BaseLoader):# ignorepass- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:query_results = self.client.Queries.query(sql=self.querydiff --git a/libs/community/langchain_community/document_loaders/rspace.py b/libs/community/langchain_community/document_loaders/rspace.pyindex cbac4f52e6..cb12c6d6c8 100644--- a/libs/community/langchain_community/document_loaders/rspace.py+++ b/libs/community/langchain_community/document_loaders/rspace.py@@ -124,6 +124,3 @@ class RSpaceLoader(BaseLoader):yield delse:raise ValueError("Unknown global ID type")-- def load(self) -> List[Document]:- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/sharepoint.py b/libs/community/langchain_community/document_loaders/sharepoint.pyindex 211760fe3f..ff84c64305 100644--- a/libs/community/langchain_community/document_loaders/sharepoint.py+++ b/libs/community/langchain_community/document_loaders/sharepoint.py@@ -54,7 +54,3 @@ class SharePointLoader(O365BaseLoader):if self.object_ids:for blob in self._load_from_object_ids(drive, self.object_ids):yield from blob_parser.lazy_parse(blob)-- def load(self) -> List[Document]:- """Load all documents."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/snowflake_loader.py b/libs/community/langchain_community/document_loaders/snowflake_loader.pyindex b37926b5e0..3081a7b716 100644--- a/libs/community/langchain_community/document_loaders/snowflake_loader.py+++ b/libs/community/langchain_community/document_loaders/snowflake_loader.py@@ -122,7 +122,3 @@ class SnowflakeLoader(BaseLoader):metadata = {k: v for k, v in row.items() if k in metadata_columns}doc = Document(page_content=page_content, metadata=metadata)yield doc-- def load(self) -> List[Document]:- """Load data into document objects."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/sql_database.py b/libs/community/langchain_community/document_loaders/sql_database.pyindex 91c1a37684..c3ab2e4cc9 100644--- a/libs/community/langchain_community/document_loaders/sql_database.py+++ b/libs/community/langchain_community/document_loaders/sql_database.py@@ -104,9 +104,6 @@ class SQLDatabaseLoader(BaseLoader):yield Document(page_content=page_content, metadata=metadata)- def load(self) -> List[Document]:- return list(self.lazy_load())-@staticmethoddef page_content_default_mapper(row: sa.RowMapping, column_names: Optional[List[str]] = Nonediff --git a/libs/community/langchain_community/document_loaders/tencent_cos_directory.py b/libs/community/langchain_community/document_loaders/tencent_cos_directory.pyindex b58bfb674f..e62bbbead2 100644--- a/libs/community/langchain_community/document_loaders/tencent_cos_directory.py+++ b/libs/community/langchain_community/document_loaders/tencent_cos_directory.py@@ -1,4 +1,4 @@-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -19,9 +19,6 @@ class TencentCOSDirectoryLoader(BaseLoader):self.bucket = bucketself.prefix = prefix- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Load documents."""try:diff --git a/libs/community/langchain_community/document_loaders/tencent_cos_file.py b/libs/community/langchain_community/document_loaders/tencent_cos_file.pyindex bf9678b981..4ad71d2579 100644--- a/libs/community/langchain_community/document_loaders/tencent_cos_file.py+++ b/libs/community/langchain_community/document_loaders/tencent_cos_file.py@@ -1,6 +1,6 @@import osimport tempfile-from typing import Any, Iterator, List+from typing import Any, Iteratorfrom langchain_core.documents import Document@@ -21,9 +21,6 @@ class TencentCOSFileLoader(BaseLoader):self.bucket = bucketself.key = key- def load(self) -> List[Document]:- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Load documents."""try:diff --git a/libs/community/langchain_community/document_loaders/tensorflow_datasets.py b/libs/community/langchain_community/document_loaders/tensorflow_datasets.pyindex 87dad82e64..07f6510fad 100644--- a/libs/community/langchain_community/document_loaders/tensorflow_datasets.py+++ b/libs/community/langchain_community/document_loaders/tensorflow_datasets.py@@ -1,4 +1,4 @@-from typing import Callable, Dict, Iterator, List, Optional+from typing import Callable, Dict, Iterator, Optionalfrom langchain_core.documents import Document@@ -75,6 +75,3 @@ class TensorflowDatasetLoader(BaseLoader):def lazy_load(self) -> Iterator[Document]:yield from self._tfds_client.lazy_load()-- def load(self) -> List[Document]:- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/tidb.py b/libs/community/langchain_community/document_loaders/tidb.pyindex 0cbf4e77e1..d4e1ba39ba 100644--- a/libs/community/langchain_community/document_loaders/tidb.py+++ b/libs/community/langchain_community/document_loaders/tidb.py@@ -65,7 +65,3 @@ class TiDBLoader(BaseLoader):)metadata = {col: row_data[col] for col in self.metadata_columns}yield Document(page_content=page_content, metadata=metadata)-- def load(self) -> List[Document]:- """Load TiDB data into document objects."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/tomarkdown.py b/libs/community/langchain_community/document_loaders/tomarkdown.pyindex ee384f8132..0ac36b5aeb 100644--- a/libs/community/langchain_community/document_loaders/tomarkdown.py+++ b/libs/community/langchain_community/document_loaders/tomarkdown.py@@ -1,6 +1,6 @@from __future__ import annotations-from typing import Iterator, List+from typing import Iteratorimport requestsfrom langchain_core.documents import Document@@ -28,7 +28,3 @@ class ToMarkdownLoader(BaseLoader):text = response.json()["article"]metadata = {"source": self.url}yield Document(page_content=text, metadata=metadata)-- def load(self) -> List[Document]:- """Load file."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/toml.py b/libs/community/langchain_community/document_loaders/toml.pyindex 34d7ccfbfe..16cd5decb5 100644--- a/libs/community/langchain_community/document_loaders/toml.py+++ b/libs/community/langchain_community/document_loaders/toml.py@@ -1,6 +1,6 @@import jsonfrom pathlib import Path-from typing import Iterator, List, Union+from typing import Iterator, Unionfrom langchain_core.documents import Document@@ -18,10 +18,6 @@ class TomlLoader(BaseLoader):"""Initialize the TomlLoader with a source file or directory."""self.source = Path(source)- def load(self) -> List[Document]:- """Load and return all documents."""- return list(self.lazy_load())-def lazy_load(self) -> Iterator[Document]:"""Lazily load the TOML documents from the source file or directory."""import tomlidiff --git a/libs/community/langchain_community/document_loaders/weather.py b/libs/community/langchain_community/document_loaders/weather.pyindex a2ca0a7d52..51b1f27cd3 100644--- a/libs/community/langchain_community/document_loaders/weather.py+++ b/libs/community/langchain_community/document_loaders/weather.py@@ -2,7 +2,7 @@from __future__ import annotationsfrom datetime import datetime-from typing import Iterator, List, Optional, Sequence+from typing import Iterator, Optional, Sequencefrom langchain_core.documents import Document@@ -43,9 +43,3 @@ class WeatherDataLoader(BaseLoader):metadata = {"queried_at": datetime.now()}content = self.client.run(place)yield Document(page_content=content, metadata=metadata)-- def load(- self,- ) -> List[Document]:- """Load weather data for the given locations."""- return list(self.lazy_load())diff --git a/libs/community/langchain_community/document_loaders/web_base.py b/libs/community/langchain_community/document_loaders/web_base.pyindex daf69b1412..2d5bf1a8e7 100644--- a/libs/community/langchain_community/document_loaders/web_base.py+++ b/libs/community/langchain_community/document_loaders/web_base.py@@ -251,10 +251,6 @@ class WebBaseLoader(BaseLoader):metadata = _build_metadata(soup, path)yield Document(page_content=text, metadata=metadata)- def load(self) -> List[Document]:- """Load text from the url(s) in web_path."""- return list(self.lazy_load())-def aload(self) -> List[Document]:"""Load text from the urls in web_path async into Documents."""diff --git a/libs/langchain/tests/unit_tests/indexes/test_indexing.py b/libs/langchain/tests/unit_tests/indexes/test_indexing.pyindex 59ab527543..4d939815e3 100644--- a/libs/langchain/tests/unit_tests/indexes/test_indexing.py+++ b/libs/langchain/tests/unit_tests/indexes/test_indexing.py@@ -36,10 +36,6 @@ class ToyLoader(BaseLoader):) -> Iterator[Document]:yield from self.documents- def load(self) -> List[Document]:- """Load the documents from the source."""- return list(self.lazy_load())-async def alazy_load(self,) -> AsyncIterator[Document]: