mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 20:16:52 +00:00
community[minor]: Implement lazy_load() for ArxivLoader (#18664)
Integration tests: `tests/integration_tests/utilities/test_arxiv.py` and `tests/integration_tests/document_loaders/test_arxiv.py`
This commit is contained in:
committed by
GitHub
parent
2d96803ddd
commit
1100f8de7a
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, Iterator, List, Optional
|
||||
|
||||
from langchain_core.documents import Document
|
||||
|
||||
@@ -23,8 +23,8 @@ class ArxivLoader(BaseLoader):
|
||||
doc_content_chars_max=doc_content_chars_max, **kwargs
|
||||
)
|
||||
|
||||
def load(self) -> List[Document]:
|
||||
return self.client.load(self.query)
|
||||
def lazy_load(self) -> Iterator[Document]:
|
||||
yield from self.client.lazy_load(self.query)
|
||||
|
||||
def get_summaries_as_docs(self) -> List[Document]:
|
||||
return self.client.get_summaries_as_docs(self.query)
|
||||
|
Reference in New Issue
Block a user