mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 16:13:25 +00:00
parent
aa7ac57b67
commit
b9c0cf9025
@ -1,4 +1,4 @@
|
||||
from typing import List, Optional
|
||||
from typing import Iterator, Optional
|
||||
|
||||
from langchain_core.documents import Document
|
||||
|
||||
@ -29,16 +29,12 @@ class PsychicLoader(BaseLoader):
|
||||
self.connector_id = ConnectorId(connector_id)
|
||||
self.account_id = account_id
|
||||
|
||||
def load(self) -> List[Document]:
|
||||
"""Load documents."""
|
||||
|
||||
def lazy_load(self) -> Iterator[Document]:
|
||||
psychic_docs = self.psychic.get_documents(
|
||||
connector_id=self.connector_id, account_id=self.account_id
|
||||
)
|
||||
return [
|
||||
Document(
|
||||
for doc in psychic_docs.documents:
|
||||
yield Document(
|
||||
page_content=doc["content"],
|
||||
metadata={"title": doc["title"], "source": doc["uri"]},
|
||||
)
|
||||
for doc in psychic_docs.documents
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user