community: Use default load() implementation in doc loaders (#18385)

Following https://github.com/langchain-ai/langchain/pull/18289
This commit is contained in:
Christophe Bornet
2024-03-01 20:46:52 +01:00
committed by GitHub
parent 42341bc787
commit 177f51c7bd
49 changed files with 22 additions and 253 deletions

View File

@@ -1,4 +1,4 @@
from typing import Iterator, List, Optional
from typing import Iterator, Optional
from 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 doc