Source code for langchain_core.document_loaders.blob_loaders
"""Schema for Blobs and Blob Loaders.The goal is to facilitate decoupling of content loading from content parsing code.In addition, content loading code should provide a lazy loading interface by default."""from__future__importannotationsfromabcimportABC,abstractmethodfromtypingimportTYPE_CHECKING# Re-export Blob and PathLike for backwards compatibilityfromlangchain_core.documents.baseimportBlobasBlobfromlangchain_core.documents.baseimportPathLikeasPathLikeifTYPE_CHECKING:fromcollections.abcimportIterable
[docs]classBlobLoader(ABC):"""Abstract interface for blob loaders implementation. Implementer should be able to load raw content from a storage system according to some criteria and return the raw content lazily as a stream of blobs. """
[docs]@abstractmethoddefyield_blobs(self,)->Iterable[Blob]:"""A lazy loader for raw data represented by LangChain's Blob object. Returns: A generator over blobs """
# Re-export Blob and Pathlike for backwards compatibility__all__=["Blob","BlobLoader","PathLike"]